/* /home/siisi/vertex/gallery_app/static/css/gallery.css */

/* =========================================
   gallery.css - Core styles for all gallery pages
   ========================================= */

/* ---------- 2. Horizontal scroll (public gallery) ---------- */
:root {
    --gallery-min: 280px;
    --gallery-prefer: 36vw;
    --gallery-max: 640px;
}

.horizontal-scroll-wrapper {
    position: relative;
    overflow: visible !important;
    width: 100%;
}

.horizontal-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 1.5rem;
    padding: 10px 5px 25px 5px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f0f2f5;
    scroll-snap-type: x mandatory;
}

.horizontal-grid .gallery-col {
    flex: 0 0 auto;
    width: clamp(var(--gallery-min), var(--gallery-prefer), var(--gallery-max));
    height: auto;
    scroll-snap-align: center;
}

/* Scroll buttons */
.scroll-btn {
    position: absolute;
    z-index: 3;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.9;
    color: #4a5568;
    font-size: 1rem;
}

.scroll-btn:hover {
    background: #f8f9fa;
    transform: translateY(-50%) scale(1.05);
}

.scroll-left {
    left: -15px;
}

.scroll-right {
    right: -15px;
}

.scroll-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ---------- 3. Vertical layout (profile / archived) - square thumbnails ---------- */
.vertical-grid {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.vertical-grid .col {
    display: flex;
}

.vertical-grid .gallery-card {
    width: 100%;
}

.vertical-grid .image-wrapper {
    aspect-ratio: 1 / 1;
    min-height: auto;
}

/* Show full image without cropping (but keep square container) */
.vertical-grid .image-wrapper img,
.vertical-grid .image-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ---------- 6. Accordion styling (public gallery) - restored ---------- */
.accordion-gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    color: white;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.accordion-gradient-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.accordion-gradient-bg:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

.accordion__header--icon::before {
    margin-right: 10px;
    font-size: 1.2rem;
}

.accordion__header--text {
    font-weight: 600;
    font-size: 1rem;
    position: relative;
    z-index: 2;
}

.accordion__header--indicator {
    margin-left: auto;
    position: relative;
    z-index: 2;
}

/* =========================================
   Dark mode overrides
   ========================================= */



[data-bs-theme="dark"] .scroll-btn {
    background: var(--bs-secondary-bg, #2d2d2d);
    border-color: var(--bs-border-color, rgba(255, 255, 255, 0.15));
    color: var(--bs-body-color, #e2e8f0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .scroll-btn:hover {
    background: var(--bs-tertiary-bg, #3a3a3a);
}

/* ---------- Public media grid: internal scroll ----------
   The grid scrolls inside its own window, so the stories bar, search and
   explorer sections above/below always stay reachable no matter how deep
   the visitor has scrolled (infinite scroll extends the inner container). */
#public-media-grid {
    display: block;
    max-height: calc(100dvh - 240px);
    min-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: #43DC80 rgba(0, 0, 0, 0.05);
}

#public-media-grid::-webkit-scrollbar { width: 6px; }
#public-media-grid::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.05); border-radius: 10px; }
#public-media-grid::-webkit-scrollbar-thumb { background: #43DC80; border-radius: 10px; border: 2px solid rgba(0, 0, 0, 0.03); }

@media (max-width: 768px) {
    #public-media-grid {
        max-height: calc(100dvh - 170px);
    }
}


/* ---------- Swipe FAB: gradient + bubbles, same family as the
   accordion headers ---------- */
.swipe-fab {
    position: fixed;
    right: 1.1rem;
    bottom: 5.5rem;
    z-index: 1040;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: .75rem 1.15rem;
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(102, 126, 234, .5);
    overflow: hidden;
    transition: transform .2s ease;
}
.swipe-fab::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
}
.swipe-fab:hover {
    color: #fff;
    transform: translateY(-2px);
}
.swipe-fab i, .swipe-fab span { position: relative; z-index: 1; }

/* ---------- Dark mode: softer card borders + scroll track in the
   media grids (bright borders felt harsh on dark backgrounds) ---------- */
[data-theme-version="dark"] #public-media-grid .gallery-card,
[data-bs-theme="dark"] #public-media-grid .gallery-card,
[data-theme-version="dark"] #profile-media-grid .gallery-card,
[data-bs-theme="dark"] #profile-media-grid .gallery-card {
    border-color: rgba(255, 255, 255, 0.07) !important;
}

[data-theme-version="dark"] #public-media-grid,
[data-bs-theme="dark"] #public-media-grid,
[data-theme-version="dark"] #profile-media-grid,
[data-bs-theme="dark"] #profile-media-grid {
    scrollbar-color: #43DC80 rgba(255, 255, 255, 0.06);
}

[data-theme-version="dark"] #public-media-grid::-webkit-scrollbar-track,
[data-bs-theme="dark"] #public-media-grid::-webkit-scrollbar-track,
[data-theme-version="dark"] #profile-media-grid::-webkit-scrollbar-track,
[data-bs-theme="dark"] #profile-media-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
}
