/*
 * Moon Lit Jewels - Admin Dashboard Stylesheet
 * Dark premium theme matching the brand
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;600;700&display=swap');

:root {
    --admin-bg: #070a13;
    --admin-card: #0d1326;
    --admin-sidebar: #0a0f1f;
    --admin-border: rgba(212, 175, 55, 0.15);
    --admin-text: rgba(255, 255, 255, 0.8);
    --admin-text-muted: rgba(255, 255, 255, 0.5);
    --gold: #D4AF37;
    --gold-light: #F3E5AB;
    --gold-dark: #AA7C11;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--admin-bg);
    color: var(--admin-text);
    min-height: 100vh;
    display: flex;
}

/* ========== SIDEBAR ========== */
.admin-sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--admin-sidebar);
    border-right: 1px solid var(--admin-border);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid var(--admin-border);
    text-align: center;
}

.sidebar-brand h4 {
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    font-size: 1.25rem;
    margin: 0 0 4px 0;
}

.sidebar-brand small {
    color: var(--admin-text-muted);
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    list-style: none;
}

.sidebar-nav li { margin: 2px 12px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--admin-text);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 400;
    transition: all 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold);
}

.sidebar-nav a.active {
    border-left: 3px solid var(--gold);
    padding-left: 13px;
}

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

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--admin-border);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--danger);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 0;
    transition: opacity 0.2s;
}

.sidebar-footer a:hover { opacity: 0.8; }

/* ========== MAIN CONTENT ========== */
.admin-main {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: var(--admin-card);
    border-bottom: 1px solid var(--admin-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-topbar h5 {
    font-family: 'Playfair Display', serif;
    color: #fff;
    font-size: 1.1rem;
    margin: 0;
}

.admin-topbar .admin-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--admin-text-muted);
    font-size: 0.85rem;
}

.admin-topbar .admin-user i {
    color: var(--gold);
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--gold);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px 8px;
}

.admin-content {
    flex: 1;
    padding: 32px;
}

/* ========== STAT CARDS ========== */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.15);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.stat-card .stat-icon.gold { background: rgba(212, 175, 55, 0.15); color: var(--gold); }
.stat-card .stat-icon.green { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.stat-card .stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.stat-card .stat-icon.orange { background: rgba(245, 158, 11, 0.15); color: var(--warning); }

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--admin-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========== CARDS & PANELS ========== */
.admin-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--admin-border);
}

.admin-card-header h6 {
    font-family: 'Playfair Display', serif;
    color: #fff;
    font-size: 1rem;
    margin: 0;
}

/* ========== TABLES ========== */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    color: var(--admin-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--admin-border);
    font-weight: 600;
    white-space: nowrap;
}

.admin-table tbody td {
    padding: 12px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: rgba(212, 175, 55, 0.03);
}

.admin-table .table-img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--admin-border);
}

/* ========== BADGES ========== */
.badge-active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-featured {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ========== BUTTONS ========== */
.btn-gold {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
    color: #000;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    color: #000;
}

.btn-outline-gold {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-outline-gold:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-danger-sm {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-danger-sm:hover {
    background: rgba(239, 68, 68, 0.25);
    color: var(--danger);
}

.btn-edit-sm {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-edit-sm:hover {
    background: rgba(59, 130, 246, 0.25);
    color: var(--info);
}

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

/* ========== FORMS ========== */
.form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--admin-text);
    margin-bottom: 6px;
}

.form-control, .form-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--admin-border);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-control:focus, .form-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
    color: #fff;
}

.form-control::placeholder { color: var(--admin-text-muted); }

.form-select option {
    background: var(--admin-card);
    color: #fff;
}

.form-check-input:checked {
    background-color: var(--gold);
    border-color: var(--gold);
}

textarea.form-control { min-height: 100px; resize: vertical; }

.image-preview {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid var(--admin-border);
    margin-top: 8px;
}

.current-image-wrap {
    position: relative;
    display: inline-block;
    margin-top: 8px;
}

.current-image-wrap img {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--admin-border);
}

.current-image-wrap small {
    display: block;
    text-align: center;
    color: var(--admin-text-muted);
    font-size: 0.7rem;
    margin-top: 4px;
}

/* ========== GALLERY GRID (Admin) ========== */
.admin-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.admin-gallery-item {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.admin-gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.admin-gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.admin-gallery-item .gallery-item-info {
    padding: 12px;
}

.admin-gallery-item .gallery-item-info h6 {
    font-size: 0.85rem;
    color: #fff;
    margin: 0 0 4px;
}

.admin-gallery-item .gallery-item-info p {
    font-size: 0.75rem;
    color: var(--admin-text-muted);
    margin: 0 0 8px;
}

/* ========== PRODUCT IMAGES GRID ========== */
.product-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.product-image-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--admin-border);
}

.product-image-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.product-image-card .delete-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.product-image-card:hover .delete-overlay {
    opacity: 1;
}

/* ========== ALERT OVERRIDES ========== */
.alert {
    border-radius: 8px;
    font-size: 0.9rem;
    border: none;
}

.alert-success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.alert-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.alert-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.alert-info { background: rgba(59, 130, 246, 0.15); color: var(--info); }

.btn-close { filter: invert(1); }

/* ========== LOGIN PAGE ========== */
.login-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--admin-bg);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-card {
    background: rgba(13, 19, 38, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 40px rgba(212, 175, 55, 0.05);
    z-index: 10;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6), 0 0 50px rgba(212, 175, 55, 0.1);
}

.login-card .login-logo {
    margin-bottom: 28px;
}

.login-card .login-logo h3 {
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    font-size: 1.6rem;
    margin: 0 0 6px;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-card .login-logo small {
    color: var(--gold);
    font-size: 0.72rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.8;
}

.login-card h5 {
    color: #fff;
    margin-bottom: 8px;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
}

.login-card p.login-subtitle {
    color: var(--admin-text-muted);
    font-size: 0.88rem;
    margin-bottom: 28px;
}

.login-card .form-control {
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.92rem;
}

.login-card .form-control:focus {
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
    background: rgba(255, 255, 255, 0.06);
}

.login-card .btn-gold {
    width: 100%;
    padding: 13px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    justify-content: center;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
    transition: all 0.3s ease;
}

.login-card .btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.35);
    transform: translateY(-1px);
}

.login-bg-glow-1 {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.06) 0%, rgba(0, 0, 0, 0) 70%);
    top: 15%;
    left: 20%;
    z-index: 1;
    pointer-events: none;
}

.login-bg-glow-2 {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(58, 134, 255, 0.04) 0%, rgba(0, 0, 0, 0) 70%);
    bottom: 10%;
    right: 15%;
    z-index: 1;
    pointer-events: none;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.show { display: block; }

    .admin-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .admin-content {
        padding: 20px 16px;
    }

    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (max-width: 575.98px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }

    .admin-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .login-card {
        padding: 28px 20px;
    }
}
