/* 
    Futuristic Antigravity Glassmorphism Design System
    Created for: Watch Later Web App
*/

:root {
    --bg: #030306;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-heavy: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.1);
    --border-bright: rgba(255, 255, 255, 0.2);
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.6);
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --neon-purple: #a855f7;
    --neon-blue: #22d3ee;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    --radius: 20px;
    --transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);

    /* Dynamic Spacing System (Control these for vertical compactness) */
    --app-margin: 40px;
    --header-padding: 20px;
    --card-padding: 28px;
    --filter-bar-padding: 16px 20px;
    --filter-group-padding: 12px 0;
    --input-padding: 18px 22px;
    --card-gap: 5px;
    --tier-gap: 15px;
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

html {
    background-color: var(--bg);
    /* Disable double-tap zoom on touch devices; pinch-zoom still works */
    touch-action: manipulation;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Outfit', 'Inter', sans-serif;
    margin: 0;
    overflow-x: hidden;
    min-height: 100vh;
    touch-action: manipulation;
    background-image:
        radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.05) 0%, transparent 50%);
}

/* --- Background Orbs --- */
.bg-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.3;
    animation: drift 25s infinite alternate ease-in-out;
    will-change: transform;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--neon-purple) 0%, transparent 70%);
    top: -200px;
    left: -100px;
    animation-duration: 30s;
}

.orb-2 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    bottom: -250px;
    right: -150px;
    animation-duration: 35s;
    animation-delay: -7s;
}

.orb-3 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--neon-blue) 0%, transparent 70%);
    top: 30%;
    left: 50%;
    animation-duration: 40s;
    animation-delay: -15s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    33% {
        transform: translate(150px, 100px) scale(1.1) rotate(10deg);
    }

    66% {
        transform: translate(-50px, 200px) scale(0.9) rotate(-10deg);
    }

    100% {
        transform: translate(50px, -50px) scale(1.05) rotate(5deg);
    }
}

/* --- Layout --- */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--header-padding) 0;
    margin-bottom: var(--app-margin);
}

#user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

#user-name {
    font-weight: 600;
    margin-right: 10px;
    font-size: 14px;
    opacity: 0.8;
}

h1 {
    margin: 0;
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -2px;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.4) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

h3 {
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* --- Glassmorphism Cards --- */
.glass-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);


    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--card-padding);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    margin-bottom: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.glass-card:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-color: var(--border-bright);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

/* --- Buttons (Condensed Light / Neon) --- */
button {
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    border-radius: 40px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: white;
    background: rgba(255, 255, 255, 0.05);

    position: relative;
    overflow: hidden;
}

button:hover {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

button:active {
    filter: brightness(0.9);
}

#add-btn {
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
    border: none;
    box-shadow: 0 4px 15px var(--accent-glow);
    margin-top: 10px;
}
#save-edit-btn,
#add-tier-btn,
#add-person-btn,
#save-batch-people-btn,
#batch-move-btn,
#batch-people-btn,
.primary-btn {
    background: linear-gradient(135deg, var(--accent) 0%, var(--neon-purple) 100%);
    border: none;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

#login-btn:hover,
#add-btn:hover,
#save-edit-btn:hover,
#add-tier-btn:hover,
#add-person-btn:hover,
#save-batch-people-btn:hover,
#batch-move-btn:hover,
#batch-people-btn:hover,
.primary-btn:hover {
    box-shadow: 0 0 35px rgba(59, 130, 246, 0.6);
    filter: brightness(1.2);
}

#logout-btn,
#delete-entry-btn,
.delete-btn,
#batch-delete-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fecaca;
}

#logout-btn:hover,
#delete-entry-btn:hover,
.delete-btn:hover,
#batch-delete-btn:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.5);
}

.quick-sort-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
    color: white !important;
}

.quick-sort-btn:hover {
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.5) !important;
}

.expand-btn {
    padding: 4px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-dim);
}

.expand-btn svg,
.circle-btn svg {
    width: 14px;
    height: 14px;
}

.circle-btn {
    padding: 4px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-dim);
    transition: var(--transition);
    flex-shrink: 0;
}

.circle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: scale(1.1);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
}

.nav-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);

    border: 1px solid var(--border);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: var(--transition);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
    border-color: var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
}

.nav-btn:active {
    transform: scale(0.95);
}

.nav-btn svg {
    width: 24px;
    height: 24px;
}

/* --- Mode Selector --- */
.mode-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--app-margin);
}

.mode-toggle {
    background: var(--glass);
    padding: 6px;
    border-radius: 40px;
    display: flex;
    gap: 4px;
    border: 1px solid var(--border);

}

.mode-btn {
    padding: 10px 24px;
    font-size: 15px;
    border-radius: 30px;
    background: transparent;
    color: var(--text-dim);
}

.mode-btn.active {
    background: white;
    color: black;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.filter-header-mobile {
    display: none;
}

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: var(--app-margin);
    padding: var(--filter-bar-padding);
    background: rgba(255, 255, 255, 0.03);

    border-radius: var(--radius);
    border: 1px solid var(--border);
    flex-wrap: wrap;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

#search-input {
    min-width: 250px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 12px 20px !important;
    font-size: 14px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: var(--filter-group-padding);
    padding-left: 15px;
    padding-right: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    width: 100%;
    border-left: 4px solid transparent;
    transition: var(--transition);
}

#group-type { border-left-color: var(--accent); background: rgba(59, 130, 246, 0.03); }
#group-status { border-left-color: var(--neon-purple); background: rgba(168, 85, 247, 0.03); }
#group-watched { border-left-color: #10b981; background: rgba(16, 185, 129, 0.03); }
#group-people { border-left-color: #f59e0b; background: rgba(245, 158, 11, 0.03); }
#group-genre { border-left-color: var(--neon-blue); background: rgba(34, 211, 238, 0.03); }
#group-search { border-left-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.01); }

.filter-group:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    transition: var(--transition);
}

.filter-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.filter-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Specific Filter Group Tints */

/* Status (Purple) */
#status-filter-pills .filter-pill {
    background: rgba(168, 85, 247, 0.05);
    border-color: rgba(168, 85, 247, 0.1);
}
#status-filter-pills .filter-pill.active {
    background: var(--neon-purple);
    border-color: var(--neon-purple);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

/* Watched (Green) */
#watched-filter-pills .filter-pill {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.1);
}
#watched-filter-pills .filter-pill.active {
    background: #10b981;
    border-color: #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

/* People (Amber) */
#people-filter-pills .filter-pill {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.1);
}
#people-filter-pills .filter-pill.active {
    background: #f59e0b;
    border-color: #f59e0b;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

/* Genre (Cyan) */
#genre-filter-pills .filter-pill {
    background: rgba(34, 211, 238, 0.05);
    border-color: rgba(34, 211, 238, 0.1);
}
#genre-filter-pills .filter-pill.active {
    background: var(--neon-blue);
    border-color: var(--neon-blue);
    color: #030306; /* Dark text for better contrast on bright cyan */
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.4);
}

/* --- Input Rows --- */
.input-row {
    display: flex;
    gap: 15px;
    align-items: center;
    width: 100%;
}

input[type="text"],
textarea,
select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: var(--input-padding);
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    transition: var(--transition);
    flex: 1;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

/* --- Genre Combobox (iOS-safe replacement for datalist) --- */
.genre-combobox {
    position: relative;
    display: flex;
    align-items: stretch;
    min-width: 0;
    flex: 1;
}

.genre-combobox input[type="text"] {
    width: 100%;
    padding-right: 36px;
    flex: 1;
    min-width: 0;
}

.genre-combobox-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    margin: 0;
    border: none !important;
    border-radius: 10px;
    background: transparent !important;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
    box-shadow: none !important;
    overflow: visible;
    text-transform: none;
    letter-spacing: normal;
    font-size: inherit;
}

.genre-combobox-toggle:hover,
.genre-combobox-toggle:focus-visible {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    border: none;
    box-shadow: none;
}

.genre-combobox-toggle:active {
    filter: none;
    background: rgba(255, 255, 255, 0.12);
}

.genre-combobox-toggle svg {
    width: 14px;
    height: 14px;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.genre-combobox.open .genre-combobox-toggle svg {
    transform: rotate(180deg);
}

.genre-combobox-list {
    position: fixed;
    z-index: 10050;
    margin: 0;
    padding: 6px;
    list-style: none;
    max-height: min(220px, 40vh);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: rgba(12, 12, 18, 0.98);
    border: 1px solid var(--border-bright);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.genre-combobox-list.hidden {
    display: none !important;
}

.genre-combobox-option {
    padding: 12px 14px;
    border-radius: 8px;
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.genre-combobox-option:hover,
.genre-combobox-option[aria-selected="true"] {
    background: rgba(59, 130, 246, 0.25);
    color: #fff;
}

.genre-combobox-empty {
    padding: 12px 14px;
    color: var(--text-dim);
    font-size: 13px;
    pointer-events: none;
}

/* --- Slider Styling --- */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid var(--border);
    padding: 2px;
    /* Add padding as requested */
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

input:checked+.slider {
    background-color: var(--accent);
    border-color: var(--accent);
}

input:focus+.slider {
    box-shadow: 0 0 10px var(--accent-glow);
}

input:checked+.slider:before {
    transform: translateX(21px);
}

/* Custom styled range slider (if any) */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 12px;
    /* Thicker track than thumb */
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid var(--border);
}

input[type="range"]::-webkit-slider-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -4px;
    /* Center thumb on track */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border: none;
}

input[type="range"]:focus::-webkit-slider-runnable-track {
    background: rgba(255, 255, 255, 0.15);
}

#input-section {
    overflow: hidden;
}

#input-section.collapsed {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.collapsible-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: var(--transition);
}

#input-section.collapsed .collapsible-content {
    max-height: 0;
    margin-top: 0;
    opacity: 0;
    pointer-events: none;
}

#input-section:not(.collapsed) .collapsible-content {
    max-height: 1000px;
    margin-top: 16px;
    opacity: 1;
}

.collapsible-content {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#input-section.collapsed #toggle-input-expand svg {
    transform: rotate(0deg);
}

#input-section:not(.collapsed) #toggle-input-expand svg {
    transform: rotate(180deg);
}

#toggle-batch {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--text-dim);
    text-decoration: none;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    transition: var(--transition);
}

#toggle-batch:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
}

#input-section.collapsed .input-header {
    margin-bottom: 0;
}

#mode-label {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

/* --- Media Cards (Antigravity) --- */
#tier-container {
    display: flex;
    flex-direction: column;
    gap: var(--tier-gap);
}

.tier {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tier-label {
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-break: break-word;
    transition: var(--transition);
    gap: 12px;
}

.tier-count {
    font-size: 0.75em;
    opacity: 0.8;
    font-weight: 400;
    white-space: nowrap;
}

.mode-reorder-tiers .tier-label {
    cursor: grab;
}

.mode-reorder-tiers .tier-label:active {
    cursor: grabbing;
}

.tier-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--card-gap);
    min-height: 80px;
    flex: 1;
    padding: 10px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border);
}

/* --- Media Cards (Antigravity) --- */
.media-card {
    width: 170px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.04) 100%);


    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
    will-change: transform;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.media-card:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.07) 100%);
    border-color: var(--border-bright);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 25px var(--accent-glow);
}

.media-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

#edit-thumb-container {
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
}

#edit-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.media-card:hover img {
    transform: scale(1.1);
}

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);

    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

.rewatch-badge {
    left: auto;
    right: 10px;
    background: var(--neon-purple);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

.first-watch-badge {
    left: auto;
    right: 10px;
    background: var(--accent);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.new-episodes-badge {
    left: auto;
    right: 10px;
    background: #f59e0b;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.imdb-badge {
    top: auto;
    bottom: 85px;
    left: 10px;
    background: #f5c518;
    color: #000;
    box-shadow: 0 0 15px rgba(245, 197, 24, 0.5);
}

.rt-badge {
    top: auto;
    bottom: 85px;
    left: auto;
    right: 10px;
    background: #fa320a;
    color: #fff;
    box-shadow: 0 0 15px rgba(250, 50, 10, 0.5);
}

.card-info {
    padding: 10px;
}

.card-title {
    margin: 0 0 4px 0;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 25px var(--accent-glow);
}

.media-card.selected::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--accent);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    z-index: 10;
}

/* Card Quick Actions */
.card-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
    pointer-events: none;
}

.media-card:hover .card-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--glass-heavy);

    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    transition: var(--transition);
    padding: 0;
}

.action-btn:hover {
    background: var(--accent);
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Empty States */
.empty-state {
    width: 100%;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
    font-style: italic;
    background: rgba(255, 255, 255, 0.01);
    border-radius: var(--radius);
    border: 1px dashed rgba(255, 255, 255, 0.05);
}

/* --- People Pills --- */
.person-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.person-pill:hover {
    background: rgba(255, 255, 255, 0.1);
}

.person-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}

/* --- Batch Bar --- */
.batch-bar {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 15, 0.4);


    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    padding: 14px 40px;
    display: flex;
    align-items: center;
    gap: 40px;
    z-index: 1000;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 20px rgba(59, 130, 246, 0.2);
    animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.batch-btns {
    display: flex;
    gap: 15px;
}

/* --- Modals --- */
.modal-overlay,
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);


    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.4s ease-out;
}

.modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);


    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    position: relative;
    max-width: 90%;
    width: 500px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-content::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), transparent 40%, transparent 60%, rgba(255, 255, 255, 0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.confirm-card {
    text-align: center;
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 60px rgba(239, 68, 68, 0.15);
}

.confirm-icon {
    width: 70px;
    height: 70px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 900;
    margin: 0 auto 25px auto;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

.confirm-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.confirm-card p {
    margin: 0 0 30px 0;
    font-size: 14px;
    opacity: 0.7;
    line-height: 1.5;
}

.confirm-btns {
    display: flex;
    gap: 12px;
}

.confirm-btns button {
    flex: 1;
}

#confirm-yes-btn {
    background: #ef4444;
}

#confirm-yes-btn:hover {
    background: #dc2626;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.4);
}

#confirm-no-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
}

#confirm-no-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.duplicate-card {
    max-width: 380px;
    text-align: center;
    padding: 40px 30px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 50px rgba(59, 130, 246, 0.1);
}

.duplicate-icon {
    width: 60px;
    height: 60px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.duplicate-btns {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.duplicate-btns button {
    flex: 1;
}

#duplicate-anyway-btn {
    background: var(--accent);
}

#duplicate-anyway-btn:hover {
    box-shadow: 0 0 25px var(--accent-glow);
}

#duplicate-skip-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
}

#duplicate-skip-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    width: 95%;
    max-width: 700px;
    max-height: 95vh;
    overflow-y: auto;
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(25, 25, 30, 0.95);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.modal-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-title-group h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.modal-date {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.youtube-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.2);
    border-radius: 10px;
    color: #ff4d4d;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}

.youtube-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.4);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.2);
}

.youtube-btn svg {
    color: #ff0000;
}

.modal-content::-webkit-scrollbar {
    width: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

#close-edit-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    padding: 0;
    transition: var(--transition);
    z-index: 10;
}

#close-edit-modal:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

#close-manager-btn,
#close-people-btn,
.close-modal-btn {
    background: transparent;
    color: var(--text-dim);
    font-size: 12px;
}

#close-manager-btn:hover,
#close-people-btn:hover,
.close-modal-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

#toggle-batch {
    color: white;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 8px 16px;
    border-radius: 40px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);

    transition: var(--transition);
    display: inline-block;
}

#toggle-batch:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-heavy);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

/* --- Utilities --- */
.hidden {
    display: none !important;
}

/* --- Sliders & File Inputs --- */
/* --- Sliders & File Inputs --- */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    margin: 15px 0;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 14px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    border: 1px solid var(--border);
}

input[type="range"]::-webkit-slider-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
}

input[type="range"]:hover::-webkit-slider-thumb {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

input[type="file"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 16px;
    color: var(--text-dim);
    cursor: pointer;
    width: 100%;
}

input[type="file"]::-webkit-file-upload-button {
    background: linear-gradient(135deg, var(--accent) 0%, var(--neon-purple) 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 40px;
    margin-right: 15px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

@media (max-width: 768px) {
    :root {
        --app-margin: 20px;
        --header-padding: 15px;
        --card-padding: 20px;
        --filter-bar-padding: 12px 16px;
        --filter-group-padding: 10px 0;
        --input-padding: 14px 18px;
        --card-gap: 10px;
        --tier-gap: 15px;
    }

    .app-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        margin-bottom: 2px;
    }

    .app-header h1 {
        font-size: 2.2rem;
    }

    .mode-container {
        margin-bottom: 5px;
        width: 100%;
        padding: 0 10px;
    }

    .mode-toggle {
        flex-wrap: wrap;
        justify-content: center;
        border-radius: 20px;
        padding: 8px;
    }

    .mode-btn {
        padding: 8px 16px;
        font-size: 12px;
        flex: 1 1 auto;
        min-width: 100px;
        text-align: center;
    }

    #input-section {
        margin-bottom: 2px;
    }

    #user-info {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        gap: 8px;
    }

    #user-name {
        width: 100%;
        margin-right: 0;
        margin-bottom: 5px;
        font-size: 13px;
    }

    /* Keep header buttons smaller but horizontal */
    #edit-tiers-btn,
    #quick-sort-btn,
    #logout-btn,
    #open-settings-btn {
        padding: 8px 12px;
        font-size: 12px;
        flex: 1 1 auto;
    }

    .media-card {
        width: calc(50% - 8px);
        flex-shrink: 0;
    }

    .batch-bar {
        width: 95%;
        max-width: 400px;
        flex-direction: column;
        border-radius: 24px;
        padding: 12px;
        gap: 8px;
        bottom: 16px;
    }

    .batch-btns {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }

    .batch-btns button {
        padding: 6px 12px;
        font-size: 11px;
        border-radius: 12px;
        flex: 1 1 auto;
        min-width: 60px;
    }

    /* Main input section stacks on mobile */
    #input-section .input-row {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    /* Filter bar adjustments */
    .filter-bar {
        padding: 12px 16px;
        gap: 0;
    }

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        padding: var(--filter-group-padding);
        padding-left: 15px;
        padding-right: 15px;
        gap: 8px;
    }
    /* Filter Bar Collapsible Mobile */
    .filter-header-mobile {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 5px 0;
        min-height: 35px;
    }

    .filter-bar.collapsed .filter-groups-container {
        display: none;
    }

    .filter-bar:not(.collapsed) .filter-groups-container {
        display: block;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .desktop-only {
        display: none !important;
    }

    #toggle-filters-btn {
        padding: 8px 16px !important;
        font-size: 12px !important;
        border-radius: 20px !important;
        background: rgba(255, 255, 255, 0.1) !important;
        color: white !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
    }

    .filter-stats {
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: none !important;
        font-size: 12px !important;
    }

    .modal-content {
        padding: 24px;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-content .input-row {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    /* Extra Slim Mobile Mode (Phones < 480px) */
    @media (max-width: 480px) {
        :root {
            --app-margin: 4px;
            --header-padding: 5px;
            --card-padding: 12px;
            --filter-bar-padding: 8px 12px;
            --filter-group-padding: 8px 0;
            --input-padding: 12px 16px;
            --card-gap: 2px;
            --tier-gap: 12px;
        }

        .filter-group {
            gap: 6px;
        }

        .filter-group span {
            font-size: 10px;
            opacity: 0.6;
        }

        .filter-pill {
            padding: 6px 12px;
            font-size: 11px;
            border-radius: 10px;
        }

        #search-input {
            padding: 10px 14px !important;
            font-size: 13px;
            border-radius: 10px;
        }

        .circle-btn,
        .expand-btn {
            width: 24px;
            height: 24px;
            padding: 2px;
        }

        .circle-btn svg,
        .expand-btn svg {
            width: 12px;
            height: 12px;
        }

        .app-header {
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
            text-align: left;
            margin-bottom: 5px;
        }

        .app-header h1 {
            font-size: 1.5rem;
            margin: 0;
        }

        #edit-tiers-btn,
        #quick-sort-btn {
            display: none !important;
        }

        #auth-section, #user-info {
            width: auto;
            margin: 0;
        }
    }

    @media (max-width: 400px) {
        :root {
            --app-margin: 8px;
            --header-padding: 8px;
            --card-padding: 10px;
            --filter-bar-padding: 6px 10px;
            --filter-group-padding: 4px 0;
            --input-padding: 8px 10px;
            --card-gap: 6px;
            --tier-gap: 10px;
        }

        .app-header {
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
        }

        .app-header h1 {
            font-size: 1.4rem;
            margin: 0;
        }

        #edit-tiers-btn,
        #quick-sort-btn {
            display: none !important;
        }

        #open-settings-btn {
            padding: 6px 12px;
            font-size: 11px;
            min-width: 0;
        }

        .mode-btn {
            min-width: 70px;
            padding: 6px 8px;
            font-size: 10px;
        }

        .media-card {
            width: 100%;
            /* Stack cards on very slim screens */
        }

        .modal-content {
            padding: 15px !important;
            width: 98% !important;
        }

        .input-row input,
        .input-row select {
            padding: 10px !important;
            font-size: 12px !important;
        }

        .filter-pill {
            padding: 4px 10px;
            font-size: 10px;
        }

        .filter-bar {
            padding: 5px 10px;
            gap: 0;
        }
    }
}

input:checked+.slider:before {
    transform: translateX(14px);
}

/* Edit Rows Utility */
.tier-edit-row,
.people-edit-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.tier-edit-row input[type="text"],
.people-edit-row input[type="text"] {
    flex: 1;
}

.tier-edit-row input[type="color"] {
    width: 40px;
    height: 40px;
    padding: 2px;
    cursor: pointer;
    background: none;
}

@media (min-width: 769px) {
    .tier {
        flex-direction: row;
        gap: 20px;
        align-items: stretch;
        /* Make labels same height as lists */
    }

    .tier-label {
        width: 160px;
        /* Uniform width for all labels */
        min-height: 100px;
        font-size: 1.2rem;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 15px 10px;
        line-height: 1.2;
        text-align: center;
    }

    .tier-label .tier-count {
        display: block;
        /* Move count to its own line below title */
        margin-top: 8px;
        margin-left: 0 !important;
    }
}

/* iOS Standalone Mode Optimization */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
    }

    .app-container {
        padding-top: 5px;
        /* Small extra buffer below status bar */
    }


}

/* --- LOGIN OVERLAY (Synced with To-Do List) --- */
#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg);
    background-image:
        radial-gradient(circle at 30% 30%, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    box-sizing: border-box;
}

#login-overlay h1 {
    font-size: 4.5rem;
    margin: 0;
    text-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.4) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    letter-spacing: -3px;
}

#google-login-btn {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, background 0.3s ease;
    animation: fancyGlowPulse 3s infinite alternate;
}

#google-login-btn:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.5);
}

@keyframes fancyGlowPulse {
    from {
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.25);
    }

    to {
        box-shadow: 0 0 35px rgba(59, 130, 246, 0.5);
    }
}

/* --- PREMIUM LOADER (Synced with To-Do List) --- */
:root {
    --loader-duration: 2s;
    --loader-path-length: 157px;
}



.premium-loader {
    overflow: visible;
    width: 100px;
    height: 150px;
}

.premium-loader g {
    animation: loader-slide var(--loader-duration) linear infinite reverse;
}

.premium-loader g:nth-child(2) {
    animation-delay: calc(var(--loader-duration) / 4);
}

.premium-loader g:nth-child(2) path {
    animation-delay: calc(var(--loader-duration) / 4);
    stroke-dasharray: 0px calc(var(--loader-path-length) + 1px);
    stroke-dashoffset: 1px;
}

.premium-loader path {
    stroke: url(#loader-gradient);
    stroke-width: 20px;
    stroke-linecap: round;
    fill: none;
    stroke-dasharray: 0 var(--loader-path-length);
    stroke-dashoffset: 0;
    animation: loader-escalade var(--loader-duration) cubic-bezier(0.8, 0, 0.2, 1) infinite reverse;
}

.login-loader {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    opacity: 0.8;
}

.login-loader .premium-loader {
    width: 60px;
    height: 90px;
}

@keyframes loader-slide {
    0% {
        transform: translateY(-50px);
    }

    100% {
        transform: translateY(50px);
    }
}

@keyframes loader-escalade {
    0% {
        stroke-dasharray: 0 var(--loader-path-length);
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: var(--loader-path-length) var(--loader-path-length);
        stroke-dashoffset: 0;
    }

    100% {
        stroke-dasharray: var(--loader-path-length) var(--loader-path-length);
        stroke-dashoffset: calc(-1 * (var(--loader-path-length) - 1px));
    }
}

/* --- Modal Buttons --- */
.primary-btn {
    background: var(--accent);
    color: white !important;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px var(--accent-glow);
    font-family: 'Outfit', sans-serif;
}

.primary-btn:hover {
    box-shadow: 0 6px 20px var(--accent-glow);
    filter: brightness(1.1);
}

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

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Outfit', sans-serif;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.card-genre {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.03);
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- Progress Bar --- */
.progress-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--neon-purple) 100%);
    box-shadow: 0 0 15px var(--accent-glow);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar.indeterminate {
    width: 40% !important;
    position: absolute;
    animation: indeterminate 1.5s infinite linear;
}

@keyframes indeterminate {
    0% {
        left: -40%;
    }

    100% {
        left: 100%;
    }
}

.progress-status {
    font-size: 11px;
    color: var(--text-dim);
    text-align: center;
    margin-top: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Filter Stats --- */
.filter-stats {
    margin-top: 5px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}



.filter-stats::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-glow);
}

.watched-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
    color: white;
}

.action-btn.mark-watched-btn:hover {
    background: #10b981;
    color: white;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

.action-btn.edit-card-btn:hover {
    background: #f59e0b;
    color: white;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}

.watched-at-tag {
    position: absolute;
    top: 64px;
    right: 8px;
    background: rgba(16, 185, 129, 0.9);

    color: white;
    font-size: 8px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 5;
}

/* --- Debug Console --- */
#debug-console {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    max-height: 400px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    padding: 10px;
    transition: var(--transition);
    background: var(--glass-heavy);
}

#debug-console.collapsed {
    max-height: 45px;
    overflow: hidden;
}

#debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    border-bottom: 1px solid transparent;
    padding-bottom: 5px;
    margin-bottom: 5px;
}

#debug-console:not(.collapsed) #debug-header {
    border-bottom: 1px solid var(--border);
}

#debug-toggle-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    padding: 0;
    box-shadow: none;
    transition: transform 0.3s ease;
}

#debug-console.collapsed #debug-toggle-btn {
    transform: rotate(180deg);
}

#debug-log {
    flex: 1;
    overflow-y: auto;
    font-family: monospace;
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-right: 5px;
}

.debug-entry {
    background: rgba(0, 0, 0, 0.4);
    padding: 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
    word-wrap: break-word;
}

.debug-entry.error {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.1);
}

/* --- Settings UI --- */
.settings-btn {
    background: var(--glass);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 18px;
    border-radius: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.settings-btn:hover {
    background: var(--glass-heavy);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.settings-modal-content {
    max-width: 340px !important;
    padding: 24px !important;
    gap: 24px !important;
}

.settings-group {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 18px;
    margin: 4px 0;
}

.switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.switch-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: 0.3px;
}

.settings-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-actions .action-btn {
    width: 100%;
    padding: 18px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

#close-settings-modal {
    color: #ef4444;
    font-size: 20px;
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    padding: 0;
}

#close-settings-modal:hover {
    color: #f43f5e;
    background: rgba(244, 63, 94, 0.1);
    transform: rotate(90deg);
}

.backfill-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%) !important;
    border-color: rgba(139, 92, 246, 0.3) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.quick-sort-btn-alt {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.tiers-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.backfill-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.fix-btn {
    background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%) !important;
    border-color: rgba(244, 63, 94, 0.3) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.2);
}

.fix-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.4);
}

.logout-btn {
    margin-top: 6px;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-dim) !important;
}

.logout-btn:hover {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    color: white !important;
    transform: scale(1.02);
}