/* =================================================================
 == THEME & PALETTE DEFINITIONS (DARK THEME ONLY)
 =================================================================
*/
:root {
    --bg-main: #121212;
    --bg-content: #1E1E1E;
    --text-primary: #FFFFFF;
    --text-secondary: #a0a0a0;
    --border: rgba(255, 255, 255, 0.1);
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --hover-bg-subtle: rgba(255, 255, 255, 0.07);
}

.bg-theme-content {
    background-color: var(--bg-content);
}

/* --- Body Theme Application & Background --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    position: relative;
    overscroll-behavior-y: contain;
}

#main-content.menu-open {
    overflow: hidden;
}

html.modal-open,
body.search-open, body.modal-open {
    overflow: hidden;
}

/* Ensure collection popup always layers above image modal */
z

#collection-popup {
    z-index: 1001;
}

#collection-popup > div {
    z-index: inherit; /* Inherit the high z-index from parent */
}

/* =================================================================
 == MOBILE VIEWPORT RESIZE FIX
 =================================================================
*/
/* Apply the stable height to the main full-screen layout containers */
#sidebar, #main-content {
    /* Fallback for browsers that might not run the JS */
    height: 100vh;
    /* Use our custom CSS variable to set a stable height that won't jump */
    height: calc(var(--vh, 1vh) * 100);
}

/* --- Animated Gradient Background --- */
.gradient-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    overflow: hidden; z-index: -1;
}
.gradient-blob {
    position: absolute;
    filter: blur(8vmax);
    border-radius: 100%;
    will-change: transform;
}
.blob-1 {
    width: 40vmax; height: 40vmax;
    background-color: rgba(51, 153, 255, 0.15);
    animation: move-blob-1 20s infinite alternate;
}
.blob-2 {
    width: 30vmax; height: 30vmax;
    background-color: rgba(100, 50, 200, 0.1);
    animation: move-blob-2 25s infinite alternate;
}
.noise-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 800 800' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.02; pointer-events: none; z-index: -1;
}
@keyframes move-blob-1 {
    from { transform: translate(-10%, -10%) rotate(0deg); }
    to { transform: translate(30%, 20%) rotate(180deg); }
}
@keyframes move-blob-2 {
    from { transform: translate(100%, 100%) rotate(0deg); }
    to { transform: translate(50%, 40%) rotate(360deg); }
}

.main-container {
    position: relative;
    z-index: 2;
}

h1, h2, h3, .font-heading { font-family: 'Montserrat', sans-serif; }
h1, h2, h3 { color: var(--text-primary); }

.logo-text {
    font-family: 'Lobster Two', cursive;
    font-weight: 700;
    font-size: 2.25rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

/* =================================================================
 == HEADER & NAV STYLES
 =================================================================
*/
#main-header,
.filter-bar-container {
    /* transition: background-color 0.15s ease-in-out; */
    transform: translateZ(0);
    will-change: background-color;
}

#main-header.scrolled,
.filter-bar-container.scrolled {
    background-color: #1A1A1A;
}

.nav-link {
    position: relative; display: flex; align-items: center; padding: 0.625rem 1.25rem;
    font-size: 0.875rem; font-weight: 600; text-decoration: none; text-align: center;
    border-radius: 0.5rem;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: var(--text-secondary);
}
.nav-link:hover { color: var(--text-primary); }
.nav-link::after {
    content: ''; position: absolute; width: 100%; height: 2px;
    bottom: 0.375rem; left: 0; background-color: var(--accent);
    transform: scaleX(0); transform-origin: center;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.nav-link:hover::after { transform: scaleX(1); }

/* Primary Call-to-Action Button */
.btn-primary {
    display: inline-block;
    background-color: var(--accent);
    color: #FFFFFF;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease;
}

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

/* --- Hamburger Menu Button --- */
.menu-button {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.menu-button .icon-bar {
    display: block; width: 24px; height: 2px;
    border-radius: 1px;
    background-color: currentColor;
    transition: transform 0.3s ease-in-out, opacity 0.2s ease;
}
.menu-button.open .icon-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-button.open .icon-bar:nth-child(2) { opacity: 0; }
.menu-button.open .icon-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }


/* =================================================================
 == ADVANCED SEARCH BAR STYLES
 =================================================================
*/
.search-wrapper {
    position: relative;
}
.search-container {
    position: relative;
    background-color: var(--bg-content);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    transition: border-color 0.3s ease;
}

.search-container::after {
    content: '';
    position: absolute;
    top: -1px; left: -1px; right: -1px; bottom: -1px;
    border-radius: 0.45rem;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15);
    transition: opacity 0.3s ease;
    z-index: -1;
    opacity: 0;
}

.search-container.focused {
    border-color: var(--accent);
}

.search-container.focused::after {
    opacity: 1;
}

.search-container.focused .search-icon-main {
    color: var(--accent);
}

.search-icon-main {
    color: var(--text-secondary);
}

#desktop-search-input { color: var(--text-primary); }
#desktop-search-input::placeholder { color: var(--text-secondary); }

#desktop-search-input:focus,
#mobile-search-input:focus {
    outline: none;
}
.clear-button {
    display: none;
}

/* Suggestions Dropdown */
.suggestions-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    padding-top: 0.5rem;
}
.suggestions-list {
    background-color: var(--bg-content);
    border: 1px solid var(--border);
    max-height: 320px;
    overflow-y: auto;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    opacity: 0;
    transform: scale(0.98) translateY(-10px);
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.suggestions-list.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    visibility: visible;
}
.suggestion-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.suggestion-item:hover, .suggestion-item.active {
    background-color: var(--hover-bg-subtle);
    color: var(--text-primary);
}
.suggestion-item strong {
    color: var(--text-primary);
}

.suggestion-header {
    padding: 0.75rem 1rem 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
}

/* Loading Spinner */
.loader {
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent);
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Search Bar Image Preview */
#image-preview, #mobile-image-preview {
    object-fit: cover;
}
/* -- New, professional styles for the image preview pill -- */
.image-preview-pill {
    position: absolute;
    right: 0.75rem; /* Adjusted position */
    top: 50%;
    transform: translateY(-50%) scale(0.95); /* Start slightly smaller for animation */
    z-index: 5;
    display: flex;
    align-items: center;
    background-color: var(--bg-main); /* Use a theme color */
    border: 1px solid var(--border);   /* Add a subtle border */
    border-radius: 8px;                /* Slightly more rounding */
    overflow: hidden;
    height: 36px;
    opacity: 0; /* Start hidden for fade-in */
    transition: opacity 0.2s ease, transform 0.2s ease; /* Smooth animation */
}

/* When the parent container is NOT hidden, the pill becomes visible */
div:not(.hidden) > .image-preview-pill {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.image-preview-pill img {
    height: 100%;
    width: 36px; /* Match the new height */
    object-fit: cover;
    display: block;
}

.image-preview-pill button {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 36px;
    color: var(--text-secondary);
    background-color: transparent; /* No background color */
    border-left: 1px solid var(--border); /* Clean separator line */
    transition: all 0.2s ease;
}

.image-preview-pill button:hover {
    background-color: var(--hover-bg-subtle); /* Subtle hover effect */
    color: var(--text-primary);
    transform: scale(1.1);
}
/* =================================================================
 == FILTER BARS COMMON STYLES
 =================================================================
*/
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.filter-tab {
    position: relative; padding-top: 0.5rem; padding-bottom: 0.5rem;
    color: var(--text-secondary); transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}
.filter-tab::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background-color: var(--accent);
    transform: scaleX(0); transform-origin: center; transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.filter-tab:hover { color: var(--text-primary); }
.filter-tab:hover::after { transform: scaleX(1); }
.filter-tab.active, .filter-tab:hover.active { color: var(--text-primary); }
.filter-tab.active::after { transform: scaleX(1); }

.filter-tab.coming-soon { opacity: 0.5; cursor: not-allowed; }
.filter-tab.coming-soon:hover::after { transform: scaleX(0); }

.sort-button { background-color: var(--bg-content); color: var(--text-secondary); border: 1px solid var(--border); }

.button-lift {
    /* Transition properties for smooth, professional feedback */
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.button-lift:hover {
    /* A subtle background color change is a common professional hover effect */
    background-color: #383838;
}

.button-lift:active {
    /* A slight downward movement gives a clean, physical 'press' feel */
    transform: translateY(1px);
    transition: transform 0.05s; /* Make the press-down action feel quick */
}

#mobile-filter-trigger.active-trigger,
#sort-button.active-trigger {
    color: var(--text-primary);
}


/* =================================================================
 == MULTI-SELECT FILTER STYLES
 =================================================================
*/
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.animate-fade-in { animation: fadeIn 0.15s ease-out forwards; }

.filter-btn {
    background-color: var(--bg-content); color: var(--text-primary); border: 1px solid var(--border);
    transition: all 0.2s ease-in-out; white-space: nowrap; font-family: 'Montserrat', sans-serif;
}
.filter-btn:hover { background-color: #383838; }

.filter-btn.active {
    border-color: var(--accent);
}

.filter-btn.active .chevron-icon { transform: rotate(180deg); }
.chevron-icon { transition: transform 0.2s ease-in-out; }

.filter-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem; /* 4px 12px */
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.05); /* Very subtle background */
    border-radius: 9999px; /* Pill shape */
    transition: all 0.2s ease-in-out;
}

.filter-tag.modal-tag {
    cursor: pointer; /* Make tags in the modal look clickable */
}

.filter-tag.modal-tag:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Slightly more visible on hover */
    color: var(--text-primary);
    transform: translateY(-1px); /* Slight lift effect */
}

.clear-all-btn {
    color: var(--text-secondary);
    text-decoration: underline;
    transition: color 0.2s ease;
    margin-left: auto; /* Pushes the button to the far right */
}
.clear-all-btn:hover {
    color: var(--text-primary);
}

/* =================================================================
 == UNIFIED FILTER POPUP STYLES (OPAQUE & SCROLLABLE)
 =================================================================
*/
#filter-popup {
    display: none;
    position: absolute;
    z-index: 40;
    background-color: var(--bg-content);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    padding: 8px;
    opacity: 0;
    transform: translateY(-5px) scale(0.95);
    transform-origin: top left;
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    max-height: 45vh; /* REDUCED HEIGHT */
    /* display: flex; <-- This incorrect line was removed */
    flex-direction: column;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow-y: auto;
}

#filter-popup.show {
    display: flex; /* This line is now responsible for showing the element */
    opacity: 1;
    transform: translateY(0) scale(1);
}
#filter-popup-content .nav-scroll-area {
    padding-right: 4px;
}
#filter-popup-content .nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
#filter-popup-content .nav-list li {
    opacity: 0;
    transform: translateY(5px);
}
#filter-popup.show .nav-list li {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
#filter-popup-content .nav-list li a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 6px;
    transition: background-color 0.15s ease, color 0.15s ease;
    font-weight: 500;
    cursor: pointer;
}

#filter-popup-content .nav-list li a.focused,
#filter-popup-content .nav-list li a:hover {
    background-color: var(--hover-bg-subtle);
}

#filter-popup-content .nav-list li a[data-state="active"] {
    color: var(--accent);
    font-weight: 600;
}

#filter-popup-content .nav-list li a[data-state="declined"] {
    color: var(--danger);
}

.checkbox-state {
    width: 20px; height: 20px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease; flex-shrink: 0;
    border: 2px solid var(--text-secondary);
}

.checkbox-state .icon {
    opacity: 0; transform: scale(0.6) rotate(-15deg);
    transition: opacity 0.2s ease-out, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 18px; height: 18px; stroke-width: 3; display: none;
}
.checkbox-state[data-state="active"] {
    background-color: var(--accent); border-color: var(--accent);
}
.checkbox-state[data-state="active"] .check-icon { display: block; color: white; opacity: 1; transform: scale(1) rotate(0deg); }

.checkbox-state[data-state="declined"] {
    background-color: var(--danger); border-color: var(--danger);
}
.checkbox-state[data-state="declined"] .decline-icon { display: block; color: white; opacity: 1; transform: scale(1) rotate(0deg); }

#filter-popup::-webkit-scrollbar,
.nav-scroll-area::-webkit-scrollbar,
.mobile-filter-collapsible-content ul::-webkit-scrollbar {
    width: 8px;
}
#filter-popup::-webkit-scrollbar-track,
.nav-scroll-area::-webkit-scrollbar-track,
.mobile-filter-collapsible-content ul::-webkit-scrollbar-track {
    background: transparent;
}
#filter-popup::-webkit-scrollbar-thumb,
.nav-scroll-area::-webkit-scrollbar-thumb,
.mobile-filter-collapsible-content ul::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
#filter-popup:hover::-webkit-scrollbar-thumb,
.nav-scroll-area:hover::-webkit-scrollbar-thumb,
.mobile-filter-collapsible-content ul:hover::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.25);
}

/* =================================================================
 == OTHER OVERLAYS & MODALS
 =================================================================
*/
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.overlay.open { opacity: 1; pointer-events: auto; }
.overlay-bg { background-color: rgba(18, 18, 18, 0.9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

#mobile-menu { transform: translateY(-20px); }
#mobile-menu.open { transform: translateY(0); }
.mobile-nav-link {
    font-size: 1.5rem; font-weight: 600; padding: 1rem; text-align: center; width: 100%;
    opacity: 0; transform: translateY(20px); transition: color 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}
#mobile-menu.open .mobile-nav-link { opacity: 1; transform: translateY(0); }
.mobile-nav-link { color: var(--text-secondary); }
.mobile-nav-link:hover { color: var(--accent); }

#mobile-search-overlay { z-index: 1050; transform: translateY(-20px); }
#mobile-search-overlay.open { transform: translateY(0); }
.mobile-search-wrapper {
    width: 100%;
    max-width: 500px;
}

@keyframes fadeIn-stagger { to { opacity: 1; transform: translateY(0); } }


/* =================================================================
 == SPOTLIGHT AI SIDEBAR STYLES
 =================================================================
*/
#sidebar {
    background-color: #1A1A1A;
    border-right: 1px solid var(--border);
    width: 64px;
}

.action-btn {
    transition: color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
    position: relative;
    color: var(--text-secondary);
}
.action-btn:hover, .action-btn.active {
    color: var(--text-primary);
    background-color: var(--accent);
    transform: scale(1.05);
}
.action-btn:active {
    transform: scale(0.95);
}

.action-btn.coming-soon {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn.coming-soon:hover {
    background-color: transparent; /* Prevents the hover effect */
    transform: none; /* Prevents the scale effect */
    color: var(--text-secondary); /* Keeps original color */
}

#spotlight-container {
    left: 80px;
    pointer-events: none;
}

.spotlight-panel {
    background-color: rgba(30, 30, 30, 0.85);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    width: 320px;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    position: absolute;
    transform: scale(0.95) translateX(-20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease-out;
    pointer-events: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform-origin: left center;
}
.spotlight-panel.is-open {
    transform: scale(1) translateX(0);
    opacity: 1;
    pointer-events: auto;
}
.spotlight-panel.from-bottom {
    transform-origin: left bottom;
}

.spotlight-item {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInSlideUp 0.3s forwards cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spotlight-link:hover {
    background-color: var(--hover-bg-subtle);
}

/* Style for inactive/coming soon links in the sidebar pop-up */
.spotlight-link.coming-soon {
    opacity: 0.5;
    cursor: not-allowed;
}

.spotlight-link.coming-soon:hover {
    background-color: transparent; /* Disable the hover effect */
}

#main-content {
    margin-left: 64px;
}

/* Mobile Styles */
@media (max-width: 1023px) {
    #main-content { margin-left: 0; }
    #sidebar {
        width: 320px;
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    #sidebar.is-open-mobile {
        transform: translateX(0);
    }
    #spotlight-container {
        display: none;
    }
    .logo-text {
        font-size: 1.75rem;
    }

    #sidebar .fill-button {
        background-color: var(--accent);
        color: #FFFFFF;
        border-color: var(--accent);
        text-align: center;
    }

    #sidebar .fill-button:hover {
        color: #FFFFFF;
        background-color: var(--accent-hover);
        border-color: var(--accent-hover);
    }

    #sidebar .fill-button::before {
        display: none;
    }
}

.mobile-collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

#overlay.hidden {
    display: none;
}

/* =================================================================
 == CREATIVE FILL BUTTON STYLES
 =================================================================
*/
.fill-button {
    background-color: transparent;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
    border-radius: 0.5rem;
    transition: color 0.6s cubic-bezier(0.25, 1, 0.5, 1), transform 0.1s ease-in-out;
    border: 2px solid var(--accent);
    color: var(--text-primary);
}

.fill-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: -1;
    background-color: var(--accent);
}

.fill-button:hover {
    color: #fff;
}

.fill-button:hover::before {
    transform: scaleX(1);
}

.fill-button:active {
    transform: scale(0.95);
}

.fill-button:active {
    transform: scale(0.95);
}

/* =================================================================
 == SORT BY POPUP STYLES
 =================================================================
*/
.sort-popup-container {
    position: absolute;
    z-index: 60;
    width: 280px;
    background-color: var(--bg-content);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
    transform-origin: top right;
    pointer-events: none;
    /* Smoother transition for the desktop dropdown view */
    transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1), transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.sort-popup-container.open {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.sort-popup-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.sort-popup-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.sort-popup-close-btn {
    color: var(--text-secondary);
    transition: color 0.2s ease;
}
.sort-popup-close-btn:hover {
    color: var(--text-primary);
}


.sort-options-grid {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sort-option-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    color: var(--text-secondary);
}

.sort-option-item:hover {
    background-color: var(--hover-bg-subtle);
    color: var(--text-primary);
}

.sort-option-item.active-sort {
    color: var(--accent);
    font-weight: 600;
    background-color: rgba(59, 130, 246, 0.1);
}

.sort-option-item .sort-icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* =================================================================
 == MOBILE BOTTOM-SHEET STYLES
 =================================================================
*/
@media (max-width: 767px) {
    .sort-popup-container {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transform-origin: bottom center;
        /* Smoother transition for the mobile bottom sheet view */
        transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    }

    .sort-popup-container.open {
        transform: translateY(0);
    }

    .sort-popup-header {
        display: flex;
    }

    .sort-options-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 1.25rem;
    }

    .sort-option-item {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding: 1rem;
        background-color: var(--bg-content);
        border: 1px solid var(--border);
        gap: 0.5rem;
    }

    .sort-option-item:hover {
        background-color: #383838;
    }

    .sort-option-item.active-sort {
        border-color: var(--accent);
        background-color: rgba(59, 130, 246, 0.1);
    }
}

/* =================================================================
 == DECENT FILTER BUTTON ANIMATION
 =================================================================
*/
#third-filter-bar {
    overflow-x: auto;
    min-height: 44px;
}

/* =================================================================
 == SMART SLIDE ANIMATION
 =================================================================
*/
#third-filter-bar {
    position: relative;
    min-height: 44px;
}

.filter-btn .selected-value {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn.has-selection .selected-value {
    display: inline-flex;
}

.filter-btn.has-selection .default-text {
    display: none;
}

.filter-btn .clear-selection-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: rgba(0,0,0,0.3);
    color: white;
    font-size: 0.75rem;
    line-height: 1rem;
    transition: background-color 0.2s ease;
}

.filter-btn .clear-selection-btn:hover {
    background-color: rgba(0,0,0,0.5);
}

/* =================================================================
 == MOBILE FILTER POPUP STYLES
 =================================================================
*/
.mobile-filter-collapsible-header {
    background-color: var(--bg-content);
    transition: background-color 0.2s ease;
}

#mobile-filter-popup .mobile-filter-collapsible-header {
    padding-right: 1.5rem !important;
}

.mobile-filter-collapsible-header:hover {
    background-color: #383838;
}

.mobile-filter-collapsible-header .chevron-icon {
    transition: transform 0.3s ease-out;
}
.mobile-filter-collapsible-header.is-expanded .chevron-icon {
    transform: rotate(180deg);
}

.mobile-filter-collapsible-content {
    max-height: 0;
    overflow: hidden;
    /* Using the same smooth easing for consistency */
    transition: max-height 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.mobile-filter-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    transition: background-color 0.15s ease;
    cursor: pointer;
}
.mobile-filter-list-item:hover {
    background-color: var(--hover-bg-subtle);
}
.mobile-filter-list-item.active {
    font-weight: 600;
    color: var(--accent);
}
.mobile-filter-list-item.active .checkbox-state {
    background-color: var(--accent);
    border-color: var(--accent);
}
.mobile-filter-list-item.active .checkbox-state .check-icon {
    display: block;
    color: white;
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.mobile-filter-collapsible-content ul {
    max-height: 40vh;
    overflow-y: auto;
    padding-right: 4px;
}

#mobile-filter-footer {
    background-color: var(--bg-main);
    border-top: 1px solid var(--border);
}

.filter-footer-btn {
    padding: 0.75rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}
.filter-footer-btn.primary {
    background-color: var(--accent);
    color: white;
}
.filter-footer-btn.primary:hover {
    background-color: var(--accent-hover);
}

.filter-footer-btn.secondary {
    background-color: var(--bg-content);
    color: var(--text-primary);
}
.filter-footer-btn.secondary:hover {
    background-color: #383838;
}

/* =================================================================
 == ASPECT RATIO RESPONSIVENESS FOR FILTER BAR
 =================================================================
*/
.desktop-filters {
    display: flex;
}
.mobile-filter-trigger-container {
    display: none;
}

@media (max-aspect-ratio: 16/10) {
    .desktop-filters {
        display: none;
    }
    .mobile-filter-trigger-container {
        display: block;
    }

    #mobile-filter-popup {
        position: fixed;
        bottom: 0;
        left: 50%;
        border-radius: 20px 20px 0 0;
        transform: translate(-50%, 20px);
        transform-origin: bottom center;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        width: 95%;
        max-width: 560px;
        max-height: 70vh;
        opacity: 0;
        visibility: hidden;
    }

    #mobile-filter-popup.open {
        transform: translate(-50%, 0);
        opacity: 1;
        visibility: visible;
    }

    #mobile-filter-popup .sort-popup-header {
        display: flex;
    }
}

@media (max-width: 767px) {
    #mobile-filter-popup {
        width: 100%;
        max-width: 100%;
        left: 0;
        transform: translateY(100%);
    }

    #mobile-filter-popup.open {
        transform: translateY(0);
    }
}

/* =================================================================
 == PROFESSIONAL MASONRY GALLERY (NEW)
 =================================================================
*/
.masonry-container {
    column-gap: 0.5rem;
    column-count: 2; /* Default to 2 columns for mobile */
    transition: column-count 0.4s ease-in-out; /* Add transition for smoother changes */
}
@media (min-width: 768px) { .masonry-container { column-count: 3; } }
@media (min-width: 1024px) { .masonry-container { column-count: 4; } }
@media (min-width: 1280px) { .masonry-container { column-count: 5; } }
@media (min-width: 1920px) { .masonry-container { column-count: 6; } }

/* Styles for larger images in the 'All Images' and 'Desktop' views */
@media (min-width: 1024px) { .masonry-container.large-grid-view { column-count: 3; } }
@media (min-width: 1280px) { .masonry-container.large-grid-view { column-count: 4; } }
@media (min-width: 1920px) { .masonry-container.large-grid-view { column-count: 5; } }

/* Styles for smaller images in the 'Phone' tab view */
.masonry-container.phone-grid-view { column-count: 3; }
@media (min-width: 768px) { .masonry-container.phone-grid-view { column-count: 4; } }
@media (min-width: 1024px) { .masonry-container.phone-grid-view { column-count: 5; } }
@media (min-width: 1280px) { .masonry-container.phone-grid-view { column-count: 6; } }
@media (min-width: 1920px) { .masonry-container.phone-grid-view { column-count: 7; } }

.masonry-card-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 0.5rem;
    break-inside: avoid;
    border-radius: 0.5rem;
    overflow: hidden;
    /* --- Optimizations for smooth scrolling --- */
    contain: paint; /* Isolate rendering for this element */
    will-change: transform; /* Hint to the browser to prepare for transform changes */
    transition: transform 0.15s ease-out; /* Faster transition for click feedback */
}


.card-aspect-ratio-keeper {
    position: relative;
    height: 0;
    width: 100%;
    background-color: var(--bg-content);
}

.card-aspect-ratio-keeper img,
.card-aspect-ratio-keeper picture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.5rem;
    will-change: opacity, transform; /* Prepare browser for transform */
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Add smooth transition */
}

.card-aspect-ratio-keeper {
    position: relative;
    height: 0;
    width: 100%;
    background-color: var(--bg-content);
}

/* --- New Shimmer Animation --- */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.card-aspect-ratio-keeper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 20%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 80%
    );
    animation: shimmer 1.8s infinite;
    transition: opacity 0.4s ease-in-out;
    background-size: 200% 100%;
}

/* Hide the shimmer effect when the image is loaded */
.card-aspect-ratio-keeper.is-loaded::after {
    opacity: 0;
}

/* Style for the full-quality image */
.img-high-res {
    opacity: 0; /* Hidden by default */
    transition: opacity 0.4s ease-in-out; /* Smooth fade-in */
}

/* When this class is added by JS, the high-res image fades in */
.img-high-res.loaded {
    opacity: 1;
}

/* --- NEW: Style for cards where the image failed to load --- */
.card-aspect-ratio-keeper.has-error {
    background-color: #2a2a2a; /* A slightly different, darker background */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.card-aspect-ratio-keeper.has-error::before {
    content: '\f1c5'; /* Font Awesome 'file-image' icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 2rem;
    opacity: 0.3;
}


.card-overlay-button {
    position: absolute;
    inset: 0;
    cursor: zoom-in;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
    opacity: 0;
    /* --- Optimizations --- */
    will-change: opacity; /* Prepare for fade-in animation */
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Smoother transition */
}


.overlay-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 0.75rem;
}

.card-description {
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
    flex-grow: 1;
    /* Allow two lines of text before truncating */
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    /* Animation */
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s; /* Smoother transition */
}



/* =================================================================
 == CARD ACTIONS MENU (NEW)
 =================================================================
*/
.card-actions-container {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 5;
}

.card-actions-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(30, 30, 30, 0.7); /* Made slightly more opaque */
    /* backdrop-filter: blur(8px); - Removed for performance */
    /* -webkit-backdrop-filter: blur(8px); - Removed for performance */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
    transform: scale(0.8);
}

.masonry-card-wrapper:active {
    transform: scale(0.98); /* "Press down" effect on click/tap */
}

.card-actions-btn:hover {
    background-color: rgba(45, 45, 45, 0.7);
    transform: scale(1.1);
}

.card-actions-popup {
    position: absolute;
    top: 1%;
    right: calc(100% + 0.5rem);
    background-color: var(--bg-content);
    border: 1px solid var(--border);
    border-radius: 0.75rem; /* More rounded */
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    padding: 0.5rem;
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    opacity: 0;
    transform: scale(0.95) translateX(10px);
    transform-origin: right center;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 10;
    width: auto; /* Adjust width to content */
}

.card-actions-container:hover .card-actions-popup {
    opacity: 1;
    transform: scale(1) translateX(0);
    visibility: visible;
}

/* =================================================================
 == CARD ACTIONS MENU (ICON BUTTONS)
 =================================================================
*/
.card-actions-popup {
    position: absolute;
    top: 1%;
    right: calc(100% + 0.5rem);
    background-color: var(--bg-content);
    border: 1px solid var(--border);
    border-radius: 0.75rem; /* More rounded */
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    padding: 0.5rem;
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(-50%) scale(0.95) translateX(10px);
    transform-origin: right center;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 10;
    width: auto; /* Adjust width to content */
}


.popup-icon-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}


.popup-icon-button:hover {
    background-color: var(--hover-bg-subtle);
    color: var(--text-primary);
    transform: scale(1.1);
}


.popup-icon-button i {
    width: 1.25rem;
    height: 1.25rem;
}
/* Hide the 'more' button on mobile devices */
@media (max-width: 767px) {
    .card-actions-container {
        display: none;
    }
}

/* =================================================================
 == HYBRID HEADER POSITIONING (STICKY/FIXED)
 =================================================================
*/
@media (max-width: 1023px) {
    #main-header {
        position: fixed;
    }

    #main-content {
        padding-top: 5rem;
    }
}

.admin-pick-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 5;
    background-color: transparent;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-pick-badge i {
    width: 1rem;
    height: 1rem;
    color: white;
    /* Add a shadow to the icon so it stands out on any background */
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
}

/* --- Desktop Hover Effects --- */
@media (hover: hover) and (min-width: 1024px) {
    .masonry-card-wrapper:hover .card-aspect-ratio-keeper img,
    .masonry-card-wrapper:hover .card-aspect-ratio-keeper picture {
        transform: scale(1.05);
    }

    .masonry-card-wrapper:hover .card-overlay-button {
        opacity: 1;
    }

    .masonry-card-wrapper:hover .card-description {
        transform: translateY(0);
        opacity: 1;
    }

    .masonry-card-wrapper:hover .card-actions-btn {
        opacity: 1;
        transform: scale(1);
    }
}
/* =================================================================
 == SAVE TO COLLECTION POPUP STYLES (NEW)
 =================================================================
*/
#collection-popup {
    position: fixed;
    inset: 0;
    z-index: 9700; /* Increased to appear above the image modal (9600) */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(18, 18, 18, 0.7);
    backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}
#collection-popup.open {
    opacity: 1;
    pointer-events: auto;
}
.collection-popup-content {
    background-color: var(--bg-content);
    border: 1px solid var(--border);
    border-radius: 1rem;
    width: 90%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.collection-popup-content {
    background-color: var(--bg-content);
    border: 1px solid var(--border);
    border-radius: 1rem;
    width: 90%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#collection-popup.open .collection-popup-content {
    transform: scale(1);
}
.collection-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.collection-popup-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}
.collection-popup-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-shrink: 0;
}
.collection-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
.collection-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}
.collection-item:hover {
    border-color: var(--accent);
    background-color: var(--hover-bg-subtle);
}
.collection-item.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
}
.collection-thumbnail {
    width: 64px;
    height: 64px;
    border-radius: 0.5rem;
    object-fit: cover;
    background-color: var(--bg-content);
}
.collection-name {
    font-weight: 600;
}
.collection-count {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.create-collection-form {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}
.create-collection-input {
    flex-grow: 1;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
}
.create-collection-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

/* --- New Rules for Staggered Animation --- */
/* Hide elements initially */
#mobile-filter-popup .sort-popup-header,
#mobile-filter-popup .mobile-filter-section,
#mobile-filter-popup #mobile-filter-footer {
    opacity: 0;
}

/* Animate them when popup is open */
#mobile-filter-popup.open .sort-popup-header,
#mobile-filter-popup.open .mobile-filter-section,
#mobile-filter-popup.open #mobile-filter-footer {
    animation: professionalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Apply sequential delays for the stagger effect */
#mobile-filter-popup.open .sort-popup-header { animation-delay: 0.1s; }
#mobile-filter-popup.open .mobile-filter-section:nth-of-type(1) { animation-delay: 0.15s; }
#mobile-filter-popup.open .mobile-filter-section:nth-of-type(2) { animation-delay: 0.2s; }
#mobile-filter-popup.open .mobile-filter-section:nth-of-type(3) { animation-delay: 0.25s; }
#mobile-filter-popup.open .mobile-filter-section:nth-of-type(4) { animation-delay: 0.3s; }
#mobile-filter-popup.open .mobile-filter-section:nth-of-type(5) { animation-delay: 0.35s; }
#mobile-filter-popup.open .mobile-filter-section:nth-of-type(6) { animation-delay: 0.4s; }
#mobile-filter-popup.open #mobile-filter-footer { animation-delay: 0.45s; }

/* --- New Keyframe Animation --- */
@keyframes professionalSlideUp {
    from {
        transform: translateY(15px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
/* --- New Rules for Sort Popup Staggered Animation --- */
/* Hide elements initially */
#sort-popup .sort-popup-header,
#sort-popup .sort-option-item {
    opacity: 0;
}

/* Animate them when popup is open */
#sort-popup.open .sort-popup-header,
#sort-popup.open .sort-option-item {
    animation: professionalSlideUp 0.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* Apply animation delays */
#sort-popup.open .sort-popup-header {
    animation-delay: 0.1s;
}
#sort-popup.open .sort-option-item {
    animation-delay: 0.15s; /* All items now have the same delay */
}

/* --- Mobile Bottom Sheet Responsiveness --- */
/* This entire CSS block should be deleted */

/* =================================================================
 == DETAILED IMAGE MODAL STYLES
 =================================================================
*/
.image-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9600; /* Set higher than auth modals (9500) to appear on top */
    background-color: rgba(18, 18, 18, 0.7);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.image-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.image-modal-content-wrapper {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    max-width: 90vw;
    max-height: 90vh;
    gap: 1rem;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.image-modal-content-wrapper {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    max-width: 90vw;
    max-height: 90vh;
    gap: 1rem;
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.image-modal-overlay.open .image-modal-content-wrapper {
    transform: scale(1);
}

/* --- Main Buttons --- */
.modal-close-btn-main {
    position: absolute;
    top: -12px;
    right: -48px;
    background: rgba(30, 30, 30, 0.5);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}
.modal-close-btn-main:hover {
    background: rgba(45, 45, 45, 0.8);
    color: var(--text-primary);
    transform: scale(1.1) rotate(90deg);
}

.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(30, 30, 30, 0.5);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    z-index: 10;
}
.modal-nav-btn.left-0 { left: -48px; }
.modal-nav-btn.right-0 { right: -48px; }

.modal-nav-btn:hover {
    background: rgba(45, 45, 45, 0.8);
    color: var(--text-primary);
    transform: translateY(-50%) scale(1.1);
}

.modal-nav-btn.hidden {
    display: none;
}

/* --- Image Pane --- */
.modal-image-pane {
    flex: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    border-radius: 0.75rem;
    overflow: hidden;
}
.modal-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
#modal-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.4s 0.1s ease;
}
#modal-image.loaded {
    opacity: 1;
}
.modal-loader {
    position: absolute;
    width: 48px;
    height: 48px;
    border: 4px solid var(--accent);
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: rotation 1s linear infinite;
}
.modal-loader.hidden { display: none; }

/* --- Details Pane --- */
.modal-details-pane {
    flex: 1;
    min-width: 320px;
    max-width: 350px;
    background-color: var(--bg-content);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.details-pane-content {
    padding: 1.5rem;
    overflow-y: auto;
    height: 100%;
    display: flex;
    flex-direction: column;
}
#modal-tags-container .filter-tag {
    cursor: default;
}
#modal-tags-container .filter-tag:hover {
    background-color: var(--bg-content);
}

/* --- Action Buttons --- */
.modal-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.modal-action-btn.primary {
    background-color: var(--accent);
    color: white;
}
.modal-action-btn.primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}
.modal-action-btn.secondary {
    background-color: var(--bg-main);
    color: var(--text-primary);
}
.modal-action-btn.secondary:hover {
    background-color: #383838;
}
#modal-save-btn.saved {
    background-color: #22c55e; /* Green */
}
#modal-save-btn.saved:hover {
    background-color: #16a34a;
}

/* --- Responsive --- */
@media (max-width: 1023px) {
    .image-modal-overlay {
        padding: 0;
        align-items: flex-start;
        overflow-y: auto;
    }
    .image-modal-content-wrapper {
        flex-direction: column;
        max-width: 100%;
        max-height: none;
        height: auto;
        gap: 0;
        transform: none !important;
    }
    .modal-image-pane {
        border-radius: 0;
        min-height: 50vh;
    }
    .modal-details-pane {
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        max-width: 100%;
    }
    .modal-close-btn-main {
        top: 1rem;
        right: 1rem;
        background: rgba(30, 30, 30, 0.8);
        z-index: 50; /* This ensures the button is always on top */
    }
    .modal-nav-btn {
        top: 25vh; /* Center in the image pane */
    }
    .modal-nav-btn.left-0 { left: 1rem; }
    .modal-nav-btn.right-0 { right: 1rem; }
}
/* =================================================================
 == AUTH MODAL STYLES (UPGRADED)
 =================================================================
*/
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999; /* Set to be on top of everything */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(18, 18, 18, 0.5);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.auth-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.auth-modal-content {
    position: relative;
    background: var(--bg-content);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 420px;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-overlay.open .auth-modal-content {
    transform: scale(1) translateY(0);
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 1rem;
}

.auth-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0;
    color: var(--text-primary);
}

.auth-modal-header p {
    font-size: 0.9rem;
    display: none;
}

.auth-form .input-group {
    margin-bottom: 0.75rem;
    position: relative;
}

.auth-form .input-group label {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
    display: block;
}

.auth-form .input-group input {
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.8rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
    width: 100%;
}

.auth-form .input-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

#confirm-password-group.hidden {
    display: none;
}

.forgot-password {
    display: block;
    text-align: right;
    font-size: 0.875rem;
    color: var(--accent);
    text-decoration: none;
    margin-top: -0.5rem;
    margin-bottom: 0.875rem;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.auth-divider {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 1rem 0;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}
.auth-divider span { padding: 0 1rem; }

.social-logins {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.social-btn.google {
    background-color: #FFFFFF;
    color: #333333;
    border-color: #FFFFFF;
}

.social-btn.google:hover {
    background-color: #f2f2f2;
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}
.auth-switch a:hover {
    text-decoration: underline;
}

.auth-modal-content .modal-close-btn-main {
    top: 1rem;
    right: 1rem;
    background: transparent;
}
.auth-modal-content .modal-close-btn-main:hover {
    background: var(--hover-bg-subtle);
    transform: scale(1.1) rotate(90deg);
}

#modal-donate-close-btn {
    top: 3px;  /* Moves the button up by 5px (16px - 5px) */
    right: 3px; /* Moves the button right by 7px (16px - 7px) */
}

@media (max-width: 480px) {
    .auth-modal-content {
        padding: 2rem 1.5rem;
    }
}
/* =================================================================
 == ACCESSIBILITY & POLISH ENHANCEMENTS (NEW)
 =================================================================
*/

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4);
    border-radius: 0.375rem;
}

.auth-form .input-group input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3); /* Keep existing style */
}

::selection {
    background-color: var(--accent);
    color: var(--text-primary);
}

html {
    scroll-behavior: smooth;
}

/* =================================================================
 == PRICING MODAL STYLES (NEW CLEAN REDESIGN)
 =================================================================
*/
.pricing-modal-content {
    position: relative;
    background-color: var(--bg-content);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 760px;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-overlay.open .pricing-modal-content {
    transform: scale(1) translateY(0);
}

.pricing-modal-header, .swiper-slide, .pricing-toggle-container {
    opacity: 0;
    animation: professionalSlideUp 0.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.auth-modal-overlay.open .pricing-modal-header { animation-delay: 0.1s; }
.auth-modal-overlay.open .pricing-toggle-container { animation-delay: 0.2s; }
.auth-modal-overlay.open .swiper-slide:nth-of-type(1) { animation-delay: 0.3s; }
.auth-modal-overlay.open .swiper-slide:nth-of-type(2) { animation-delay: 0.4s; }

.pricing-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.pricing-modal-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.pricing-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.pricing-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.pricing-toggle:hover {
    border-color: var(--accent);
}

.pricing-toggle-handle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s ease-in-out;
}

.pricing-toggle[aria-checked="true"] {
    background-color: var(--accent);
}

.pricing-toggle[aria-checked="true"] .pricing-toggle-handle {
    transform: translateX(20px);
}

.pricing-save-badge {
    background-color: rgba(22, 163, 74, 0.2);
    color: #22c55e;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid #22c55e;
}

.pricing-cards-container {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Equal columns */
    align-items: stretch; /* Make cards equal height */
    gap: 1.5rem;
    width: 100%;
    padding-bottom: 40px;
}

.swiper-slide {
    display: flex;
    align-items: stretch;
    height: auto;
}

.pricing-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.pricing-card-pro {
    border: 2px solid var(--accent); /* Highlight with border */
}

.pricing-card .fill-button {
    margin-top: 1.5rem;
}

.most-popular-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background-color: var(--accent);
    color: white;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.pricing-card h3 { font-size: 1.5rem; font-weight: 600; margin-bottom: 1rem; color: var(--text-primary); }
.price-display { margin-bottom: 1.5rem; display: flex; align-items: baseline; }
.price-amount { font-size: 3rem; font-weight: 700; color: var(--text-primary); }
.price-period { color: var(--text-secondary); font-weight: 500; margin-left: 0.25rem; }
.pricing-divider { border-color: var(--border); margin-bottom: 1.5rem; }
.feature-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1rem; }
.feature-item { display: flex; align-items: center; gap: 0.75rem; color: var(--text-secondary); }
.feature-icon { width: 1.1rem; height: 1.1rem; color: #22c55e; flex-shrink: 0; }
.pricing-card-pro .feature-icon { color: var(--accent); } /* Pro features have accent color checkmarks */

/* New style for the filled button */
.fill-button.filled {
    background-color: var(--accent);
    color: white;
}
.fill-button.filled::before {
    display: none; /* Disable the fill effect since it's already filled */
}
.fill-button.filled:hover {
    background-color: var(--accent-hover);
}

/* Swiper Pagination Styles */
.swiper-pagination {
    bottom: 0 !important;
}
.swiper-pagination-bullet {
    background-color: var(--border);
    opacity: 0.8;
}
.swiper-pagination-bullet-active {
    background-color: var(--accent);
    opacity: 1;
}

@media (max-width: 767px) {
    /* This entire CSS block should be deleted */
    .auth-modal-overlay.open .pricing-modal-content {
        transform: scale(1) translateY(0);
    }
    .pricing-cards-container {
        display: block; /* Disable grid on mobile, Swiper will handle it */
        padding-left: 1rem;
        padding-right: 1rem;
        width: 100%;
    }
    .pricing-card {
        min-height: auto;
        height: auto;
        padding: 1.5rem;
    }

    .pricing-modal-content .modal-close-btn-main {
        top: 0.75rem;
        right: 0.75rem;
        width: 32px;
        height: 32px;
        background: rgba(255, 255, 255, 0.05);
        z-index: 50;
    }
}
#mobile-nav-content {
    height: 100%;
}
/* =================================================================
 == ACCOUNT CENTRE STYLES (NEW PROFILE HUB)
 =================================================================
*/
.account-btn {
    position: relative;
    border-radius: 9999px;
    transition: transform 0.2s ease;
}

.account-btn:hover {
    transform: scale(1.1);
}

.account-btn::after {
    content: '';
    position: absolute;
    inset: -3px;
    border: 2px solid var(--accent);
    border-radius: 9999px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.account-btn:hover::after,
.account-btn.active::after {
    opacity: 1;
}

.profile-hub-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    background-color: rgba(18, 18, 18, 0.5);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.profile-hub-overlay.open {
    opacity: 1;
    visibility: visible;
}

.profile-hub-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 800px;
    height: 100%;
    display: flex;
    background-color: var(--bg-main);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-hub-overlay.open .profile-hub-content {
    transform: translateX(0);
}

.profile-hub-sidebar {
    width: 280px;
    flex-shrink: 0;
    background-color: var(--bg-content);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.profile-hub-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.profile-hub-nav {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-hub-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.375rem;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}

.profile-hub-link.active,
.profile-hub-link:hover {
    background-color: var(--hover-bg-subtle);
    color: var(--text-primary);
}

.profile-hub-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.profile-hub-link.sign-out:hover {
    color: var(--danger);
}

.profile-hub-main {
    flex-grow: 1;
    padding: 2.5rem;
    overflow-y: auto;
    position: relative;
}

.profile-hub-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: var(--text-secondary);
    transition: color 0.2s ease, transform 0.2s ease, opacity 0.3s ease, visibility 0.3s ease;
}
.profile-hub-close-btn:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

.profile-hub-pane {
    display: none;
}

.profile-hub-pane.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.pane-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}
.pane-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

@media (max-width: 767px) {
    .profile-hub-content {
        max-width: 100%;
    }
}
/* =================================================================
 == ACCOUNT SETTINGS PANE STYLES
 =================================================================
*/
.settings-section {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
}
.settings-section:first-of-type {
    padding-top: 1rem;
}
.settings-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.avatar-control {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.settings-avatar {
    width: 80px;
    height: 80px;
    border-radius: 9999px;
    object-fit: cover;
}
.avatar-buttons {
    display: flex;
    gap: 0.75rem;
}

.modal-action-btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.input-row + .input-row {
    margin-top: 1.5rem;
}

.input-row .input-group {
    flex-grow: 1;
}

.input-row label {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    display: block;
}

.input-row input, .email-display {
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    width: 100%;
}
.input-row input:disabled {
    background-color: transparent;
    border-color: transparent;
    padding-left: 0;
}
.email-display {
    border-color: transparent;
    padding-left: 0;
}

.edit-btn {
    background-color: var(--bg-content);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-top: auto; /* Aligns with bottom of input */
}
.edit-btn:hover {
    background-color: #383838;
    border-color: #555;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.section-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.connected-account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-main);
    border-radius: 0.5rem;
}

.connected-badge {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.coming-soon-nav {
    opacity: 0.6;
    pointer-events: none; /* Makes the link not clickable */
    cursor: not-allowed;
    position: relative;
}

.coming-soon-badge {
    position: absolute;
    top: -4px;
    right: -10px;
    font-size: 0.6rem; /* Tiny text */
    font-weight: 700;
    text-transform: uppercase;
    color: #000;
    background-color: #f59e0b; /* Amber/yellow color */
    padding: 2px 5px;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
    animation: pulse-badge 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulse-badge {
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 15px rgba(245, 158, 11, 0.7);
    }
}

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

.notification-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.notification-toggle[aria-checked="true"] {
    background-color: var(--accent);
}
.notification-toggle-handle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s ease-in-out;
}
.notification-toggle[aria-checked="true"] .notification-toggle-handle {
    transform: translateX(20px);
}

.delete-account-btn {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
}
.delete-account-btn:hover {
    background-color: var(--danger);
    color: white;
}
/* =================================================================
 == CONFIRMATION MODAL STYLES
 =================================================================
*/
.confirm-modal-content {
    position: relative;
    background: var(--bg-content);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 420px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.confirm-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 9999px;
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}
.confirm-modal-icon svg {
    width: 32px;
    height: 32px;
}

.confirm-modal-header {
    margin-bottom: 2rem;
}

.confirm-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
}

.modal-action-btn.danger {
    background-color: var(--danger);
    color: white;
}
.modal-action-btn.danger:hover {
    background-color: #c53030;
}

.donate-modal-scrollable-text {
    max-height: 215px; /* Sets a maximum height for the text area */
    overflow-y: auto;  /* Adds a scrollbar only when content overflows */
    padding-right: 0.75rem; /* Creates space for the scrollbar */
    margin-right: -0.75rem; /* Pulls the content back to align correctly */
}

/* Optional: Custom scrollbar styling to match the theme */
.donate-modal-scrollable-text::-webkit-scrollbar {
    width: 8px;
}
.donate-modal-scrollable-text::-webkit-scrollbar-track {
    background: transparent;
}
.donate-modal-scrollable-text::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
.donate-modal-scrollable-text:hover::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.25);
}
/* =================================================================
 == COLLECTION EDIT MODAL STYLES (UPGRADED)
 =================================================================
*/
.collection-edit-content {
    position: relative;
    background: var(--bg-content);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 420px;
    text-align: left;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-overlay.open .collection-edit-content {
    transform: scale(1);
}

.collection-edit-header {
    margin-bottom: 1.5rem;
}

#collection-modal-subtitle {
    margin-top: 0.25rem;
}

/* New styles for better form layout and input appearance */
#collection-edit-form .input-group {
    margin-bottom: 1.5rem;
}

#collection-edit-form label {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

#collection-edit-form input {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.8rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
}

#collection-edit-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}


/* --- Animations --- */
#collection-edit-modal .collection-edit-header,
#collection-edit-modal #collection-edit-form {
    opacity: 0;
    animation: professionalSlideUp 0.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

#collection-edit-modal.open .collection-edit-header {
    animation-delay: 0.1s;
}
#collection-edit-modal.open #collection-edit-form {
    animation-delay: 0.2s;
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 0.8rem;
    transform: translateY(-50%);
    color: var(--text-secondary);
    width: 1.1rem;
    height: 1.1rem;
    pointer-events: none; /* Allows you to click through the icon */
}

#collection-edit-form .input-with-icon input {
    padding-left: 2.5rem; /* Make space for the icon */
}

.funny-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-align: center;
}
/* =================================================================
 == MY COLLECTIONS PANE STYLES
 =================================================================
*/
.pane-header {
    text-align: center;
    margin-bottom: 2rem;
}

.pane-header .pane-subtitle {
    margin-bottom: 1.5rem;
}

.create-collection-wrapper {
    max-width: 300px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.collections-grid-new {
    display: grid;
    grid-template-columns: 1fr; /* Default to 1 column for mobile */
    gap: 1rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@media (min-width: 768px) { /* Start multi-column layout on larger screens */
    .collections-grid-new {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

.collection-card-new {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: var(--bg-content);
    cursor: pointer;
    border: 1px solid var(--border);
    transition: transform 0.3s ease, border-color 0.3s ease;
    will-change: transform, border-color;
}

.collection-card-new:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.collection-card-thumbnail {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center; /* Default for landscape */
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.collection-card-new:hover .collection-card-thumbnail {
    transform: scale(1.05);
}

/* Smart-cropping for portrait images */
.collection-card-thumbnail.is-portrait {
    object-position: top center;
}

.collection-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 50%);
    z-index: 1;
}

.collection-card-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 1rem;
    background-color: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collection-card-name {
    font-weight: 600;
    font-size: 1.125rem;
    color: white;
}
.collection-card-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.collection-card-actions {
    display: flex;
    gap: 0.25rem;
}

.collection-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: white;
}
.collection-action-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.back-to-collections-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.back-to-collections-btn:hover {
    color: var(--text-primary);
}

/* =================================================================
 == COLLECTION VIEW MODAL STYLES (NEW)
 =================================================================
*/
.collection-view-content {
    position: relative;
    background: var(--bg-content);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 90vw;
    height: 90vh;
    max-width: 1600px;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-overlay.open .collection-view-content {
    transform: scale(1);
}

#collection-view-modal {
    z-index: 9550; /* Below image modal (9600) but above main content */
}

.collection-view-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.collection-view-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

#collection-view-main {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* =================================================================
 == MOBILE ACCOUNT HUB STYLES (NEW)
 =================================================================
*/
#mobile-account-hub {
    background-color: var(--bg-main);
}

.mobile-hub-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--accent);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    padding: 0.75rem 1rem;
    margin: 0 1rem; /* Temporarily remove bottom margin */
    border-radius: 0.5rem;
    /* Animation starting state */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-20px);
    /* Updated transition to include height and margin */
    transition: all 0.3s ease-in-out, max-height 0.4s ease-in-out, margin-bottom 0.4s ease-in-out;
    cursor: pointer;
}

.mobile-hub-prompt:not(.hidden) {
    transform: translateY(0);
    opacity: 1;
    max-height: 100px; /* Animate height to reveal the element */
    margin-bottom: 0.5rem; /* Add the required space back when visible */
}

.mobile-hub-prompt:hover {
    filter: brightness(1.1);
}

#mobile-account-hub.open {
    transform: translateY(0);
}

.mobile-hub-nav-link {
    width: auto; /* Let the slide size itself based on content */
    padding: 0.9rem 1rem;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    position: relative;
    transition: color 0.2s ease;
    border: none;
    background: none;
    cursor: pointer;
    flex-shrink: 0; /* Prevent slides from shrinking */
}

.mobile-hub-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.mobile-hub-nav-link.active {
    color: var(--text-primary);
}

.mobile-hub-nav-link.active::after {
    transform: scaleX(1);
}

.mobile-hub-nav-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#mobile-hub-main .profile-hub-pane {
    padding: 0.5rem 0; /* Adjust padding for mobile */
}

#mobile-hub-main .swiper-slide.profile-hub-pane {
    display: block; /* Override the default 'display: none' for use in Swiper */
}

#mobile-hub-main .pane-title {
    font-size: 1.75rem; /* Slightly smaller for mobile */
    margin-bottom: 1.5rem;
}

#mobile-hub-main {
    overscroll-behavior: contain; /* Prevents scroll chaining from the panel's content */
}

/* =================================================================
 == PRELOADER STYLES
 =================================================================
*/
#preloader.loaded {
    opacity: 0;
    visibility: hidden;
}

/* =================================================================
 == MOBILE POPUP SPACING FIX
 =================================================================
*/
@media (max-width: 767px) {
    /* Add vertical margin to our main popup content cards on mobile */
    .auth-modal-content,
    .pricing-modal-content,
    .collection-edit-content,
    .confirm-modal-content,
    .collection-popup-content {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
}

/* Make sure settings sections are well-spaced on mobile */
#mobile-hub-main .settings-section {
    padding: 1.5rem 0;
}
/* =================================================================
 == SUBSCRIPTION PANE STYLES
 =================================================================
*/
.subscription-section {
    margin-top: 2rem;
}

.subscription-section .section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.subscription-card {
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    /* justify-content: space-between; */
    align-items: center;
}

.sub-card-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    transition: text-decoration 0.2s ease;
}

.sub-card-link:hover {
    text-decoration: underline;
}

.subscription-card > .sub-card-link {
    margin-left: auto;
    padding-left: 1.5rem;
}#mobile-hub-main .profile-hub-pane {
    padding: 0.5rem 0; /* Adjust padding for mobile */
}
/* =================================================================
 == HELP CENTER PANE STYLES
 =================================================================
*/
.help-search-wrapper {
    position: relative;
    margin-top: 2rem;
}

.help-search-icon {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: var(--text-secondary);
    width: 20px;
    height: 20px;
}

#help-search-input {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem 0.75rem 3rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
}
#help-search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.faq-section, .contact-section {
    margin-top: 2.5rem;
}

.faq-accordion {
    border-top: 1px solid var(--border);
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1.25rem 0.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    background: none;
    border: none;
    cursor: pointer;
}
.faq-question:hover {
    color: var(--accent);
}

.faq-chevron {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}
.faq-question.active .faq-chevron {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
    color: var(--text-secondary);
    padding: 0 0.5rem;
}
.faq-answer p {
    padding-bottom: 1.25rem;
    line-height: 1.6;
}

.contact-card {
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* =================================================================
 == ABOUT US PANE STYLES
 =================================================================
*/
.about-section {
    margin-top: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}
.about-section:last-of-type {
    border-bottom: none;
}

.about-section .section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.about-card {
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.creator-bio {
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.social-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-icon-link:hover {
    color: var(--text-primary);
    background-color: var(--hover-bg-subtle);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.tech-stack-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tech-pill {
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.founders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.founder-card-advanced {
    background: linear-gradient(145deg, var(--bg-main), #2a2a2a);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s ease;
}

.founder-card-advanced:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: var(--accent);
}

.founder-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.founder-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.founder-name {
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
}

.founder-donation {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.donation-amount {
    font-weight: 600;
    color: #22c55e; /* Green for the amount */
}

.donation-amount.private {
    color: var(--text-secondary);
    font-style: italic;
    font-weight: 400;
}

.founder-message {
    font-style: italic;
    color: var(--text-secondary);
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.founder-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--hover-bg-subtle);
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    margin-top: auto; /* Pushes button to the bottom */
    transition: all 0.2s ease;
}

.founder-social-link:hover {
    background-color: var(--accent);
    color: white;
}
#mobile-nav-content .coming-soon {
    opacity: 0.5;
    cursor: not-allowed;
}

#mobile-nav-content .coming-soon:hover {
    background-color: transparent; /* Override the default hover */
}

.dev-note-mobile-section {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    margin: 0.75rem 0;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dev-note-mobile-section::before,
.dev-note-mobile-section::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: var(--border);
}
/* =================================================================
 == UPGRADED AUTH MODAL STYLES (ADDITIONS)
 =================================================================
*/
.error-message {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    min-height: 1.2rem; /* Prevents layout shift */
}

.auth-form .input-group input.invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 1px var(--danger);
}

.auth-form .input-group input.invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.4);
}

#password-strength-meter {
    display: flex;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    background-color: var(--bg-main);
    margin-top: 0.375rem;
}

.strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-weak { background-color: #ef4444; } /* Red */
.strength-medium { background-color: #f59e0b; } /* Amber */
.strength-strong { background-color: #22c55e; } /* Green */

#auth-submit-btn:disabled {
    cursor: not-allowed;
    background-color: var(--accent-hover);
}

.auth-loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: rotation 0.8s linear infinite;
}

.about-mission-text {
    line-height: 1.6;
}
/* =================================================================
 == AVATAR CROPPER STYLES (NEW)
 =================================================================
*/
.cropper-img-container {
    width: 100%;
    height: 350px; /* Or any fixed height you prefer */
    background-color: var(--bg-main);
}

/* Cropper.js needs this to hide the original image */
#image-to-crop {
    display: block;
    max-width: 100%;
}

.cropper-view-box,
.cropper-face {
    border-radius: 50%; /* This makes the crop area a circle */
}
/* =================================================================
 == ACCOUNT SETTINGS STATUS (NEW)
 =================================================================
*/
.status-text-connected {
    color: #22c55e; /* A standard green color */
    font-weight: 600;
    font-size: 0.875rem;
}
/* =================================================================
 == GORGEOUS CONNECTED ACCOUNTS STYLES (NEW & IMPROVED)
 =================================================================
*/
.connected-account-item-new {
    position: relative; /* Needed for the glow effect */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem; /* Increased padding */
    background-color: var(--bg-content); /* Darker, distinct background */
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    transition: background-color 0.2s ease;
    overflow: hidden; /* Hide the parts of the glow that are outside the border */
}

/* The glowing border pseudo-element */
.connected-account-item-new::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    padding: 1px; /* The thickness of the border */
    background: conic-gradient(from 180deg at 50% 50%, rgba(59, 130, 246, 0.5) 0deg, rgba(59, 130, 246, 0) 360deg);
    -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;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Add this new animation definition to your CSS file */
@keyframes rotateGlow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Update the existing hover rule to use the animation */
.connected-account-item-new:hover::before {
    opacity: 1;
    animation: rotateGlow 4s linear infinite;
}

.connection-state {
    position: absolute;
    top: 50%; /* Center vertically */
    right: 1.25rem; /* Match the new padding */
    transform: translateY(-50%) translateY(8px); /* Adjust for vertical centering */
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.connection-state.is-active {
    opacity: 1;
    transform: translateY(-50%);
    pointer-events: auto;
}

#disconnect-google-btn:hover {
    background-color: rgba(239, 68, 68, 0.1); /* --danger with opacity */
    color: var(--danger);
    border-color: var(--danger);
}
/* Styles for the new "Edit" button in the collection view */
#collection-edit-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}
#collection-edit-btn.is-active {
    background-color: var(--accent);
    color: white;
}

/* Styles for when Delete Mode is active */
#collection-view-main.delete-mode-active .masonry-card-wrapper {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

#collection-view-main.delete-mode-active .masonry-card-wrapper:hover {
    opacity: 1;
}

/* The 'X' delete button on each card (Majestic & Matching) */
.card-delete-btn {
    position: absolute;
    top: 0.75rem; /* Slightly adjust position for better visual balance */
    right: 0.75rem; /* Slightly adjust position */
    z-index: 10;
    width: 36px; /* Make it a bit larger */
    height: 36px; /* Make it a bit larger */
    background-color: var(--bg-content); /* Match your content background */
    color: var(--danger); /* Use your danger color for the X icon */
    border-radius: 50%;
    border: none; /* Remove border, rely on shadow for depth */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); /* Add a subtle shadow for depth */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform: scale(0);
    opacity: 0; /* Start invisible for a smoother fade-in */
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease-out, background-color 0.2s ease; /* Smoother animation */
}

.card-delete-btn:hover {
    background-color: var(--accent); /* Hover effect matching your accent color */
    color: white; /* White X on hover */
}

#collection-view-main.delete-mode-active .card-delete-btn {
    transform: scale(1);
    opacity: 1; /* Fade in */
}

/* Hide the normal hover actions when in delete mode */
#collection-view-main.delete-mode-active .card-overlay-button,
#collection-view-main.delete-mode-active .card-actions-container {
    display: none;
}

/* =================================================================
 == ADSTERRA BANNER AD STYLES
 =================================================================
*/
.ad-card {
    /* Hide by default by removing its height and bottom margin */
    max-height: 0;
    margin-bottom: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, margin-bottom 0.5s ease-in-out;

    /* These styles are kept for when the ad becomes visible */
    break-inside: avoid;
    border-radius: 0.5rem;
    background-color: #2a2a2a;
    border: 1px dashed var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: auto;
}

/* This is the magic rule: It reveals the ad card ONLY if it's not empty */
.ad-card:not(:empty) {
    max-height: 500px; /* A value larger than any possible ad height */
    margin-bottom: 0.5rem; /* Restore the original margin */
}

/* New: Styles specific to banner ads to handle their fixed size */
.ad-card-banner {
    max-width: 100%; /* Ensures ad is responsive on small screens */
    box-sizing: content-box; /* Important for masonry layout with fixed sizes */
}

/* New: Styles for native ads to give them a default shape if empty */
.ad-card-native {
    min-height: 250px;
    width: 100%;
}
/* =================================================================
 == OPTION 3: REFINED INFORMATIONAL ROW
 =================================================================
*/
.connected-account-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.disconnect-link {
    background: none;
    border: none;
    padding: 0;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
}

.disconnect-link:hover {
    color: var(--danger);
    text-decoration: underline;
}

/* Badge style (if not already present and styled) */
.connected-badge {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}


/* =================================================================
 == FOOTER & LEGAL PAGES
 =================================================================
*/
.site-footer {
    width: 100%;
    padding: 2rem 1rem;
    background-color: transparent;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
}

.footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}
.footer-nav a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.privacy-content-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.privacy-content-container h1,
.privacy-content-container h2,
.privacy-content-container h3 {
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-family: 'Montserrat', sans-serif;
}
.privacy-content-container h1 { font-size: 2.5rem; }
.privacy-content-container h2 { font-size: 1.75rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.privacy-content-container h3 { font-size: 1.25rem; }
.privacy-content-container ul { padding-left: 1.5rem; }
.privacy-content-container li { margin-bottom: 0.5rem; }
.privacy-content-container a { color: var(--accent); }
.privacy-content-container strong { color: var(--text-primary); }

@media (max-width: 767px) {
    .privacy-content-container {
        padding: 2.5rem 1rem; /* Reduced horizontal padding for mobile */
    }
    .privacy-content-container h1 {
        font-size: 2rem; /* Smaller main title on mobile */
    }
    .privacy-content-container h2 {
        font-size: 1.5rem; /* Smaller section titles on mobile */
    }
}

/* =================================================================
 == ADBLOCK MODAL STYLES
 =================================================================
*/
#adblock-modal {
    display: flex !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    user-select: none;
    -webkit-user-select: none;
}

#adblock-modal.open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

#adblock-modal .confirm-modal-content {
    border: 1px solid var(--danger);
    box-shadow: 0 10px 30px -5px rgba(239, 68, 68, 0.2);
}

.adblock-icon-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.adblock-icon-bg {
    position: absolute;
    inset: 0;
    background: conic-gradient(from 180deg at 50% 50%, var(--danger) 0deg, rgba(239, 68, 68, 0.3) 360deg);
    border-radius: 50%;
    animation: rotateGlow 4s linear infinite;
}

.adblock-icon {
    width: 40px;
    height: 40px;
    color: white;
    position: relative;
    z-index: 2;
    background-color: var(--danger);
    padding: 10px;
    border-radius: 50%;
}


/* Style for the 'saved' checkmark icon on gallery cards */
.popup-icon-button [data-lucide="check"] {
    color: #22c55e; /* Green */
}

.popup-icon-button [data-lucide="check"] {
    color: #22c55e; /* Green */
}