.modern-gallery-page {
    --gallery-accent: #8b5cf6;
    --gallery-accent-2: #22d3ee;
    display: grid;
    gap: 22px;
}

.modern-gallery-page .gallery-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 210px;
    padding: clamp(24px, 4vw, 44px);
    background:
        radial-gradient(circle at 85% 20%, rgba(34, 211, 238, .24), transparent 32%),
        radial-gradient(circle at 15% 90%, rgba(139, 92, 246, .32), transparent 38%),
        linear-gradient(135deg, #0b1022 0%, #17213c 55%, #101827 100%);
}

.modern-gallery-page .gallery-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    opacity: .17;
    background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to left, #000, transparent 78%);
}

.gallery-hero-copy { max-width: 720px; }
.gallery-hero-copy h1 { font-size: clamp(2rem, 5vw, 3.6rem); letter-spacing: -.04em; }
.gallery-hero-copy p { max-width: 620px; color: #b8c3d8; font-size: 1.04rem; }

.gallery-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.gallery-stat {
    display: grid;
    min-width: 106px;
    padding: 11px 14px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 15px;
    background: rgba(6, 12, 27, .55);
    backdrop-filter: blur(12px);
}

.gallery-stat strong { color: #fff; font-size: 1.25rem; }
.gallery-stat small { color: #9aa9c2; }

.gallery-album-nav {
    display: flex;
    gap: 12px;
    margin: 0;
    padding: 4px 2px 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

.gallery-album-nav > a {
    flex: 0 0 min(250px, 76vw);
    min-height: 82px;
    scroll-snap-align: start;
    background: linear-gradient(145deg, rgba(19,30,54,.94), rgba(10,18,34,.94));
}

.gallery-album-nav > a.active {
    border-color: color-mix(in srgb, var(--gallery-accent) 75%, white);
    box-shadow: 0 12px 36px rgba(76, 29, 149, .22);
}

.gallery-management {
    margin: 0;
    padding: 4px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(139,92,246,.22), rgba(34,211,238,.10), transparent 70%);
}

.gallery-management .profile-modern-card {
    box-shadow: none;
    background: rgba(9, 16, 31, .94);
}

.gallery-drop {
    min-height: 190px;
    transition: border-color .2s, background .2s, transform .2s;
}

.gallery-drop:hover,
.gallery-drop.is-dragging {
    transform: translateY(-2px);
    border-color: var(--gallery-accent-2) !important;
    background: rgba(34, 211, 238, .08);
}

.gallery-file-summary {
    margin: 0;
    color: #a7f3d0;
    font-size: .9rem;
}

.selected-album-head {
    margin: 0;
    padding: 22px 24px;
    border: 1px solid rgba(148,163,184,.16);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(30,41,59,.86), rgba(15,23,42,.72));
}

.modern-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 20px;
}

.gallery-tile {
    position: relative;
    background: linear-gradient(155deg, rgba(24,34,55,.98), rgba(8,15,29,.98));
    border-radius: 24px;
}

.gallery-image-link { overflow: hidden; background: #070c17; }
.gallery-tile img {
    aspect-ratio: 4 / 3;
    transition: transform .4s ease, filter .4s ease;
}
.gallery-tile:hover img { transform: scale(1.035); filter: saturate(1.08); }
.gallery-tile-body { padding: 16px 17px 18px !important; }
.gallery-tile-body > strong { font-size: 1.03rem; }

.gallery-visibility-badge {
    position: absolute;
    right: 10px;
    top: 10px;
    padding: 5px 9px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    background: rgba(5,10,20,.8);
    color: #dbeafe;
    font-size: .7rem;
    backdrop-filter: blur(10px);
}

.gallery-lightbox {
    width: min(1100px, calc(100% - 24px));
    max-height: calc(100vh - 24px);
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 26px;
    background: #080e1b;
    color: #fff;
    box-shadow: 0 30px 100px rgba(0,0,0,.65);
}
.gallery-lightbox::backdrop { background: rgba(2,6,23,.88); backdrop-filter: blur(8px); }
.gallery-lightbox-media { display: grid; place-items: center; min-height: 55vh; background: #030712; }
.gallery-lightbox-media img { width: 100%; max-height: 75vh; object-fit: contain; }
.gallery-lightbox-footer { display: flex; justify-content: space-between; gap: 18px; padding: 16px 18px; }
.gallery-lightbox-copy { display: grid; gap: 3px; min-width: 0; }
.gallery-lightbox-copy small { color: #94a3b8; }
.gallery-lightbox-close {
    align-self: center;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 14px;
    background: rgba(255,255,255,.08);
    color: #fff;
    cursor: pointer;
}

@media (max-width: 700px) {
    .modern-gallery-page { gap: 16px; }
    .modern-gallery-page .gallery-hero { min-height: 0; }
    .gallery-hero .button-row { margin-top: 8px; }
    .gallery-stat { min-width: 88px; }
    .modern-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
    .gallery-tile { border-radius: 17px; }
    .gallery-tile-body { padding: 11px !important; }
    .gallery-lightbox-footer { align-items: center; }
}

@media (max-width: 430px) {
    .modern-gallery-grid { grid-template-columns: 1fr; }
}
