/* --- ADMIN DASHBOARD ELITE VERSION --- */
:root {
    --bg-dark: #000000;
    --bg-glass: rgba(15, 15, 15, 0.85);
    --accent-gold: #d4af37;
    --accent-gold-hover: #f1d279;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --danger: #ff4757;
    --success: #2ed573;
    --warning: #ffa502;
    --sidebar-width: 280px;
    --card-radius: 16px;
    --glass-blur: 15px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 0% 0%, rgba(212, 175, 55, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(212, 175, 55, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Scrollbar Style */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #222;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #0a0a0a;
    /* Solid background instead of RGBA */
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    /* Slightly more visible border */
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    z-index: 2000;
    /* Higher Z-index to ensure it is above everything */
    position: fixed;
    height: 100vh;
    top: 0;
    left: 0;
    box-sizing: border-box;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    /* Add shadow for depth */
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 40px;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.sidebar nav {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

/* Sidebar Nav Scrollbar Hide */
.sidebar nav::-webkit-scrollbar {
    width: 0;
}

.nav-item {
    padding: 12px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 12px;
    margin-bottom: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    border: 1px solid transparent;
}

.nav-item i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: translateX(5px);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.15), transparent);
    color: var(--accent-gold);
    border-left: 3px solid var(--accent-gold);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 40px 60px;
    position: relative;
    box-sizing: border-box;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    background: var(--bg-glass);
    padding: 25px 35px;
    border-radius: var(--card-radius);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    margin: 0;
    font-weight: 700;
}

.header #current-date {
    color: var(--accent-gold);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    margin-top: 5px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.stat-card {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: var(--card-radius);
    transition: all 0.4s ease;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.stat-card:hover {
    transform: translateY(-10px);
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 20px 45px rgba(212, 175, 55, 0.1);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    display: block;
    font-family: 'Playfair Display', serif;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

/* Forms & Tables Container */
.admin-section {
    display: none;
    animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.admin-section.active {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-card {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--glass-blur));
    padding: 40px;
    border-radius: var(--card-radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    margin-bottom: 30px;
}

h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent-gold);
}

/* Tables Elite */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.data-table th {
    color: var(--accent-gold);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 2px;
    padding: 15px 25px;
    text-align: left;
    background: transparent;
}

.data-table tbody tr {
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.01);
}

.data-table td {
    padding: 20px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.data-table td:first-child {
    border-left: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px 0 0 12px;
}

.data-table td:last-child {
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 0 12px 12px 0;
}

/* Buttons Elite */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), #b38f2d);
    color: #000;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.2);
}

.btn-primary:hover {
    background: var(--accent-gold-hover);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(212, 175, 55, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: var(--accent-gold);
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--accent-gold);
}

/* Gallery Elite */
.admin-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
}

.gallery-card {
    border-radius: 16px;
    overflow: hidden;
    height: 220px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
}

.gallery-card:hover img {
    transform: scale(1.1);
}

.gallery-actions {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    opacity: 0;
    backdrop-filter: blur(5px);
    transition: all 0.4s ease;
}

.gallery-card:hover .gallery-actions {
    opacity: 1;
}

.gallery-actions button {
    background: #fff;
    color: #000;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-actions button:hover {
    background: var(--accent-gold);
    transform: scale(1.1);
}

/* Badges */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(46, 213, 115, 0.25);
    color: #2ed573;
    border: 1px solid #2ed573;
    box-shadow: 0 0 10px rgba(46, 213, 115, 0.2);
}

.badge-warning {
    background: rgba(255, 165, 2, 0.25);
    color: #ffa502;
    border: 1px solid #ffa502;
}

.badge-danger {
    background: rgba(255, 71, 87, 0.25);
    color: #ff4757;
    border: 1px solid #ff4757;
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.2);
}

/* Inputs Elite */
input,
select,
textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-gold);
    outline: none;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.1);
}

/* AI Suite Styles */
.ai-nav-btn {
    padding: 8px 15px;
    font-size: 0.8rem;
}

.ai-nav-btn.active {
    background: var(--accent-gold);
    color: #000;
}

/* --- RESPONSIVE MOBILE ADAPTATION --- */
@media (max-width: 768px) {

    /* Main Layout */
    .main-content {
        margin-left: 0;
        padding: 20px;
        width: 100%;
        overflow-x: hidden;
    }

    /* Sidebar Hidden by Default */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 250px;
        /* SLightly narrower for mobile */
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
        z-index: 2500;
        /* Super high z-index */
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Overlay for cleaner closing */
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 2400;
        display: none;
        backdrop-filter: blur(3px);
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Header Stack */
    .header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 20px 15px;
        margin-top: 40px;
        /* Space for toggle button */
    }

    .header>div {
        width: 100%;
        justify-content: center;
    }

    /* Toggle Button */
    .mobile-menu-toggle {
        display: block !important;
        /* Visible on mobile */
        position: fixed;
        top: 20px;
        left: 20px;
        background: var(--bg-glass);
        color: var(--accent-gold);
        border: 1px solid rgba(212, 175, 55, 0.3);
        padding: 10px 15px;
        border-radius: 8px;
        z-index: 1001;
        font-size: 1.2rem;
        cursor: pointer;
        backdrop-filter: blur(10px);
    }

    /* Grids to Stack */
    .stats-grid,
    .admin-gallery-grid {
        grid-template-columns: 1fr;
    }

    /* Private Galleries Layout Fix */
    #tab-private-galleries>div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* Forms & Tables */
    .form-card {
        padding: 20px;
        overflow-x: auto;
        /* Scroll horizontal for tables */
    }

    /* Table Scroll */
    .data-table {
        min-width: 600px;
        /* Force scroll */
    }

    /* Fix buttons group flex */
    .form-card>div[style*="display:flex"] {
        flex-direction: column;
        gap: 10px;
    }

    /* Fix buttons inside header of sections */
    .admin-section>div[style*="display: flex"] {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .admin-section>div[style*="justify-content: space-between"] {
        align-items: center;
    }
}

/* Default state for toggle */
.mobile-menu-toggle {
    display: none;
}