/* ==========================================================================
   Vitrine — Design System
   A quiet, editorial gallery client. Warm charcoal surfaces, a single brass
   accent, Fraunces for display type, Inter for everything functional.
   ========================================================================== */

:root {
    color-scheme: dark;

    /* Warm neutral scale — "charcoal ink" */
    --bg-primary: #16140f;
    --bg-secondary: #1d1a14;
    --bg-tertiary: #262218;
    --bg-elevated: #2b2619;
    --border-color: #34301f;
    --border-soft: rgba(244, 239, 227, 0.06);
    --text-primary: #f4efe3;
    --text-secondary: #b7ad97;
    --text-muted: #7d7460;

    /* Single accent — "brass" */
    --accent: #d9a857;
    --accent-strong: #ecc578;
    --accent-soft: rgba(217, 168, 87, 0.14);
    --accent-ink: #1c160b;

    /* Semantic — muted, not SaaS-bright */
    --danger: #c1584c;
    --danger-soft: rgba(193, 88, 76, 0.14);
    --success: #7e9c6c;
    --success-soft: rgba(126, 156, 108, 0.14);

    --shadow-sm: 0 2px 10px rgba(8, 6, 2, 0.28);
    --shadow-md: 0 12px 28px rgba(8, 6, 2, 0.4);
    --shadow-lg: 0 24px 48px rgba(8, 6, 2, 0.5);
    --shadow-accent: 0 8px 24px rgba(217, 168, 87, 0.22);

    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 26px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    --nav-width: 80px;
    --nav-width-expanded: 256px;
    --ui-scale: 1;

    --scrollbar-thumb: rgba(244, 239, 227, 0.12);
    --scrollbar-thumb-hover: rgba(244, 239, 227, 0.24);
}

body.light-theme,
body.theme-light {
    color-scheme: light;
    --bg-primary: #f2f3f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e3e5e8;
    --bg-elevated: #ffffff;
    --border-color: #d0d2d6;
    --border-soft: rgba(0, 0, 0, 0.06);
    --text-primary: #060607;
    --text-secondary: #2e3035;
    --text-muted: #4e5058;
    
    /* Discord light theme style accent */
    --accent: #5865f2;
    --accent-strong: #4752c4;
    --accent-soft: rgba(88, 101, 242, 0.12);
    --accent-ink: #ffffff;
    
    --danger: #da373c;
    --danger-soft: rgba(218, 55, 60, 0.12);
    --success: #248046;
    --success-soft: rgba(36, 128, 70, 0.12);
    
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.12);
    --shadow-accent: 0 8px 24px rgba(88, 101, 242, 0.16);
    
    --scrollbar-thumb: rgba(0, 0, 0, 0.15);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.28);
}

body.theme-discord-dark {
    color-scheme: dark;
    --bg-primary: #313338;
    --bg-secondary: #2b2d31;
    --bg-tertiary: #1e1f22;
    --bg-elevated: #35373c;
    --border-color: #3f4147;
    --border-soft: rgba(242, 243, 245, 0.05);
    --text-primary: #f2f3f5;
    --text-secondary: #b5bac1;
    --text-muted: #949ba4;
    
    /* Discord dark theme style accent */
    --accent: #5865f2;
    --accent-strong: #4752c4;
    --accent-soft: rgba(88, 101, 242, 0.15);
    --accent-ink: #ffffff;
    
    --danger: #f23f43;
    --danger-soft: rgba(242, 63, 67, 0.15);
    --success: #23a55a;
    --success-soft: rgba(35, 165, 90, 0.15);
    
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.4);
    --shadow-accent: 0 8px 24px rgba(88, 101, 242, 0.2);
    
    --scrollbar-thumb: #1e1f22;
    --scrollbar-thumb-hover: #111214;
}

body.theme-midnight {
    color-scheme: dark;
    --bg-primary: #050505;
    --bg-secondary: #0c0c0e;
    --bg-tertiary: #18181b;
    --bg-elevated: #27272a;
    --border-color: #27272a;
    --border-soft: rgba(255, 255, 255, 0.04);
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    /* Vibrant Purple Accent */
    --accent: #8b5cf6;
    --accent-strong: #a78bfa;
    --accent-soft: rgba(139, 92, 246, 0.15);
    --accent-ink: #ffffff;
    
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.15);
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.15);
    
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.6);
    --shadow-accent: 0 8px 24px rgba(139, 92, 246, 0.25);
    
    --scrollbar-thumb: rgba(255, 255, 255, 0.1);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.2);
}

body.theme-nord {
    color-scheme: dark;
    --bg-primary: #2e3440;
    --bg-secondary: #3b4252;
    --bg-tertiary: #242933;
    --bg-elevated: #434c5e;
    --border-color: #4c566a;
    --border-soft: rgba(216, 222, 233, 0.06);
    --text-primary: #eceff4;
    --text-secondary: #d8dee9;
    --text-muted: #4c566a;
    
    /* Frost Blue Accent */
    --accent: #88c0d0;
    --accent-strong: #8fbcbb;
    --accent-soft: rgba(136, 192, 208, 0.18);
    --accent-ink: #2e3440;
    
    --danger: #bf616a;
    --danger-soft: rgba(191, 97, 106, 0.15);
    --success: #a3be8c;
    --success-soft: rgba(163, 190, 140, 0.15);
    
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.25);
    --shadow-accent: 0 8px 24px rgba(136, 192, 208, 0.2);
    
    --scrollbar-thumb: #242933;
    --scrollbar-thumb-hover: #1b1f27;
}

body.theme-forest {
    color-scheme: dark;
    --bg-primary: #0f1411;
    --bg-secondary: #171f1b;
    --bg-tertiary: #0b0f0d;
    --bg-elevated: #202b25;
    --border-color: #27342d;
    --border-soft: rgba(227, 237, 232, 0.05);
    --text-primary: #e3ede8;
    --text-secondary: #a3b899;
    --text-muted: #6c7c64;
    
    /* Emerald Green Accent */
    --accent: #10b981;
    --accent-strong: #34d399;
    --accent-soft: rgba(16, 185, 129, 0.15);
    --accent-ink: #0a0f0d;
    
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.15);
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.15);
    
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.45);
    --shadow-accent: 0 8px 24px rgba(16, 185, 129, 0.2);
    
    --scrollbar-thumb: #0b0f0d;
    --scrollbar-thumb-hover: #050706;
}

/* ---- Reset ---- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.35s ease, color 0.35s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

button, input, select {
    font-family: inherit;
}

/* Visible keyboard focus everywhere interactive */
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ---- App shell ---- */
#app-container {
    display: flex;
    flex-direction: column;
    width: calc(100vw / var(--ui-scale));
    height: calc(100vh / var(--ui-scale));
    transform: scale(var(--ui-scale));
    transform-origin: top left;
    overflow: hidden;
    animation: appFadeIn 0.5s var(--ease-out);
}

#main-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: var(--bg-primary);
}

/* ---- Tab panels ---- */
.tab-panel {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    inset: 0;
}

.tab-panel.active {
    display: flex;
    animation: panelRise 0.4s var(--ease-out);
}

.scrollable-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

/* ---- Scrollbars ---- */
::-webkit-scrollbar,
.feed-container::-webkit-scrollbar,
#sidebar-nav::-webkit-scrollbar,
.settings-sidebar::-webkit-scrollbar,
.settings-content-area::-webkit-scrollbar,
.scrollable-content::-webkit-scrollbar,
.sidebar-tags-container::-webkit-scrollbar {
    width: 14px !important;
    height: 14px !important;
}

::-webkit-scrollbar-track {
    background: transparent !important;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb) !important;
    border: 4px solid transparent !important;
    background-clip: padding-box !important;
    border-radius: 9999px !important;
    transition: background 0.2s ease;
}

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

/* ---- Title bar (Hidden for Web Deploy) ---- */
#title-bar {
    display: none !important;
}

/* ---- App body ---- */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ---- Sidebar nav ---- */
#sidebar-nav {
    width: var(--nav-width);
    min-width: var(--nav-width);
    max-width: var(--nav-width-expanded);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    z-index: 100;
    transition: width 0.35s var(--ease-out), min-width 0.35s var(--ease-out);
    padding: 14px 0;
}

#sidebar-nav.expanded {
    width: var(--nav-width-expanded);
    min-width: var(--nav-width-expanded);
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    margin: 0 auto 18px;
    flex-shrink: 0;
    transition: margin 0.35s var(--ease-out), background-color 0.2s ease, color 0.2s ease;
}

.sidebar-toggle:hover {
    color: var(--accent);
    background-color: var(--accent-soft);
}

#sidebar-nav.expanded .sidebar-toggle {
    margin-left: 18px;
    margin-right: auto;
}

.sidebar-nav-top,
.sidebar-nav-bottom {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 12px;
}

.sidebar-nav-top { flex: 1; }
.sidebar-nav-bottom { margin-top: auto; padding-bottom: 6px; }

.nav-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 18px;
    cursor: pointer;
    width: 100%;
    height: 50px;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    padding: 0 17px;
    overflow: hidden;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-tab svg {
    width: 22px !important;
    height: 22px !important;
    stroke: currentColor;
    stroke-width: 1.7;
    fill: none;
    flex-shrink: 0;
    transition: stroke 0.2s ease, filter 0.2s ease;
}

.nav-label {
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0s 0.15s;
}

#sidebar-nav.expanded .nav-label {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease 0.12s, visibility 0s 0s;
}

.nav-tab:hover {
    color: var(--text-primary);
    background-color: rgba(244, 239, 227, 0.05);
}

.nav-tab.active {
    color: var(--accent);
    background-color: var(--accent-soft);
    font-weight: 600;
    animation: tabPop 0.3s var(--ease-spring);
}

.nav-tab.active svg {
    stroke: var(--accent);
    filter: drop-shadow(0 0 8px rgba(217, 168, 87, 0.45));
}

/* ---- Headers ---- */
.app-header {
    height: 76px;
    padding: 0 32px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    z-index: 10;
    flex-shrink: 0;
}

.header-logo {
    font-family: 'Outfit', sans-serif;
    font-style: normal;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.logo-accent { color: var(--accent); }

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

.source-badge {
    font-family: 'Inter', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 7px 14px;
    border-radius: 999px;
}

.source-badge .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    margin-right: 7px;
    box-shadow: 0 0 0 3px var(--success-soft);
}

.tab-header {
    padding: 36px 32px 28px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.tab-header h1 {
    font-size: 30px;
    color: var(--text-primary);
}

.tab-header p {
    color: var(--text-secondary);
    font-size: 14.5px;
    margin-top: 6px;
}

/* ---- Dropdown ---- */
.custom-dropdown {
    position: relative;
    min-width: 150px;
    user-select: none;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    cursor: pointer;
    transition: border-color 0.2s ease;
    white-space: nowrap;
}

.dropdown-toggle:hover { border-color: var(--accent); }

.dropdown-toggle svg { flex-shrink: 0; transition: transform 0.25s var(--ease-out); }

.custom-dropdown.open .dropdown-toggle svg { transform: rotate(180deg); }

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    min-width: 170px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 300;
    overflow: hidden;
    padding: 6px;
    list-style: none;
}

.custom-dropdown.open .dropdown-menu {
    display: block;
    animation: dropdownIn 0.18s var(--ease-out);
}

.dropdown-item {
    padding: 9px 12px;
    font-size: 13.5px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.dropdown-item:hover { background-color: var(--accent-soft); color: var(--text-primary); }

.dropdown-item.active {
    color: var(--accent);
    font-weight: 600;
    background-color: var(--accent-soft);
}

/* ---- Inputs ---- */
.custom-input {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    width: 100%;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-input::placeholder { color: var(--text-muted); }

.custom-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---- Buttons ---- */
.primary-btn {
    background: var(--accent);
    color: var(--accent-ink);
    border: none;
    padding: 13px 26px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.15s var(--ease-out), box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn:hover {
    background: var(--accent-strong);
    box-shadow: var(--shadow-accent);
    transform: translateY(-1px);
}

.primary-btn:active { transform: scale(0.97); }

.primary-btn-small {
    background: var(--accent);
    color: var(--accent-ink);
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.15s ease;
}

.primary-btn-small:hover { background: var(--accent-strong); }
.primary-btn-small:active { transform: scale(0.96); }

.danger-btn {
    background: var(--danger);
    color: #fff;
    border: none;
    width: 120px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(193, 88, 76, 0.25);
    transition: transform 0.18s var(--ease-out), box-shadow 0.2s ease, background 0.2s ease;
}

.danger-btn:hover {
    background: #d4685b;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(193, 88, 76, 0.4);
}

.danger-btn:active {
    transform: scale(0.97) translateY(-1px);
}

.gradient-btn,
.search-btn {
    background: var(--accent);
    color: var(--accent-ink);
    border: none;
    width: 120px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: var(--shadow-accent);
    transition: transform 0.18s var(--ease-out), box-shadow 0.2s ease, background 0.2s ease;
}

.gradient-btn:hover,
.search-btn:hover {
    background: var(--accent-strong);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(217, 168, 87, 0.32);
}

.text-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.15s ease;
}

.text-btn:hover { opacity: 0.78; text-decoration: underline; }

.icon-btn-small {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn-small:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

/* ---- Search summary bar ---- */
.search-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 32px;
    background: var(--accent-soft);
    border-bottom: 1px solid var(--border-soft);
    font-size: 13.5px;
    color: var(--text-primary);
    flex-shrink: 0;
}

/* ---- Home feed / masonry ---- */
.feed-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.masonry-grid {
    display: flex;
    gap: 28px;
    width: 100%;
    align-items: flex-start;
}

.masonry-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.masonry-item {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease, border-color 0.3s ease;
    animation: itemRise 0.5s var(--ease-out) backwards;
}

.masonry-col:nth-child(1) .masonry-item:nth-child(1) { animation-delay: 0.02s; }
.masonry-col:nth-child(1) .masonry-item:nth-child(2) { animation-delay: 0.1s; }
.masonry-col:nth-child(1) .masonry-item:nth-child(3) { animation-delay: 0.18s; }
.masonry-col:nth-child(2) .masonry-item:nth-child(1) { animation-delay: 0.06s; }
.masonry-col:nth-child(2) .masonry-item:nth-child(2) { animation-delay: 0.14s; }
.masonry-col:nth-child(2) .masonry-item:nth-child(3) { animation-delay: 0.22s; }
.masonry-col:nth-child(3) .masonry-item:nth-child(1) { animation-delay: 0.1s; }
.masonry-col:nth-child(3) .masonry-item:nth-child(2) { animation-delay: 0.18s; }
.masonry-col:nth-child(3) .masonry-item:nth-child(3) { animation-delay: 0.26s; }

.masonry-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(217, 168, 87, 0.35);
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Signature: vitrine corner brackets, on hover only */
.masonry-item::before,
.masonry-item::after,
.masonry-item .corner-tr,
.masonry-item .corner-bl {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    border-color: var(--accent);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    z-index: 2;
}

.masonry-item::before { top: 10px; left: 10px; border-top: 2px solid; border-left: 2px solid; border-radius: 6px 0 0 0; }
.masonry-item::after { bottom: 10px; right: 10px; border-bottom: 2px solid; border-right: 2px solid; border-radius: 0 0 6px 0; }

.masonry-item:hover::before,
.masonry-item:hover::after {
    opacity: 0.85;
}

.item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 16px;
    background: linear-gradient(to top, rgba(22, 20, 15, 0.92), transparent);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.masonry-item:hover .item-overlay {
    opacity: 1;
    transform: translateY(0);
}

.item-tags {
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.9;
}

.item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.badge {
    font-size: 9.5px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 5px;
    background-color: var(--accent);
    color: var(--accent-ink);
}

.badge.rating-safe { background-color: var(--success); color: #15200f; }

/* ---- Loading / empty states ---- */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px;
    gap: 14px;
    color: var(--text-secondary);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
    color: var(--text-secondary);
    gap: 18px;
}

.empty-state svg { opacity: 0.4; }

/* ---- Reels ---- */
.reels-scroll-container {
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    background-color: #000;
    -webkit-overflow-scrolling: touch;
}

.reels-scroll-container::-webkit-scrollbar { display: none; }

.reel-item {
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    overflow: hidden;
}

.reel-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 480px;
    max-height: 100%;
    aspect-ratio: 9/16;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.reel-video-inner {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.reel-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reel-play-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.reel-play-indicator.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.reel-volume-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.45);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.reel-volume-btn:hover {
    background: rgba(0, 0, 0, 0.65);
    transform: scale(1.05);
}

.reel-volume-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.reel-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    z-index: 30;
    cursor: pointer;
    transition: height 0.15s ease;
}

.reel-progress-container:hover {
    height: 6px;
}

.reel-progress-bar {
    height: 100%;
    width: 0;
    background: var(--accent);
    transition: width 0.1s linear;
}

.reel-overlay-bottom {
    position: absolute;
    bottom: 12px;
    left: 16px;
    right: 80px;
    z-index: 25;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
}

.reel-overlay-bottom .reel-author {
    font-weight: 700;
    font-size: 15px;
}

.reel-overlay-bottom .reel-tags {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.4;
    word-break: break-word;
}

.reel-overlay-right {
    position: absolute;
    bottom: 30px;
    right: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 25;
}

.reel-action-btn {
    background: rgba(0, 0, 0, 0.45);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, background-color 0.2s;
}

.reel-action-btn:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.65);
}

.reel-action-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.reel-action-label {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    margin-top: -10px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.reel-thumbnail {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: blur(10px);
    opacity: 0.7;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.reel-thumbnail.hidden { opacity: 0; }

.overlay-loading {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 50;
}

/* ---- Notifications ---- */
.notifications-manager {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 26px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
}

.notifications-manager h3 { margin-bottom: 16px; font-size: 17px; }

.tag-input-row { display: flex; gap: 10px; margin-bottom: 16px; }

.tag-badges-container { display: flex; flex-wrap: wrap; gap: 10px; }

.tag-badge {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.tag-badge:hover { border-color: var(--accent); }

.tag-badge-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    transition: color 0.15s ease;
}

.tag-badge-remove:hover { color: var(--danger); }

.notifications-list-section { display: flex; flex-direction: column; gap: 18px; }

.list-header { display: flex; justify-content: space-between; align-items: center; }
.list-header h3 { font-size: 17px; }

.notifications-list { display: flex; flex-direction: column; gap: 14px; }

.notification-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    gap: 18px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s var(--ease-out), border-color 0.2s ease;
}

.notification-card:hover { transform: translateX(3px); border-color: var(--border-soft); }

.notif-icon {
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background-color: var(--bg-tertiary);
    border-radius: 50%;
    flex-shrink: 0;
}

.notif-details { flex: 1; }
.notif-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 15px; color: var(--text-primary); }
.notif-desc { color: var(--text-secondary); font-size: 13.5px; margin-top: 5px; line-height: 1.5; }
.notif-time { color: var(--text-muted); font-size: 11.5px; margin-top: 10px; }

.notification-card.system-alert { border-left: 3px solid var(--accent); }
.notification-card.update-alert { border-left: 3px solid var(--success); cursor: pointer; }

/* ---- Search / Explore ---- */
.search-box-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
}

.search-input-row {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 10px;
    flex: 1;
    min-width: 0;
    height: 42px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.search-input-wrapper:focus-within { border-color: var(--accent); }

.search-icon { color: var(--text-muted); margin-left: 6px; flex-shrink: 0; }
.search-input { border: none; background: none; box-shadow: none !important; outline: none; padding-left: 8px; height: 100%; width: 100%; flex: 1; min-width: 0; }

.search-builder-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 28px;
}

.search-builder-section h3 { margin-bottom: 16px; font-size: 16.5px; }

.popular-queries { display: flex; flex-wrap: wrap; gap: 10px; }

.query-badge {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 9px 18px;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.query-badge:hover {
    border-color: var(--accent);
    background-color: var(--accent-soft);
    color: var(--accent);
    transform: translateY(-1px);
}

/* ---- Settings ---- */
.settings-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px 32px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
}

.settings-card h2 { font-size: 17px; margin-bottom: 14px; }

.settings-card-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-bottom: 18px;
    margin-top: -10px;
    line-height: 1.5;
}

.settings-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.settings-section-header h2 { margin-bottom: 0; }

.section-icon { flex-shrink: 0; }
.text-accent, .text-pink { color: var(--accent) !important; stroke: var(--accent) !important; }

.pane-title {
    font-size: 22px;
    margin-bottom: 24px;
}

.settings-group { display: flex; flex-direction: column; }

.indented-list {
    border-left: 2px solid var(--border-soft);
    margin-left: 8px;
    padding-left: 26px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.setting-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 24px;
    flex-wrap: nowrap !important;
    padding: 9px 0;
}

.setting-item-label {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--text-secondary);
    white-space: normal;
    word-break: break-word;
    flex: 1;
    min-width: 0;
    line-height: 1.5;
}

.setting-item-label.font-light { font-weight: 400; }

.form-divider {
    border: none;
    border-top: 1px solid var(--border-soft);
    margin: 8px 0;
}

/* Switch — recolored to accent, renamed conceptually but class kept for compatibility */
.switch-pink, .switch-accent {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
    flex-shrink: 0;
}

.switch-pink input, .switch-accent input { opacity: 0; width: 0; height: 0; }

.switch-pink .slider, .switch-accent .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    transition: 0.3s var(--ease-out);
}

.switch-pink .slider:before, .switch-accent .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    transition: 0.3s var(--ease-spring);
}

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

.switch-pink input:checked + .slider:before,
.switch-accent input:checked + .slider:before {
    transform: translateX(22px);
    background-color: var(--accent-ink);
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    color: var(--text-secondary);
    user-select: none;
}

.checkbox-container input { position: absolute; opacity: 0; height: 0; width: 0; }

.checkbox-checkmark {
    position: absolute;
    top: -1px;
    left: 0;
    height: 19px;
    width: 19px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.checkbox-container:hover input ~ .checkbox-checkmark { border-color: var(--accent); }

.checkbox-container input:checked ~ .checkbox-checkmark {
    background-color: var(--accent);
    border-color: var(--accent);
}

.checkbox-checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid var(--accent-ink);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkbox-checkmark:after { display: block; }

.setting-item-column { display: flex; flex-direction: column; gap: 10px; width: 100%; flex: 1; min-width: 0; }
.setting-item-heading { font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 700; color: var(--text-primary); }
.setting-sub-group { display: flex; align-items: center; gap: 14px; }
.setting-sub-group-column { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; width: 100%; }
.input-with-icon-row { display: flex; gap: 10px; width: 100%; }
.setting-item-value { font-size: clamp(12px, 1.5vw, 14px); color: var(--text-muted); flex-shrink: 0; }
.setting-item-desc { font-family: 'Inter', sans-serif; }

.custom-select-dark {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    min-width: 130px;
    transition: border-color 0.2s ease;
}

.custom-select-dark:hover { border-color: var(--accent); }

.custom-range-pink, .custom-range-accent {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
    outline: none;
}

.custom-range-pink::-webkit-slider-thumb,
.custom-range-accent::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    transition: transform 0.15s var(--ease-spring);
}

.custom-range-pink::-webkit-slider-thumb:hover,
.custom-range-accent::-webkit-slider-thumb:hover { transform: scale(1.25); }

.slider-row { display: flex; flex-direction: column; gap: 10px; }
.slider-header { display: flex; justify-content: space-between; align-items: center; }
.slider-value { font-size: 13px; font-weight: 600; color: var(--accent); }

/* Settings modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 7, 4, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: overlayIn 0.25s ease;
}

.settings-modal-content {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: min(960px, 92vw);
    height: min(680px, 88vh);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s var(--ease-out);
}

.settings-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    padding: 0 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 20;
}

.settings-header-title {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.settings-close-btn {
    background: transparent;
    border: 1.5px solid var(--text-muted);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.settings-close-btn:hover {
    background-color: rgba(128, 128, 128, 0.15);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.settings-split-layout {
    display: flex;
    flex: 1;
    height: calc(100% - 50px);
    min-height: 0;
}

.settings-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 28px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.settings-sidebar-btn {
    background: none;
    border: none;
    text-align: left;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.settings-sidebar-btn:hover { background-color: rgba(244, 239, 227, 0.05); color: var(--text-primary); }

.settings-sidebar-btn.active {
    background-color: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.settings-content-area { flex: 1; overflow-y: auto; padding: 36px 40px; }

.settings-pane { display: none; }
.settings-pane.active { display: block; animation: panelRise 0.3s var(--ease-out); }

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(6, 5, 3, 0.92);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: overlayIn 0.25s ease;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(38, 34, 24, 0.7);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.lightbox-close:hover {
    background-color: var(--danger);
    transform: rotate(90deg);
}

.lightbox-content {
    max-width: 90vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    animation: lightboxIn 0.32s var(--ease-out);
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}

.lightbox-content video {
    max-width: 90vw;
    max-height: 78vh;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}

.lightbox-spinner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px;
}

.lightbox-details { display: flex; flex-direction: column; align-items: center; gap: 10px; }

.lightbox-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }

.link-badge {
    text-decoration: none;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.link-badge:hover { border-color: var(--accent); color: var(--accent); }

.tags-toggle-btn {
    border: none;
    cursor: pointer;
    background-color: var(--accent-soft);
    color: var(--accent);
    transition: background-color 0.2s ease;
}

.tags-toggle-btn:hover { background-color: rgba(217, 168, 87, 0.26); }

.download-btn-premium {
    border: none;
    cursor: pointer;
    background: var(--accent);
    color: var(--accent-ink);
    transition: background 0.2s ease, transform 0.15s ease;
}

.download-btn-premium:hover { background: var(--accent-strong); transform: translateY(-1px); }

/* Video wrapper + custom controls */
.lightbox-video-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-video-wrapper video { display: block; }

.skip-feedback-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    pointer-events: none;
    animation: skipFlash 0.5s ease;
}

.skip-text { font-size: 14px; font-weight: 600; }

.custom-video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(to top, rgba(8, 7, 4, 0.85), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.lightbox-video-wrapper:hover .custom-video-controls,
.lightbox-video-wrapper:focus-within .custom-video-controls {
    opacity: 1;
}

.ctrl-icon-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 6px;
    flex-shrink: 0;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.ctrl-icon-btn:hover { background-color: rgba(255, 255, 255, 0.14); transform: scale(1.08); }

.ctrl-svg { width: 20px; height: 20px; }

.ctrl-progress-container {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
}

.ctrl-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.1s linear;
}

.ctrl-time-display {
    font-size: 12px;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Sliding tag sidebar */
.lightbox-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    z-index: 2100;
    transform: translateX(100%);
    transition: transform 0.32s var(--ease-out);
    display: flex;
    flex-direction: column;
}

.lightbox-sidebar.open { transform: translateX(0); }

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-soft);
    flex-shrink: 0;
}

.sidebar-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease;
}

.sidebar-close-btn:hover { color: var(--danger); }

.sidebar-tags-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes appFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes itemRise {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes tabPop {
    0% { transform: scale(0.94); }
    60% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

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

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

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes lightboxIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes skipFlash {
    0% { opacity: 0; }
    30% { opacity: 1; }
    100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
    .app-header { padding: 0 20px; height: 68px; }
    .tab-header { padding: 28px 20px 22px; }
    .scrollable-content,
    .feed-container { padding: 20px; }
    .masonry-grid, .masonry-col { gap: 18px; }
    .settings-modal-content { width: 96vw; height: 92vh; }
    .settings-split-layout { flex-direction: column; }
    .settings-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 14px 16px;
    }
    .settings-content-area { padding: 24px 20px; }
    .lightbox-sidebar { width: 100%; }
}

@media (min-width: 768px) {
    .header-actions { gap: 16px; }
}
