/* Admin Dashboard Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    color: #2c3e50;
    line-height: 1.6;
}

/* Admin Header */
.admin-header {
    background: #2c3e50;
    color: white;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.welcome-text {
    font-size: 0.9rem;
    opacity: 0.9;
}

.logout-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.logout-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* Admin Sidebar */
.admin-sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    width: 250px;
    height: calc(100vh - 70px);
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    z-index: 999;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: #ecf0f1;
    border-left-color: #3498db;
}

.nav-link.active {
    background: #3498db;
    color: white;
    border-left-color: #2980b9;
}

.nav-link i {
    font-size: 1.1rem;
    width: 20px;
}

/* Main Content */
.admin-main {
    margin-left: 250px;
    margin-top: 70px;
    padding: 30px;
    min-height: calc(100vh - 70px);
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.section-header h1 {
    font-size: 2rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header p {
    color: #7f8c8d;
    margin-top: 5px;
}

.add-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-btn:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-card:nth-child(1) .stat-icon { background: #3498db; }
.stat-card:nth-child(2) .stat-icon { background: #e74c3c; }
.stat-card:nth-child(3) .stat-icon { background: #f39c12; }
.stat-card:nth-child(4) .stat-icon { background: #27ae60; }

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-info p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Recent Activity */
.recent-activity {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.recent-activity h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-content p {
    margin-bottom: 5px;
}

.activity-time {
    font-size: 0.8rem;
    color: #7f8c8d;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex-wrap: wrap;
}

.filter-group, .search-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.filter-group select, .search-group input {
    padding: 10px 12px;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    min-width: 180px;
}

.filter-group select:focus, .search-group input:focus {
    outline: none;
    border-color: #3498db;
}

.search-group {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-group i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
}

/* Products Table */
.products-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
}

.products-table th,
.products-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.products-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.products-table tbody tr:hover {
    background: #f8f9fa;
}

.product-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.price {
    font-weight: 600;
    color: #27ae60;
}

.stock {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.stock.in-stock {
    background: #d5f4e6;
    color: #27ae60;
}

.stock.low-stock {
    background: #fef9e7;
    color: #f39c12;
}

.stock.out-of-stock {
    background: #fadbd8;
    color: #e74c3c;
}

.featured-badge {
    background: #f39c12;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.edit-btn {
    background: #3498db;
    color: white;
}

.edit-btn:hover {
    background: #2980b9;
}

.delete-btn {
    background: #e74c3c;
    color: white;
}

.delete-btn:hover {
    background: #c0392b;
}

.feature-btn {
    background: #f39c12;
    color: white;
}

.feature-btn:hover {
    background: #e67e22;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.category-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #3498db;
    color: white;
}

.category-header h3 {
    font-size: 1.2rem;
}

.category-actions {
    display: flex;
    gap: 8px;
}

.category-actions button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.category-actions button:hover {
    background: rgba(255,255,255,0.3);
}

.subcategories-list {
    padding: 20px;
}

.subcategory-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #ecf0f1;
}

.subcategory-item:last-of-type {
    border-bottom: none;
    margin-bottom: 15px;
}

.subcategory-actions {
    display: flex;
    gap: 5px;
}

.edit-subcategory, .delete-subcategory {
    background: transparent;
    border: 1px solid #bdc3c7;
    color: #7f8c8d;
    padding: 4px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.3s ease;
}

.edit-subcategory:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.delete-subcategory:hover {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

.add-subcategory-btn {
    width: 100%;
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.add-subcategory-btn:hover {
    background: #229954;
}

/* Featured Products Manager */
.featured-products-manager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.featured-slots h2,
.available-products h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.featured-grid,
.available-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.featured-product-slot {
    background: white;
    border: 2px dashed #bdc3c7;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.featured-product-slot.filled {
    border: 2px solid #f39c12;
    background: white;
}

.featured-product-slot.empty {
    color: #bdc3c7;
}

.featured-product-slot.empty:hover {
    border-color: #3498db;
    color: #3498db;
}

.available-product-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.available-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.available-product-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.available-product-info {
    padding: 15px;
}

.available-product-info h4 {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #2c3e50;
}

.available-product-price {
    color: #27ae60;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Hero Images Manager */
.hero-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.hero-image-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
}

.hero-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.hero-image-info {
    padding: 20px;
}

.hero-image-info h3 {
    margin-bottom: 8px;
    color: #2c3e50;
}

.hero-image-info p {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.hero-image-order {
    background: #3498db;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.hero-image-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Orders Table */
.orders-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th,
.orders-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.orders-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.order-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.order-status.pending { background: #fef9e7; color: #f39c12; }
.order-status.processing { background: #e8f4fd; color: #3498db; }
.order-status.shipped { background: #e8f6f3; color: #27ae60; }
.order-status.delivered { background: #d5f4e6; color: #27ae60; }
.order-status.cancelled { background: #fadbd8; color: #e74c3c; }

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.settings-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.settings-card h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.save-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
    align-self: flex-start;
}

.save-btn:hover {
    background: #229954;
}

/* Categories Management */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.category-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.category-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.category-actions {
    display: flex;
    gap: 0.5rem;
}

.category-actions button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.category-actions button:hover {
    background: rgba(255,255,255,0.3);
}

.subcategories-list {
    padding: 1.5rem;
}

.subcategory-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.subcategory-item:last-of-type {
    border-bottom: none;
}

.subcategory-item span {
    font-weight: 500;
    color: #333;
}

.subcategory-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-subcategory, .delete-subcategory {
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.edit-subcategory {
    color: #667eea;
}

.edit-subcategory:hover {
    background: rgba(102, 126, 234, 0.1);
}

.delete-subcategory {
    color: #e74c3c;
}

.delete-subcategory:hover {
    background: rgba(231, 76, 60, 0.1);
}

.add-subcategory-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 1rem;
    font-weight: 500;
    transition: transform 0.3s;
}

.add-subcategory-btn:hover {
    transform: translateY(-1px);
}

/* Alert Notifications */
.admin-alert {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.admin-alert button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    margin-left: auto;
    padding: 0.25rem;
    border-radius: 3px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.admin-alert button:hover {
    opacity: 1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    backdrop-filter: blur(3px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid #ecf0f1;
}

.modal-header h2 {
    color: #2c3e50;
}

.close-btn {
    background: #e74c3c;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: #c0392b;
}

.modal-form {
    padding: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.image-upload-area {
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.image-upload-area:hover {
    border-color: #3498db;
    background: #ecf0f1;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #7f8c8d;
}

.upload-placeholder i {
    font-size: 2rem;
}

.image-preview {
    max-width: 100%;
    border-radius: 8px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.cancel-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.cancel-btn:hover {
    background: #7f8c8d;
}

.submit-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.submit-btn:hover {
    background: #2980b9;
}

/* Search Bar */
.search-bar {
    position: relative;
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: #3498db;
}

.search-bar i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .admin-sidebar {
        width: 200px;
    }
    
    .admin-main {
        margin-left: 200px;
    }
}

@media (max-width: 992px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .admin-sidebar.active {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .featured-products-manager {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-main {
        padding: 20px 15px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .filters-bar {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-form {
        padding: 20px;
    }
    
    .admin-nav {
        padding: 0 15px;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
}
