/* Color Variables */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --border-color: #dee2e6;
    --text-color: #333333;
    --text-muted: #6c757d;
    --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--light-bg);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--secondary-color);
}

/* Navbar */
.navbar {
    box-shadow: var(--shadow);
}

.navbar-brand {
    font-size: 24px;
    letter-spacing: 0.5px;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 20px;
    margin-bottom: 30px;
}

.search-bar {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

.search-bar input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
}

.search-bar button {
    padding: 12px 30px;
    background: white;
    color: var(--primary-color);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.search-bar button:hover {
    transform: translateY(-2px);
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--light-bg);
}

.product-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 15px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.product-price-current {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.product-price-original {
    font-size: 16px;
    text-decoration: line-through;
    color: var(--text-muted);
}

.product-discount {
    background: var(--danger-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.product-rating {
    font-size: 14px;
    color: #ffc107;
    margin-bottom: 15px;
}

.product-footer {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.product-footer button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-cart {
    background: var(--primary-color);
    color: white;
}

.btn-add-cart:hover {
    background: var(--secondary-color);
}

.btn-wishlist {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
    width: 45px;
}

.btn-wishlist:hover {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    display: block;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Product Detail Page */
.product-detail-section {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin: 40px 0;
}

.product-image-main {
    width: 100%;
    height: 400px;
    object-fit: contain;
    background: var(--light-bg);
    border-radius: 8px;
}

.product-images-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.thumbnail {
    width: 60px;
    height: 60px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--primary-color);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 20px;
}

.product-info h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
}

.product-meta {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-label {
    font-weight: 600;
    color: var(--text-muted);
}

/* Cart */
.cart-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.cart-summary {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-row.total {
    font-size: 24px;
    font-weight: 700;
    border: none;
    color: var(--primary-color);
}

/* Alerts */
.alert {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Tabs */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 30px;
}

.nav-tabs .nav-link {
    color: var(--text-muted);
    border: none;
    padding: 12px 20px;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background: transparent;
    border-bottom-color: var(--primary-color);
}

/* Pagination */
.pagination {
    margin: 30px 0;
    justify-content: center;
}

.page-link {
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    margin: 0 5px;
    border-radius: 6px;
    padding: 8px 12px;
}

.page-link:hover {
    background: var(--primary-color);
    color: white;
}

.page-link.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Dashboard */
.dashboard-sidebar {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 90px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0;
}

.sidebar-menu a {
    display: block;
    padding: 12px 15px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--light-bg);
    color: var(--primary-color);
}

.dashboard-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* Stats Cards */
.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

/* Admin Panel */
.admin-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    min-height: calc(100vh - 80px);
}

.admin-sidebar {
    background: var(--dark-bg);
    color: white;
    padding: 20px;
    border-radius: 8px;
}

.admin-menu {
    list-style: none;
}

.admin-menu li {
    margin-bottom: 5px;
}

.admin-menu a {
    display: block;
    padding: 12px 15px;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
}

.admin-menu a:hover,
.admin-menu a.active {
    background: var(--primary-color);
    color: white;
}

.admin-content {
    padding: 20px;
}

/* Tables */
.table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table thead {
    background: var(--light-bg);
}

.table th {
    font-weight: 700;
    border: none;
    padding: 15px;
}

.table td {
    padding: 15px;
    border-top: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: var(--light-bg);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 32px;
    }

    .hero-section p {
        font-size: 18px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 20px;
    }

    .product-detail-section {
        padding: 20px;
    }

    .product-image-main {
        height: 300px;
    }

    .product-info {
        padding: 0;
    }

    .admin-container {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        position: static;
    }

    .search-bar {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .hero-section h1 {
        font-size: 24px;
    }

    .product-footer {
        flex-direction: column;
    }

    .product-footer button {
        width: 100%;
    }

    .btn-wishlist {
        width: 100%;
    }

    .product-meta {
        flex-direction: column;
        gap: 10px;
    }
}
