@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* --- THEME VARIABLES --- */
:root {
    /* DEFAULT DARK THEME (Modern Slate) */
    --bg-main: #0f172a;
    /* Slate 900 */
    --bg-sidebar: #1e293b;
    /* Slate 800 */
    --bg-card: #1e293b;
    --bg-input: #334155;
    /* Slate 700 */
    --bg-hover: #334155;
    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --border-color: #334155;
    --accent-color: #3b82f6;
    /* Blue 500 */
    --accent-hover: #2563eb;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --modal-overlay: rgba(0, 0, 0, 0.85);
    --font-main: 'Inter', sans-serif;
    --radius: 0.5rem;
}

/* ... existing code (Themes) ... */

[data-theme="light"] {
    /* LIGHT THEME (Clean Porcelain) */
    --bg-main: #f8fafc;
    /* Slate 50 */
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f1f5f9;
    /* Slate 100 */
    --bg-hover: #e2e8f0;
    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */
    --border-color: #e2e8f0;
    /* Slate 200 */
    --accent-color: #0ea5e9;
    /* Sky 500 */
    --accent-hover: #0284c7;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --modal-overlay: rgba(0, 0, 0, 0.4);
    --radius: 0.5rem;
}

[data-theme="girly"] {
    /* CUTIE THEME (Refined Pastel) */
    --bg-main: #fff0f5;
    /* Lavender Blush (Very light pink) */
    --bg-sidebar: #ffe4e6;
    /* Soft Rose */
    --bg-card: #ffffff;
    /* Pure White Cards */
    --bg-input: #fff5f7;
    /* Very pale pink input */
    --bg-hover: #fce7f3;
    /* Pink 100 */
    --text-main: #883a62;
    /* Muted Mauve/Dark Pink */
    --text-muted: #be7a98;
    /* Soft Dusty Rose */
    --border-color: #fbcfe8;
    /* Pastel Pink Border */
    --accent-color: #f472b6;
    /* Soft Pink Accent */
    --accent-hover: #ec4899;
    /* Deeper Pink Hover */
    --card-shadow: 0 8px 20px -5px rgba(244, 114, 182, 0.25), 0 4px 6px -2px rgba(244, 114, 182, 0.1);
    --modal-overlay: rgba(136, 58, 98, 0.4);
    --font-main: 'Quicksand', sans-serif;
    --radius: 1.25rem;
    /* Soft rounded corners */
}

/* --- CORE & RESET --- */
body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
    line-height: 1.5;
}

/* --- UTILITIES --- */
.text-theme-main {
    color: var(--text-main);
}

.text-theme-muted {
    color: var(--text-muted);
}

.bg-theme-card {
    background-color: var(--bg-card);
}

.bg-theme-input {
    background-color: var(--bg-input);
}

.border-theme {
    border-color: var(--border-color);
}

.text-accent {
    color: var(--accent-color);
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --- SIDEBAR --- */
#sidebar {
    flex-shrink: 0;
    transition: transform 0.3s ease-in-out;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    width: 85vw;
    max-width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
}

#sidebar.open {
    transform: translateX(0);
}

.filter-bar {
    display: flex;
    grid-template-columns: unset !important;
}

.toggle-width {
    width: 86px;
}

@media (max-width: 768px) {
    .filter-bar {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    }

    #categoryList .text-xs {
        font-size: 1.15rem;
        line-height: 1.75rem;
    }

    #categoryList span {
        font-size: 1.15rem;
    }

    #categoryList .ml-2.mt-1 {
        margin-top: 0.75rem;
    }

    #statList {
        margin-bottom: 50px;
    }

    #sidebar {
        position: fixed !important;
        top: 0;
        left: -100% !important;
        /* Force it off-screen by default */
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh;
        z-index: 9999;
        transition: left 0.3s ease-in-out;
        background-color: var(--bg-sidebar);
        display: flex !important;
        /* Ensure content isn't hidden */
    }

    /* This class is added by JS to bring it on-screen */
    #sidebar.active {
        left: 0 !important;
        transform: none !important;
        /* Override any other transforms */
    }

    #mobileMenuOverlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 90;
        backdrop-filter: blur(4px);
    }

    /* Adjust the main content area so it doesn't try to flex beside a fixed sidebar */
    body {
        display: block;
    }

    main {
        padding-bottom: 80px;
        /* Space for the floating button */
    }
}

#fixedHamburger {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    z-index: 99999;
}

/* --- MODALS --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: var(--bg-card);
    margin: 5vh auto;
    padding: 2rem;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius);
    position: relative;
    box-shadow: var(--card-shadow);
    color: var(--text-main);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- INPUTS --- */
input,
select,
textarea {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-color);
}

/* Specific fix for Cutie theme focus ring opacity */
[data-theme="girly"] input:focus,
[data-theme="girly"] select:focus {
    box-shadow: 0 0 0 2px rgba(244, 114, 182, 0.5);
    border-color: var(--accent-color);
}

/* --- ITEM CARDS --- */
.items-grid-container {
    display: grid;
    /* Changed minmax to 130px to fit 2 items on standard mobile (360px width) with gaps */
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
}

.item-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--card-shadow);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

[data-theme="girly"] .item-card {
    border: 2px solid transparent;
}

[data-theme="girly"] .item-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--accent-color);
}

.item-card .img-container {
    aspect-ratio: 3/4;
    overflow: hidden;
    position: relative;
    background-color: var(--bg-input);
}

.item-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.item-card:hover img {
    transform: scale(1.05);
}

.card-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* --- LIST VIEW --- */
.list-view-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-view-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    gap: 0;
    /* Handled by internal div structure now */
    transition: all 0.2s ease;
    box-shadow: var(--card-shadow);
    min-height: 80px;
}

.list-view-item:hover {
    border-color: var(--accent-color);
    transform: translateX(4px);
}

/* --- MEMBER CARD --- */
.member-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: var(--card-shadow);
}

.member-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-color);
}

.member-avatar {
    width: 3.5rem;
    height: 3.5rem;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

[data-theme="girly"] .member-avatar {
    background: linear-gradient(135deg, #f9a8d4, #ec4899);
}

/* --- DASHBOARD --- */
.dashboard-section {
    margin-bottom: 2.5rem;
}

.dashboard-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.dashboard-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-grid {
    display: grid;
    /* Use the same responsive logic for dashboard grid */
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
}

/* --- SIDEBAR NAV --- */
.console-list-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.console-list-container.is-open {
    max-height: 1000px;
}

.manufacturer-chevron {
    transition: transform 0.3s ease;
}

.manufacturer-chevron.rotate {
    transform: rotate(90deg);
}

/* --- ADMIN BADGES --- */
.admin-badge {
    background: linear-gradient(90deg, #ef4444, #b91c1c);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 6px;
}

/* --- ADMIN TAB BUTTONS --- */
.admin-tab-btn {
    padding: 0.5rem 1rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.admin-tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.admin-tab-btn:hover:not(.active) {
    color: var(--text-main);
}

.age_rating {
    height: 4.5rem !important;
    background: transparent;
}


.m-left-10 {
    margin-left: 10px;
}

.blur-sm {
    filter: blur(4px);
    user-select: none;
}

input:checked~.toggle-bg {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

input:checked~.dot {
    transform: translateX(100%);
}