/* Custom Styles for E-Commerce Site */

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding-top: 20px;
    background-color: #f8f9fa;
}

.product-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.product-image {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.category-card {
    transition: all 0.3s;
    border: 1px solid #dee2e6;
}

.category-card:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
}

.category-icon {
    color: #007bff;
}

/* Navbar Styles */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Footer Styles */
.footer {
    background-color: #343a40;
    color: white;
    padding: 3rem 0;
    margin-top: 3rem;
}

.footer h5 {
    margin-bottom: 1.5rem;
    font-weight: bold;
}

.footer a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: white;
}

/* Cart Styles */
.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

/* Product Grid/List View */
.view-grid .product-card {
    display: block;
}

.view-list .product-card {
    display: flex;
    flex-direction: row;
}

.view-list .product-card .product-image {
    width: 200px;
    height: 150px;
}

.view-list .product-card .card-body {
    flex: 1;
}

/* Button Styles */
.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #1e7e34;
    border-color: #1e7e34;
}

/* Badge Styles */
.badge {
    padding: 0.5em 0.8em;
    font-size: 0.75em;
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Table Styles */
.table {
    background-color: white;
}

.table thead th {
    border-top: none;
    font-weight: 600;
    color: #495057;
}

/* Form Styles */
.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* Pagination Styles */
.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

.pagination .page-link {
    color: #007bff;
}

.pagination .page-link:hover {
    color: #0056b3;
}

/* Live Search Results */
#liveSearchResults {
    border-radius: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Admin Dashboard */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 0.5rem 1rem;
}

.sidebar .nav-link.active {
    color: #007bff;
}

.sidebar .nav-link:hover {
    color: #0056b3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-image {
        height: 150px;
    }

    .view-list .product-card {
        flex-direction: column;
    }

    .view-list .product-card .product-image {
        width: 100%;
        height: 200px;
    }

    .footer .row > div {
        margin-bottom: 2rem;
    }
}

/* Animation for Add to Cart */
@keyframes cartBounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

.add-to-cart {
    transition: all 0.3s;
}

.add-to-cart:hover {
    animation: cartBounce 1s;
}

/* Price Styles */
.price-old {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.9em;
}

.price-new {
    color: #dc3545;
    font-weight: bold;
    font-size: 1.2em;
}
