* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background-color);
    background-size: cover;
    color: #fff;
    line-height: 1.6;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    background: var(--background-image) no-repeat center center fixed;
    background-size: cover;
    opacity: var(--background-image-opacity);
    pointer-events: none;
}

.welcome-screen {
    position: relative;
    min-height: 60vh;
}

.welcome-content {
    text-align: center;
    padding: 1.5rem;
    color: #ccc;
}

.welcome-content h2 {
    font-size: 2rem;
    font-weight: 300;
}

.welcome-content > p {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.welcome-stats {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2rem;
}

.header {
    background: var(--header-gradient);
    padding: 0;
    border-bottom: 3px solid var(--primary-color);
    position: relative;
    min-height: 120px;
    box-shadow: 0 4px 30px rgba(74, 158, 255, 0.2);
    display: flex;
    align-items: center;
}

.header .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container.full-width {
    max-width: none;
    padding: 0;
}

h1 {
    text-align: center;
    font-size: 2.4rem;
    margin: 0;
    font-weight: 500;
    color: #fff;
    letter-spacing: 2px;
    position: relative;
    text-shadow: 
        0 0 10px rgba(74, 158, 255, 0.5),
        0 0 20px rgba(74, 158, 255, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
}

.site-logo {
    display: block;
    margin: 1rem auto;
    filter: drop-shadow(0 0 10px rgba(74, 158, 255, 0.3))
            drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
    transition: filter 0.3s ease;
}

.site-logo:hover {
    filter: drop-shadow(0 0 15px rgba(74, 158, 255, 0.5))
            drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
}

.site-subtitle {
    text-align: center;
    font-size: 1.1rem;
    margin: 0.5rem 0 0 0;
    font-weight: 300;
    color: #b8d4ff;
    letter-spacing: 1px;
    font-style: italic;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.home-link {
    text-align: center;
    margin: 1rem 0 1.5rem 0;
}

.home-link a {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    background: rgba(74, 158, 255, 0.1);
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.home-link a:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.3);
}

.stats {
    text-align: center;
    margin: 1rem 0 0 0;
    padding: 0.8rem 1rem;
    background: #1a1a1a;
    border-radius: 6px;
    border: 1px solid #333;
    font-size: 0.9rem;
}

.stats.incomplete {
    background: var(--stats-incomplete-bg);
    border: 1px solid var(--stats-incomplete-border);
    color: var(--stats-incomplete-text);
}

.categories {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.category-dropdown {
    position: relative;
    min-width: 200px;
}

.category-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #333;
    border: 1px solid #555;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    padding-right: 3rem;
}

.category-select:hover,
.category-select:focus {
    background: #007bff;
    border-color: #007bff;
    outline: none;
}

.gallery-info {
    text-align: center;
    margin: 2rem 0;
    color: #ccc;
}

.grid {
    margin: 2rem 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Masonry layout (default) */
.grid:not(.grid-layout) {
    column-count: 5;
    column-gap: 0;
}

/* Grid layout */
.grid.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0;
}

/* Justified layout */
.grid.justified-layout {
    position: relative;
    width: 100%;
}

.grid.justified-layout .item {
    position: absolute;
    border-radius: 4px;
    overflow: hidden;
    margin: 0;
    visibility: hidden; /* Hide until positioned */
}

.grid.justified-layout.positioned .item {
    visibility: visible; /* Show after positioning */
}

.grid.justified-layout .item img {
    display: block;
    border-radius: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid.loaded {
    opacity: 1;
}

.item {
    background: #222;
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    break-inside: avoid;
    margin: 0;
    padding: 0;
    display: block;
    width: 100%;
}

.grid.grid-layout .item {
    aspect-ratio: 4/3;
    break-inside: unset;
}

.grid.grid-layout .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item:hover {
    opacity: 0.9;
}

.item img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
}

/* Thumbnail Caption */
.thumb-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: #fff;
    padding: 1.5rem 0.75rem 0.75rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 400;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(2px);
    line-height: 1.2;
    z-index: 10;
}

.item:hover .thumb-caption {
    opacity: 1;
}

/* Mobile: Always show captions on touch devices */
@media (hover: none) and (pointer: coarse) {
    .thumb-caption {
        opacity: 0.8;
        font-size: 0.7rem;
        padding: 1rem 0.5rem 0.5rem 0.5rem;
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    }
}

.placeholder {
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #333;
    color: #666;
    cursor: pointer;
}

.placeholder:hover {
    background: #444;
    color: #999;
}

.generate-btn {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.generate-btn:hover {
    background: #0056b3;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    opacity: 1;
    transition: opacity 0.3s cubic-bezier(.4,0,.2,1);
}

.modal-content.fade-out {
    opacity: 0;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 1.5rem;
    padding: 1rem 1.2rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    z-index: 1001;
    opacity: 0.7;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.modal-nav:hover {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(15px);
    opacity: 1;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.modal-nav.prev { 
    left: 20px; 
}
.modal-nav.next { 
    right: 20px; 
}

.modal-nav.prev::before {
    content: "‹";
    font-size: 2rem;
    line-height: 1;
}

.modal-nav.next::before {
    content: "›";
    font-size: 2rem;
    line-height: 1;
}

/* Modal Share Button */
.modal-btn.modal-share {
    font-size: 2rem;
    padding: 6px 10px;
    background: none;
    border: none;
    box-shadow: none;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: static;
    z-index: auto;
}

/* Share Notification */
.share-notification {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 128, 0, 0.9);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1002;
    opacity: 1;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.share-notification.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Modal Caption */
.modal-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 300;
    z-index: 999;
    opacity: 0.8;
    transition: opacity 0.3s ease, bottom 0.3s ease-in-out;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 80%;
    text-align: center;
    pointer-events: none;
}

/* Move caption up when filmstrip is visible */
#modal.filmstrip-visible #modal-caption {
    bottom: 160px;
}

.modal-caption.hidden {
    display: none;
}

/* Hover effect - make caption more subtle when hovering over image */
.modal-content:hover + .modal-caption {
    opacity: 0.6;
}

/* Modal Loading Indicator */
#modal-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1002;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(5px);
}

.modal-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: modalSpin 1s linear infinite;
}

@keyframes modalSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .grid:not(.grid-layout) { column-count: 4; }
    .grid.grid-layout { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 900px) {
    .grid:not(.grid-layout) { column-count: 3; }
    .grid.grid-layout { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 600px) {
    .grid:not(.grid-layout) { column-count: 2; }
    .grid.grid-layout { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
    
    .header {
        min-height: 60px;
    }
    
    h1 { 
        font-size: 1.8rem;
        letter-spacing: 0.5px;
        padding-bottom: 0.8rem;
    }
    
    .site-subtitle {
        font-size: 0.95rem;
        margin: 0.3rem 0 0 0;
        letter-spacing: 0.5px;
    }
    
    .home-link {
        margin: 0.8rem 0 0 0;
    }
    
    .home-link a {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    h1::after {
        width: 80px;
    }
    
    .stats {
        margin: 0.5rem;
        padding: 0.6rem;
        font-size: 0.8rem;
    }
    
    .thumb-caption {
        font-size: 0.7rem;
        padding: 1rem 0.5rem 0.5rem 0.5rem;
    }
    
    .modal-btn.modal-fullscreen {
        display: none;
    }
}

@media (max-width: 400px) {
    .grid:not(.grid-layout) { column-count: 1; }
    .grid.grid-layout { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    
    .modal-nav { 
        width: 40px; 
        height: 40px; 
        padding: 0.5rem; 
    }
    .modal-nav.prev { left: 10px; }
    .modal-nav.next { right: 10px; }
    .modal-nav.prev::before,
    .modal-nav.next::before {
        font-size: 1.5rem;
    }
    
    .modal-share {
        top: 15px;
        right: 60px;
        width: 38px;
        height: 38px;
        font-size: 1rem;
        padding: 0.6rem;
    }
    
    .share-notification {
        top: 70px;
        font-size: 0.8rem;
        padding: 0.6rem 1.2rem;
    }
    
    .thumb-caption {
        font-size: 0.65rem;
        padding: 0.8rem 0.4rem 0.4rem 0.4rem;
    }
}

/* Loading Spinner */
.gallery-loading {
    position: relative;
}

.loading-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 200px;
    background: rgba(17, 17, 17, 0.95);
    border: 1px solid #333;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
    backdrop-filter: blur(10px);
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #333;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.loading-text {
    color: #ccc;
    font-size: 1rem;
    text-align: center;
}

/* Category Grid Styles */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
    padding: 0 2rem;
}

.category-card {
    position: relative;
    display: block;
    text-decoration: none;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: #2a2a2a;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

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

.category-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 2rem 1.5rem 1.5rem;
    color: white;
    transition: background 0.3s ease;
}

.category-card:hover .category-overlay {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
}

.category-overlay h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.category-overlay p {
    margin: 0;
    font-size: 0.95rem;
    color: #ccc;
}

.category-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #2a2a2a;
    border: 2px dashed #444;
}

.category-placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.category-placeholder h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: #ccc;
}

.category-placeholder p {
    margin: 0;
    font-size: 0.95rem;
    color: #666;
}

.category-placeholder .no-thumbs {
    margin: 0.5rem 0 0 0;
    font-size: 0.8rem;
    color: #888;
}

/* Breadcrumb Bar Styles */
.breadcrumb-bar {
    background: var(--breadcrumb-bar-bg);
    padding: .5rem;
    border-bottom: 1px solid #222;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    width: 100%;
    font-size: 1.1rem;
    z-index: 10;
}

.breadcrumb {
    margin: 0;
    padding: 0;
    background: none;
    width: auto;
    align-self: unset;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #666;
    margin: 0 0.5rem;
}

.breadcrumb-current {
    color: #ccc;
}

/* Empty Gallery Message */
.empty-gallery {
    text-align: center;
    margin: 4rem 0;
    color: #666;
}

.empty-gallery h2 {
    margin-bottom: 1rem;
}

/* SEO Hidden Links */
.seo-image-links {
    position: absolute;
    left: -9999px;
    top: -9999px;
}

/* Contact Link in Footer */
.contact-link {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-link:hover {
    text-decoration: underline;
}

/* Info Bubble */
.info-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #007bff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1500;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.info-bubble:hover {
    background: #0056b3;
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.4);
}

.info-bubble:before {
    content: "i";
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-style: italic;
}

/* Info Panel */
.info-panel {
    position: fixed;
    bottom: 0;
    right: -400px;
    width: 350px;
    height: 85vh;
    background: #222;
    border: 1px solid #444;
    border-radius: 12px 0 0 0;
    z-index: 1400;
    transition: right 0.3s ease;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.info-panel.open {
    right: 0;
}

.info-panel-header {
    background: #333;
    padding: 1rem;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-panel-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.info-panel-close {
    background: none;
    border: none;
    color: #ccc;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.info-panel-close:hover {
    background: #444;
    color: #fff;
}

.info-panel-content {
    padding: 1.5rem;
    color: #ccc;
    line-height: 1.6;
    height: calc(100% - 70px);
    overflow-y: auto;
}

.info-panel-content p {
    margin: 0 0 1rem 0;
}

.info-panel-content p:last-child {
    margin-bottom: 0;
}

/* Copyright Footer */
.copyright-footer {
    background: #1a1a1a;
    border-top: 1px solid #333;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

.copyright-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: left;
}

.copyright-footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.copyright-footer a:hover {
    color: #66b3ff;
    text-decoration: underline;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .copyright-footer {
        padding: 1.5rem 0;
        margin-top: 3rem;
        font-size: 0.8rem;
    }
    
    .copyright-footer .container {
        padding: 0 1rem;
    }
    .info-bubble {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 20px;
    }
    
    .info-panel {
        width: calc(100vw - 20px);
        right: -100vw;
        left: auto;
        height: 85vh;
        border-radius: 12px 12px 0 0;
    }
    
    .info-panel.open {
        right: 10px;
        left: auto;
    }
}

/* Modal Carousel Animation (Two Images) */
.modal-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  max-width: 90vw;
  max-height: 90vh;
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  margin: auto;
  transition: transform 0.4s cubic-bezier(.4,0,.2,1), opacity 0.4s cubic-bezier(.4,0,.2,1);
  opacity: 1;
  transform: translateX(0);
  z-index: 1;
}
.modal-content.carousel-animate-in {
  opacity: 1;
  z-index: 2;
}
.modal-content.carousel-animate-out {
  opacity: 0;
  z-index: 1;
}
.modal-content.slide-from-right {
  transform: translateX(100vw);
}
.modal-content.slide-from-left {
  transform: translateX(-100vw);
}
.modal-content.slide-to-center {
  transform: translateX(0);
}
.modal-content.slide-to-left {
  transform: translateX(-100vw);
}
.modal-content.slide-to-right {
  transform: translateX(100vw);
}

/* Modal Controls Bar */
.modal-controls {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 12px;
  z-index: 20;
  background: rgba(20, 20, 20, 0.85);
  border-radius: 0 0 0 10px;
  padding: 6px 12px;
  align-items: center;
  pointer-events: auto;
}

.modal-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  border-radius: 6px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  flex-shrink: 0;
}

.modal-btn svg {
  display: block;
  width: 22px;
  height: 22px;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
}

@media (max-width: 600px) {
  .modal-controls {
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    gap: 14px;
  }
  .modal-btn {
    min-width: 36px;
    min-height: 36px;
    font-size: 1.3rem;
    padding: 4px 6px;
  }
  .modal-btn svg {
    width: 22px;
    height: 22px;
  }
}

.modal-btn.modal-close svg {
  transform: translateY(-2px);
}

#modal,
#modal * {
  pointer-events: auto !important;
}

/* Navigation Hint in Modal */
.nav-notification {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 30, 30, 0.9);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 1002;
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  white-space: nowrap;
}

.nav-notification.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Filmstrip Styles */
#filmstrip-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    transform: translateY(100%); /* Start hidden */
    opacity: 0;
    visibility: hidden;
}

/* Only show filmstrip when modal is open */
#modal[style*="display: block"] #filmstrip-container {
    opacity: 1;
    visibility: visible;
}

#filmstrip-container.visible {
    transform: translateY(0);
}

#filmstrip-toggle {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 30px;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid #444;
    border-bottom: none;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

#filmstrip-toggle #toggle-arrow {
    transition: transform 0.3s ease;
}

#filmstrip-container.visible #toggle-arrow {
    transform: rotate(180deg);
}

#filmstrip {
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 0;
    border-top: 1px solid #444;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch; /* for smooth scrolling on iOS */
}

#filmstrip::-webkit-scrollbar {
    height: 8px;
}
 
#filmstrip::-webkit-scrollbar-track {
    background: #2a2a2a;
}
 
#filmstrip::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 4px;
    border: 2px solid #2a2a2a;
}

#filmstrip-inner {
    display: inline-flex;
    padding: 0 10px;
}

.filmstrip-thumb-wrapper {
    flex: 0 0 auto;
    margin: 0 5px;
    height: 80px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}

.filmstrip-thumb-wrapper:hover {
    border-color: #007bff;
    transform: scale(1.05);
}

.filmstrip-thumb-wrapper.active {
    border-color: #007bff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.7);
}

.filmstrip-thumb {
    height: 100%;
    width: auto;
    object-fit: cover;
    display: block;
}