/* Boardgame Recommender - CSS Design System */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --sidebar-bg: #0f172a; /* Slate 900 */
    --sidebar-text: #94a3b8; /* Slate 400 */
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: #1e293b; /* Slate 800 */
    --background: #f8fafc; /* Slate 50 */
    --text-main: #0f172a; /* Slate 900 */
    --text-muted: #64748b; /* Slate 500 */
    --border: #e2e8f0; /* Slate 200 */
    --card-bg: #ffffff;
    --header-bg: rgba(255, 255, 255, 0.85);
    
    /* Premium Accent Styles */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-blur: blur(12px);
    --glass-border: 1px solid rgba(226, 232, 240, 0.8);
    --glass-shadow: 0 8px 30px rgba(15, 23, 42, 0.03);
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* Dynamic UI Alert States */
    --success: #10b981;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --danger-border: #fca5a5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --info: #3b82f6;
    --info-bg: #eff6ff;
    --info-border: #bfdbfe;
    --info-text: #1e40af;


    /* Theme-agnostic UI properties with Light theme defaults */
    --input-bg: rgba(255, 255, 255, 0.65);
    --input-focus-bg: #ffffff;
    --btn-secondary-bg: #e2e8f0;
    --btn-secondary-hover-bg: #cbd5e1;
    --theme-toggle-hover-bg: rgba(0, 0, 0, 0.05);
    --dropdown-hover-bg: #f1f5f9;
    --badge-bg: #f1f5f9;
    --badge-hover-bg: #e2e8f0;
    --section-bg: rgba(248, 250, 252, 0.7);
    --playground-tabs-bg: #f1f5f9;
    --th-bg: #f8fafc;
    --th-hover-bg: #f1f5f9;

    /* Dynamic Badges in Recommendation Cards */
    --stat-badge-bg: #f1f5f9;
    --stat-badge-color: #475569;
    --rating-badge-bg: #fef3c7;
    --rating-badge-color: #b45309;
    --complexity-badge-bg: #fae8ff;
    --complexity-badge-color: #86198f;
    --playtime-badge-bg: #e0f2fe;
    --playtime-badge-color: #0369a1;
    --players-badge-bg: #dcfce7;
    --players-badge-color: #15803d;

    /* Skeleton Loading Palette */
    --skeleton-bg: #e2e8f0;
    --skeleton-shimmer: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);

    /* Weight Sliders Palette */
    --slider-container-bg: #f8fafc;
    --slider-badge-bg: #e0e7ff;
    --slider-badge-color: var(--primary);
    --slider-track-bg: #cbd5e1;
}

html[data-theme="dark"] {
    --primary: #6366f1; /* Lighter/more vibrant indigo for dark background */
    --primary-hover: #4f46e5;
    --sidebar-bg: #0b0f19; /* Deeper slate for sidebar in dark mode */
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: #1e293b;
    --background: #0f172a; /* Slate 900 */
    --text-main: #f8fafc; /* Slate 50 */
    --text-muted: #94a3b8; /* Slate 400 */
    --border: #334155; /* Slate 700 */
    --card-bg: #1e293b; /* Slate 800 */
    --header-bg: rgba(15, 23, 42, 0.85); /* Blurred Slate 900 background */
    
    /* Premium Accent Styles */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --glass-bg: rgba(30, 41, 59, 0.7); /* Translucent Slate 800 */
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    
    /* Dynamic UI Alert States */
    --success: #34d399; /* Emerald 400 */
    --success-bg: rgba(6, 78, 59, 0.4); /* Dark green translucent */
    --success-border: rgba(52, 211, 153, 0.2);
    --danger: #f87171; /* Red 400 */
    --danger-bg: rgba(127, 29, 29, 0.4); /* Dark red translucent */
    --danger-border: rgba(248, 113, 113, 0.2);
    --warning: #fbbf24; /* Amber 400 */
    --warning-bg: rgba(120, 53, 15, 0.4); /* Dark amber translucent */
    --warning-border: rgba(251, 191, 36, 0.2);
    --info: #60a5fa; /* Blue 400 */
    --info-bg: rgba(30, 58, 138, 0.4); /* Dark blue translucent */
    --info-border: rgba(96, 165, 250, 0.2);
    --info-text: #93c5fd; /* Light blue text */


    /* Form and Component Accents */
    --input-bg: rgba(15, 23, 42, 0.65);
    --input-focus-bg: #0f172a;
    --btn-secondary-bg: #334155;
    --btn-secondary-hover-bg: #475569;
    --theme-toggle-hover-bg: rgba(255, 255, 255, 0.05);
    --dropdown-hover-bg: #334155;
    --badge-bg: #334155;
    --badge-hover-bg: #475569;
    --section-bg: rgba(15, 23, 42, 0.5);
    --playground-tabs-bg: #1e293b;
    --th-bg: #1e293b;
    --th-hover-bg: #334155;

    /* Dynamic Badges in Recommendation Cards */
    --stat-badge-bg: #334155;
    --stat-badge-color: #cbd5e1;
    --rating-badge-bg: rgba(251, 191, 36, 0.15);
    --rating-badge-color: #fbbf24;
    --complexity-badge-bg: rgba(217, 70, 239, 0.15);
    --complexity-badge-color: #e879f9;
    --playtime-badge-bg: rgba(56, 189, 248, 0.15);
    --playtime-badge-color: #38bdf8;
    --players-badge-bg: rgba(52, 211, 153, 0.15);
    --players-badge-color: #34d399;

    /* Skeleton Loading Palette */
    --skeleton-bg: #334155;
    --skeleton-shimmer: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);

    /* Weight Sliders Palette */
    --slider-container-bg: rgba(15, 23, 42, 0.4);
    --slider-badge-bg: rgba(99, 102, 241, 0.2);
    --slider-badge-color: #a5b4fc;
    --slider-track-bg: #475569;
}

* {
    box-sizing: border-box;
}

body {
    display: flex;
    margin: 0;
    height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 0;
}

/* ── LAYOUT ELEMENTS ── */
#sidebar-wrapper {
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    width: 280px;
    transition: transform 0.3s ease-in-out;
}

body.sidebar-collapsed #sidebar-wrapper {
    transform: translateX(-280px);
}

#main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-left: 280px;
    transition: margin-left 0.3s ease-in-out;
    height: 100vh;
    overflow-y: auto;
}

body.sidebar-collapsed #main-wrapper {
    margin-left: 0;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

#content {
    flex-grow: 1;
    padding: 40px 24px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

@media (max-width: 640px) {
    #content {
        padding: 24px 16px;
    }
}

@media (max-width: 380px) {
    #content {
        padding: 20px 10px;
    }
}

@media (max-width: 768px) {
    #sidebar-wrapper {
        transform: translateX(-280px);
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.25);
    }
    
    #main-wrapper {
        margin-left: 0 !important;
    }

    body.sidebar-open #sidebar-wrapper {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    body.sidebar-open {
        overflow: hidden;
    }
}

/* ── COMMON COMPONENT STYLES ── */

/* Header section with styling variables overrideable by page context */
.header-section {
    margin-bottom: 30px;
    text-align: left;
}

.header-section h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--gradient-start, #4f46e5) 0%, var(--gradient-end, #818cf8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-section p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 0;
}

/* Form Styles */
.form-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--glass-shadow);
    margin-bottom: 30px;
    transition: box-shadow 0.3s ease;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background-color: var(--input-bg);
    color: var(--text-main);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
    background-color: var(--input-focus-bg);
}

/* Buttons */
.btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    outline: none;
}

.btn:active {
    transform: translateY(0);
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--btn-secondary-bg);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--btn-secondary-hover-bg);
}

.btn-outline {
    background-color: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-outline:hover {
    background-color: #eff6ff;
}

@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        padding: 10px 16px;
    }
    .btn-outline {
        min-height: 40px;
        padding: 8px 14px;
    }
}

/* Larger submit action buttons */
.btn-submit {
    background-color: var(--primary);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-submit:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Spinner / Loader */
.status-card {
    background-color: var(--info-bg);
    border: 1px solid var(--info-border);
    border-radius: 12px;
    padding: 20px;
    display: none;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    animation: fadeIn 0.3s ease;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3.5px solid var(--info-border);
    border-top: 3.5px solid var(--info);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.status-text {
    font-weight: 600;
    color: var(--info-text);
    margin: 0;
}

/* ── RECOMMENDATION CARD STYLES ── */
.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    width: 100%;
}

@media (min-width: 1024px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

.rec-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
    animation: slideUp 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.rec-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.35);
}

.rec-card-body {
    display: flex;
    gap: 16px;
    flex-direction: column;
    width: 100%;
}

@media (min-width: 640px) {
    .rec-card-body {
        flex-direction: row;
        align-items: flex-start;
    }
}

.rec-card-thumbnail {
    width: 76px;
    height: 76px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background-color: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.rec-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rec-card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.rec-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.rec-title {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    line-height: 1.3;
    word-break: break-word;
}

.rec-title:hover {
    color: var(--primary);
}

.rec-stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
    margin-bottom: 4px;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background-color: var(--stat-badge-bg);
    color: var(--stat-badge-color);
    white-space: nowrap;
}

.stat-badge.rating {
    background-color: var(--rating-badge-bg);
    color: var(--rating-badge-color);
}

.stat-badge.complexity {
    background-color: var(--complexity-badge-bg);
    color: var(--complexity-badge-color);
}

.stat-badge.playtime {
    background-color: var(--playtime-badge-bg);
    color: var(--playtime-badge-color);
}

.stat-badge.players {
    background-color: var(--players-badge-bg);
    color: var(--players-badge-color);
}

.stat-badge.year {
    background-color: var(--year-badge-bg);
    color: var(--year-badge-color);
}

.badge {
    background-color: #e0e7ff;
    color: #3730a3;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.badge.year-badge, .year-badge {
    background-color: var(--year-badge-bg, rgba(148, 163, 184, 0.12));
    color: var(--year-badge-color, #94a3b8);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    border: 1px solid var(--border);
    letter-spacing: 0.02em;
    text-transform: none;
    flex-shrink: 0;
}

.rec-reason {
    line-height: 1.5;
    color: var(--text-muted);
    margin: 10px 0 0 0;
    font-size: 0.9rem;
    padding: 10px 14px;
    background-color: var(--background);
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    font-style: italic;
    position: relative;
    box-sizing: border-box;
    width: 100%;
}

.rec-reason.loading {
    color: transparent !important;
    background-color: #f1f5f9 !important;
    border-left-color: #cbd5e1 !important;
    overflow: hidden;
}

.rec-reason.loading::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 20%,
        rgba(255, 255, 255, 0.6) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 1.5s infinite;
}

/* Member Affinities styling in cards */
.member-affinities-container {
    margin-top: 12px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    width: 100%;
}

.member-affinities-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.member-affinities-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

@media (min-width: 576px) {
    .member-affinities-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

.member-affinity-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 8px;
    box-shadow: var(--shadow-sm);
}

.member-affinity-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
    min-width: 50px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-affinity-bar-track {
    flex-grow: 1;
    height: 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.member-affinity-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.member-affinity-pct {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 32px;
    text-align: right;
}

@media (max-width: 480px) {
    .rec-card {
        padding: 16px 14px;
        border-radius: var(--radius-md);
    }
    .rec-card-thumbnail {
        align-self: center;
    }
    .rec-title {
        font-size: 1.12rem;
    }
    .rec-reason {
        padding: 8px 12px;
        font-size: 0.88rem;
        margin: 8px 0 0 0;
    }
}

/* Weight Sliders */
.sliders-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    background-color: var(--slider-container-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-top: 5px;
}

@media (min-width: 640px) {
    .sliders-container {
        grid-template-columns: 1fr 1fr;
    }
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.95rem;
}

.slider-badge {
    background-color: var(--slider-badge-bg);
    color: var(--slider-badge-color);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}

.slider-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.weight-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 9999px;
    background: var(--slider-track-bg);
    outline: none;
    transition: background 0.15s ease-in-out;
}

.weight-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: transform 0.1s ease, background 0.15s ease;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

.weight-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--primary-hover);
}

.weight-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: transform 0.1s ease, background 0.15s ease;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

.weight-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    background: var(--primary-hover);
}

@media (max-width: 768px) {
    .weight-slider {
        height: 8px;
        margin: 8px 0;
    }
    .weight-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
    .weight-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }
}

/* ── ANIMATIONS ── */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ── SKELETON LOADING COMPONENTS ── */
.skeleton {
    background: var(--skeleton-bg);
    background-image: var(--skeleton-shimmer);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
    border-radius: 6px;
    display: inline-block;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    width: 100%;
}

.skeleton-text.title {
    height: 18px;
    margin-bottom: 12px;
}

.skeleton-text.short {
    width: 40%;
}

.skeleton-text.medium {
    width: 70%;
}

.skeleton-text.long {
    width: 90%;
}

.skeleton-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skeleton-avatar {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    flex-shrink: 0;
}

/* Skeleton table row styling */
.skeleton-row {
    animation: fadeIn 0.3s ease;
}

.skeleton-row td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border);
}

/* ── COLLECTION CARD SKELETON ── */
.collection-card-skeleton {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
    animation: fadeIn 0.3s ease;
}

.collection-card-skeleton .skeleton-img-box {
    width: 100%;
    height: 160px;
    background: var(--skeleton-bg, #e2e8f0);
    background-image: var(--skeleton-shimmer);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
}

.collection-card-skeleton .skeleton-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.collection-card-skeleton .skeleton-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}

.filters-loading {
    opacity: 0.65;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.filters-loading .filter-section {
    position: relative;
    overflow: hidden;
}

/* ── GRAPHIC EXPORT MODAL STYLES ── */
.export-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.25s ease;
    box-sizing: border-box;
}

.export-modal-dialog {
    background: var(--surface);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-width: 560px;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.export-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.export-modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.export-modal-close:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

.export-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
    max-height: calc(85vh - 70px);
}

.export-graphic-preview {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    background: #090d16;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.export-graphic-preview img {
    max-width: 100%;
    max-height: 60vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.export-modal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 6px;
}

.rec-actions-bar {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 15px;
    margin-bottom: 10px;
    width: 100%;
    box-sizing: border-box;
}

/* ==========================================================================
   Milestone 60: Playgroup Organizer Modern Redesign Design System Components
   ========================================================================== */

/* Accessible visually hidden utility */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Planner Section Base */
.planner-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Active Group Header */
.active-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.active-group-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.group-total-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    background: var(--badge-bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 9999px;
    letter-spacing: 0.02em;
    user-select: none;
}

.groups-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.group-header-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    line-height: 1;
}

.group-header-action-btn:hover {
    background: var(--dropdown-hover-bg);
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.group-header-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.35);
}

/* Attendance Section Header */
.attendance-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 4px;
}

.attendance-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.attendance-heading {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
    margin: 0;
}

.attendance-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.32);
    color: #10b981;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 9999px;
    transition: all 0.2s ease;
    user-select: none;
}

html[data-theme="dark"] .attendance-pill {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.35);
}

.attendance-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-attendance-action {
    background: none;
    border: none;
    padding: 4px 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s ease;
    outline: none;
}

.btn-attendance-action:hover {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary-hover);
    text-decoration: underline;
}

.attendance-action-divider {
    color: var(--border);
    font-size: 0.75rem;
    user-select: none;
}

/* Attendee Avatar Chips */
.member-chips-container,
.member-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 4px 0 16px 0;
    min-height: 42px;
}

.member-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 6px;
    border-radius: 9999px;
    background: var(--input-bg);
    border: 1.5px solid var(--border);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-sizing: border-box;
}

.member-chip:hover {
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.member-chip.active,
.member-chip.checked {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.15);
}

html[data-theme="dark"] .member-chip.active,
html[data-theme="dark"] .member-chip.checked {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(52, 211, 153, 0.45);
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.22);
}

.member-chip:not(.active):not(.checked) {
    opacity: 0.55;
    background: var(--section-bg);
    border-color: var(--border);
}

.member-chip:not(.active):not(.checked):hover {
    opacity: 0.85;
    border-color: rgba(16, 185, 129, 0.35);
}

.chip-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.member-chip:not(.active):not(.checked) .chip-avatar {
    filter: grayscale(40%);
    opacity: 0.7;
}

.chip-username {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.member-chip:not(.active):not(.checked) .chip-username {
    color: var(--text-muted);
}

.chip-indicator {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
}

html[data-theme="dark"] .chip-indicator {
    background: #059669;
}

.chip-check-icon {
    width: 11px;
    height: 11px;
    stroke: currentColor;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: scale(1);
}

.member-chip:not(.active):not(.checked) .chip-indicator {
    background: transparent;
    border: 1.5px dashed var(--border);
    box-shadow: none;
    color: transparent;
}

.member-chip:not(.active):not(.checked) .chip-check-icon {
    transform: scale(0);
    opacity: 0;
}

/* Balanced Preferences Filters Grid */
.planner-filters-section {
    margin-top: 16px;
    margin-bottom: 16px;
}

.planner-filters-title {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.planner-filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .planner-filters-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.planner-filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
}

.filter-icon {
    font-size: 0.9rem;
}

.glass-select-wrapper {
    position: relative;
    width: 100%;
}

.glass-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 10px 36px 10px 14px;
    background: var(--input-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;
}

.glass-select:focus {
    border-color: var(--primary);
    background: var(--input-focus-bg);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.select-chevron {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

/* Planner Action Bar & Generate CTA */
.planner-actions-bar {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-generate-planner {
    flex: 1;
    min-width: 260px;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #4338ca 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
    font-family: inherit;
}

.btn-generate-planner:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 50%, #3730a3 100%);
}

.btn-generate-planner:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.btn-poll-action {
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-poll-action:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
}

/* ── Reusable Announcement Banner (Milestone C10) ── */
.site-announcement-banner {
    position: relative;
    width: 100%;
    z-index: 90;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    animation: bannerSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-announcement-banner.banner-dismissing {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

@keyframes bannerSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.announcement-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.announcement-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.announcement-banner-icon {
    font-size: 1.15rem;
    line-height: 1;
    flex-shrink: 0;
}

.announcement-banner-text {
    color: var(--text-main);
    line-height: 1.4;
}

.announcement-banner-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    padding: 3px 10px;
    border-radius: 999px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.announcement-banner-dismiss {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.announcement-banner-dismiss:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-main);
}

html[data-theme="dark"] .announcement-banner-dismiss:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ── Banner Theme Variants ── */
.site-announcement-banner.banner-info {
    background: rgba(79, 70, 229, 0.08);
    border-bottom-color: rgba(79, 70, 229, 0.25);
}
.site-announcement-banner.banner-info .announcement-banner-cta {
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary, #4f46e5);
}
.site-announcement-banner.banner-info .announcement-banner-cta:hover {
    background: var(--primary, #4f46e5);
    color: #ffffff;
}

.site-announcement-banner.banner-event {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.12) 0%, rgba(217, 119, 6, 0.08) 100%);
    border-bottom-color: rgba(245, 158, 11, 0.35);
}
.site-announcement-banner.banner-event .announcement-banner-text {
    font-weight: 600;
}
.site-announcement-banner.banner-event .announcement-banner-cta {
    background: #d97706;
    color: #ffffff;
}
.site-announcement-banner.banner-event .announcement-banner-cta:hover {
    background: #b45309;
}

.site-announcement-banner.banner-promo {
    background: rgba(16, 185, 129, 0.1);
    border-bottom-color: rgba(16, 185, 129, 0.3);
}
.site-announcement-banner.banner-promo .announcement-banner-cta {
    background: #10b981;
    color: #ffffff;
}
.site-announcement-banner.banner-promo .announcement-banner-cta:hover {
    background: #059669;
}

.site-announcement-banner.banner-warning {
    background: rgba(239, 68, 68, 0.1);
    border-bottom-color: rgba(239, 68, 68, 0.3);
}
.site-announcement-banner.banner-warning .announcement-banner-cta {
    background: #ef4444;
    color: #ffffff;
}
.site-announcement-banner.banner-warning .announcement-banner-cta:hover {
    background: #dc2626;
}


