/* Admin Styles */
:root {
    --primary: #0B1F3A;
    --secondary: #F4B400;
    --accent: #2563EB;
    --background: #F8FAFC;
    --text: #1E293B;
    --white: #FFFFFF;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-500: #64748B;
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
}

/* Login Page */
.admin-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #0f172a 50%, var(--accent) 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.admin-login::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(244,180,0,0.08) 0%, transparent 60%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.login-container {
    background: var(--white);
    padding: 45px 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-logo {
    height: 75px;
    margin-bottom: 18px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.login-header h2 {
    color: var(--primary);
    margin: 0 0 6px 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-header p {
    color: var(--gray-500);
    font-size: 14px;
    margin: 0;
    font-weight: 500;
}

.login-form .form-group {
    margin-bottom: 22px;
}

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

.login-form input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--gray-100);
    color: var(--text);
}

.login-form input::placeholder {
    color: var(--gray-500);
}

.login-form input:focus {
    border-color: var(--primary);
    outline: none;
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(11, 31, 58, 0.08);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--gray-500);
    font-style: italic;
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 6px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--primary);
}

.login-form .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
    background: var(--primary);
    border: none;
    border-radius: 10px;
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-form .btn-primary:hover {
    background: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(11, 31, 58, 0.2);
}

.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* Admin Dashboard */
.admin-dashboard {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 280px;
    background: #1E293B;
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header img {
    height: 50px;
    margin-bottom: 15px;
}

.sidebar-header h3 {
    font-size: 18px;
    margin: 0;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
}

.admin-main {
    flex: 1;
    margin-left: 280px;
    background: var(--background);
}

.admin-header {
    background: var(--white);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--primary);
    cursor: pointer;
    padding: 5px;
}

.admin-header h2 {
    color: var(--primary);
    margin: 0;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-info span {
    color: #64748B;
    font-weight: 500;
}

/* Admin Sections */
.admin-section {
    display: none;
    padding: 30px;
}

.admin-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h3 {
    color: var(--primary);
    margin: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 24px;
}

.stat-content h3 {
    font-size: 14px;
    color: #64748B;
    margin: 0 0 5px 0;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

/* Tables */
.products-table,
.orders-table {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--primary);
    color: var(--white);
}

th {
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 15px 20px;
    border-bottom: 1px solid #E2E8F0;
}

tbody tr:hover {
    background: #F8FAFC;
}

.product-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.action-btns {
    display: flex;
    gap: 10px;
}

.action-btn {
    width: 35px;
    height: 35px;
    border-radius: 6px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-btn {
    background: #E0F2FE;
    color: #0284C7;
}

.edit-btn:hover {
    background: #0284C7;
    color: var(--white);
}

.delete-btn {
    background: #FEE2E2;
    color: #DC2626;
}

.delete-btn:hover {
    background: #DC2626;
    color: var(--white);
}

/* Product Form */
.product-form {
    background: var(--white);
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 8px;
}

.form-group {
    margin-bottom: 24px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #F8FAFC;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(11, 31, 58, 0.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #E2E8F0;
}

/* Categories List */
.categories-list {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #E2E8F0;
}

.category-item:last-child {
    border-bottom: none;
}

.category-item span:first-child {
    font-weight: 500;
    color: var(--text);
}

.category-item .count {
    color: #64748B;
    font-size: 14px;
}

/* Order Status */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending {
    background: #FEF3C7;
    color: #92400E;
}

.status-processing {
    background: #DBEAFE;
    color: #1E40AF;
}

.status-completed {
    background: #D1FAE5;
    color: #065F46;
}

.status-cancelled {
    background: #FEE2E2;
    color: #991B1B;
}

/* Responsive */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 250px;
    }
    
    .admin-main {
        margin-left: 250px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .admin-sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }
    
    .admin-sidebar.active {
        transform: translateX(0);
    }
    
    .admin-sidebar::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: -1;
    }
    
    .admin-sidebar.active::after {
        opacity: 1;
        visibility: visible;
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .products-table,
    .orders-table {
        overflow-x: auto;
    }
    
    table {
        min-width: 600px;
    }
}
