@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@700&family=Nunito+Sans:wght@300;400;500;700&display=swap');

:root {
    --zp-bg: #04130d;
    --zp-deep: #06170e;
    --zp-station: #0e2d1d;
    --zp-gold: #f7c51e;
    --zp-gold-soft: #f3cd66;
    --zp-gold-bright: #ffd342;
    --zp-cream: #f4e4b5;
    --zp-btn-text: #504419;
    --zp-magic: #602f88;
    --zp-ai: #ad781d;
    --zp-shadow: 0 4px 5.9px rgba(0, 0, 0, 0.25);
    --zp-radius: 10px;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body.gallery-page {
    min-height: 100dvh;
    background: var(--zp-bg);
    color: var(--zp-cream);
    font-family: 'Nunito Sans', sans-serif;
    overflow-x: hidden;
}

.gallery {
    position: relative;
    width: 100%;
    max-width: 402px;
    margin: 0 auto;
    min-height: 100dvh;
    padding: 30px 25px 36px;
}

.gallery__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.gallery__bg--desktop {
    display: none;
}

.gallery__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.gallery-header__logo-desktop {
    display: none;
}

.desktop-nav {
    display: none;
}

.gallery-tabs__filters,
.gallery-tabs__actions {
    display: contents;
}

.gallery__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.gallery-header__logo {
    display: block;
    width: 141px;
    height: 43px;
}

.gallery-header__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left center;
}

.gallery-header__actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.gallery-header__gift {
    display: inline-block;
    width: 28px;
    height: 26px;
}

.gallery-header__gift img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 8px 0 10px;
    background: var(--zp-deep);
    border: 0.4px solid var(--zp-gold);
    border-radius: 26px;
    color: var(--zp-cream);
    font-size: 15px;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
}

.lang-btn__arrows {
    width: 8px;
    height: 8px;
}

.lang-btn__globe {
    width: 18px;
    height: 18px;
    object-fit: cover;
}

.gallery-intro {
    text-align: center;
    margin-top: 8px;
}

.gallery-intro__title {
    font-family: 'Baloo 2', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 0.92;
    letter-spacing: -0.6px;
    text-transform: capitalize;
    color: var(--zp-gold-soft);
    text-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}

.gallery-intro__sub {
    margin-top: 12px;
    font-size: 11px;
    line-height: 1.35;
    letter-spacing: -0.22px;
    color: var(--zp-cream);
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-tabs {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.gallery-tab {
    appearance: none;
    border: 0.2px solid var(--zp-gold);
    background: var(--zp-station);
    color: var(--zp-cream);
    height: 28px;
    min-width: 50px;
    padding: 0 10px;
    border-radius: 5px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.gallery-tab img {
    width: 12px;
    height: 12px;
    object-fit: contain;
}

.gallery-tab.is-active {
    background: linear-gradient(180deg, #fed341 0%, #f7c51e 100%);
    border-color: #7c6312;
    color: var(--zp-btn-text);
    box-shadow: inset 0 0 0 1px #bd9511;
}

.gallery-tab--action {
    background: var(--zp-deep);
    border-width: 0.5px;
    color: var(--zp-gold-soft);
    box-shadow: var(--zp-shadow);
    margin-left: auto;
}

.gallery-tab--action + .gallery-tab--action {
    margin-left: 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 8px;
    margin-top: 4px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 109 / 88;
    border: 0.5px solid var(--zp-gold);
    border-radius: var(--zp-radius);
    box-shadow: var(--zp-shadow);
    overflow: hidden;
    background: #0a1a12;
    cursor: pointer;
}

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

.gallery-item__play {
    position: absolute;
    left: 5px;
    bottom: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    display: grid;
    place-items: center;
}

.gallery-item__play::after {
    content: '';
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 7px solid #fff;
    margin-left: 1px;
}

.gallery-item__time {
    position: absolute;
    right: 5px;
    bottom: 5px;
    height: 16px;
    min-width: 36px;
    padding: 0 6px;
    border-radius: 18px;
    background: rgba(20, 20, 20, 0.67);
    backdrop-filter: blur(1px);
    color: #fff;
    font-size: 8px;
    letter-spacing: 0.16px;
    display: grid;
    place-items: center;
}

.gallery-item__magic {
    position: absolute;
    top: 5px;
    right: 5px;
    height: 16px;
    min-width: 46px;
    padding: 0 6px 0 5px;
    border-radius: 18px;
    background: var(--zp-magic);
    color: #fff;
    font-size: 8px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.gallery-item__magic img {
    width: 10px;
    height: 10px;
    object-fit: contain;
}

.gallery-item.is-hidden {
    display: none;
}

.gallery-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.gallery-actions--desktop {
    display: none;
}

.zp-btn {
    appearance: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 41px;
    border-radius: 5px;
    box-shadow: var(--zp-shadow);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.zp-btn:active {
    transform: scale(0.98);
}

.zp-btn img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

.zp-btn--ghost {
    background: var(--zp-deep);
    border: 0.5px solid var(--zp-gold);
    color: var(--zp-gold-soft);
}

.zp-btn--ghost-soft {
    background: var(--zp-station);
    border: 0.5px solid var(--zp-gold);
    color: var(--zp-gold-soft);
}

.zp-btn--gold {
    position: relative;
    background: linear-gradient(143deg, #f7c51e 14%, #ffd445 87%);
    color: var(--zp-btn-text);
    border: 1px solid #967509;
    border-radius: 6px;
    box-shadow: 0 4px 0 #bd9611, var(--zp-shadow);
}

.zp-btn--gold img {
    width: 18px;
    height: 18px;
}

.zp-btn--ai {
    background: var(--zp-ai);
    border: 0.5px solid #f1c11d;
    color: #ffe293;
    border-radius: 6px;
}

.zp-btn--ai img {
    width: 18px;
    height: 18px;
}

.zp-btn__back {
    width: 8px;
    height: 8px;
    border-left: 1.5px solid var(--zp-gold-soft);
    border-bottom: 1.5px solid var(--zp-gold-soft);
    transform: rotate(45deg);
    margin-right: 2px;
}

.gallery-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
}

.gallery-footer__note {
    font-size: 10px;
    font-weight: 300;
    line-height: 1.4;
    letter-spacing: -0.2px;
    color: var(--zp-cream);
    max-width: 171px;
}

.gallery-footer__secure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-top: 4px;
}

.gallery-footer__secure img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.gallery-footer__secure span {
    font-size: 8px;
    color: #fed341;
    letter-spacing: -0.16px;
    white-space: nowrap;
}

/* ===== Video player overlay (Figma 93:92) ===== */
.video-player {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 402px;
    margin: 0 auto;
    min-height: 100dvh;
    background: #04130d;
}

.video-player[hidden] {
    display: none !important;
}

.video-player__dim {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    pointer-events: none;
}

.video-player__top {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 76px 8px 12px;
}

.video-player__chip {
    appearance: none;
    height: 29px;
    min-width: 63px;
    padding: 0 10px;
    border: 0.5px solid var(--zp-gold);
    border-radius: 5px;
    background: transparent;
    box-shadow: var(--zp-shadow);
    color: var(--zp-gold-soft);
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.video-player__chip img {
    width: 10px;
    height: 15px;
    object-fit: contain;
}

.video-player__back-chevron {
    width: 7px;
    height: 7px;
    border-left: 1.5px solid var(--zp-gold-soft);
    border-bottom: 1.5px solid var(--zp-gold-soft);
    transform: rotate(45deg);
}

.video-player__page-title {
    flex: 1;
    text-align: center;
    font-size: 12px;
    color: rgba(244, 228, 181, 0.75);
    pointer-events: none;
}

.video-player__stage {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0 2px;
}

.video-player__video {
    width: 100%;
    flex: 1;
    min-height: 420px;
    max-height: 601px;
    object-fit: cover;
    background: #000;
    box-shadow: var(--zp-shadow);
}

.video-player__play {
    position: absolute;
    left: 50%;
    top: 48%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 3;
    transition: opacity 0.2s ease;
}

.video-player__play.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.video-player__play-icon {
    width: 0;
    height: 0;
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    border-left: 24px solid #fff;
    margin-left: 4px;
}

.video-player__controls {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 18px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-player__scrub {
    position: relative;
    flex: 1;
    height: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
}

.video-player__track {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 29px;
    background: #d9d9d9;
    opacity: 0.38;
}

.video-player__fill {
    position: absolute;
    left: 0;
    height: 4px;
    width: 0%;
    border-radius: 29px;
    background: #fed341;
}

.video-player__knob {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fed341;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 2px rgba(254, 211, 65, 0.25);
}

.video-player__time {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 10px;
    letter-spacing: 0.2px;
    white-space: nowrap;
    min-width: 92px;
    justify-content: flex-end;
}

.video-player__footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 26px 28px;
}

.video-player__note {
    font-size: 10px;
    font-weight: 300;
    line-height: 1.4;
    letter-spacing: -0.2px;
    color: var(--zp-cream);
    max-width: 171px;
}

.video-player__secure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-top: 4px;
}

.video-player__secure img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.video-player__secure span {
    font-size: 8px;
    color: #fed341;
    letter-spacing: -0.16px;
    white-space: nowrap;
}

body.gallery-page.is-player-open {
    overflow: hidden;
}

body.gallery-page.is-player-open .gallery {
    visibility: hidden;
}

body.gallery-page.is-player-open::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 999;
    background: #04130d;
}

@media (min-width: 480px) {
    .gallery {
        margin-top: 24px;
        margin-bottom: 24px;
        border-radius: 16px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
        overflow: hidden;
    }

    .video-player {
        top: 24px;
        bottom: 24px;
        border-radius: 16px;
        overflow: hidden;
    }
}

/* ===== Desktop (Figma 126:1103) ===== */
@media (min-width: 1024px) {
    body.gallery-page {
        background: #02130d;
    }

    .gallery {
        max-width: 1440px;
        min-height: 100dvh;
        margin: 0 auto;
        padding: 36px 120px 64px;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }

    .gallery__bg--mobile {
        display: none;
    }

    .gallery__bg--desktop {
        display: block;
    }

    .gallery__content {
        gap: 0;
    }

    .gallery-header {
        margin-bottom: 85px;
        gap: 24px;
    }

    .gallery-header__logo {
        width: 218px;
        height: 66px;
        flex-shrink: 0;
    }

    .gallery-header__logo-mobile {
        display: none;
    }

    .gallery-header__logo-desktop {
        display: block;
    }

    .desktop-nav {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        flex: 1;
        max-width: 783px;
        height: 42px;
        margin: 0 auto;
        padding: 0 18px;
        background: var(--zp-deep);
        border: 0.4px solid var(--zp-gold);
        border-radius: 53px;
    }

    .desktop-nav__link {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        padding: 0 8px;
        color: var(--zp-cream);
        font-size: 15px;
        font-weight: 400;
        line-height: normal;
        text-transform: uppercase;
        text-decoration: none;
        white-space: nowrap;
        transition: color 0.15s ease;
    }

    .desktop-nav__link:hover {
        color: var(--zp-gold);
    }

    .desktop-nav__link.is-active {
        color: var(--zp-gold);
        font-weight: 700;
    }

    .gallery-header__gift {
        display: none;
    }

    .lang-btn {
        height: 42px;
        min-width: 98px;
        padding: 0 12px 0 14px;
        border-radius: 53px;
        flex-shrink: 0;
    }

    .lang-btn__globe {
        width: 24px;
        height: 24px;
    }

    .gallery-intro {
        display: none;
    }

    .gallery-tabs {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        flex-wrap: nowrap;
        margin-bottom: 37px;
    }

    .gallery-tabs__filters,
    .gallery-tabs__actions {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .gallery-tab {
        height: 52px;
        min-width: 122px;
        padding: 0 18px;
        border-radius: 6px;
        font-size: 14px;
        margin-left: 0;
    }

    .gallery-tab[data-filter="all"] {
        min-width: 122px;
    }

    .gallery-tab[data-filter="photo"] {
        min-width: 125px;
    }

    .gallery-tab[data-filter="video"] {
        min-width: 123px;
    }

    .gallery-tab--action {
        margin-left: 0;
        min-width: 155px;
        height: 52px;
        border-width: 0.5px;
        box-shadow: var(--zp-shadow);
    }

    .gallery-tab--action img {
        width: 22px;
        height: 22px;
    }

    #addNewBtn {
        min-width: 167px;
    }

    #addNewBtn img {
        width: 27px;
        height: 21px;
    }

    .gallery-tab.is-active {
        background: #fed341;
        border: 0.2px solid #7c6312;
        box-shadow: 0 0 0 2px #bd9511;
        color: var(--zp-btn-text);
    }

    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px 22px;
        margin-top: 0;
    }

    .gallery-item {
        aspect-ratio: 283 / 223;
    }

    .gallery-item__play {
        left: 12px;
        bottom: 13px;
        width: 51px;
        height: 50px;
    }

    .gallery-item__play::after {
        border-top-width: 10px;
        border-bottom-width: 10px;
        border-left-width: 16px;
        margin-left: 2px;
    }

    .gallery-item__time {
        right: 12px;
        bottom: 13px;
        height: 40px;
        min-width: 91px;
        padding: 0 12px;
        border-radius: 18px;
        font-size: 14px;
        letter-spacing: 0.28px;
    }

    .gallery-item__magic {
        top: 16px;
        right: 13px;
        height: 35px;
        min-width: 98px;
        padding: 0 12px 0 10px;
        border-radius: 28px;
        font-size: 14px;
        letter-spacing: 0.28px;
        gap: 6px;
    }

    .gallery-item__magic img {
        width: 20px;
        height: 20px;
    }

    .gallery-actions--mobile {
        display: none;
    }

    .gallery-actions--desktop {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        margin-top: 40px;
    }

    .gallery-actions__right {
        display: flex;
        align-items: center;
        gap: 13px;
    }

    .gallery-actions__delete {
        width: 172px;
        height: 47px;
        font-size: 14px;
        gap: 8px;
    }

    .gallery-actions__delete img {
        width: 15px;
        height: 19px;
    }

    .gallery-actions--desktop .zp-btn--gold {
        width: 200px;
        height: 47px;
        font-size: 14px;
        gap: 10px;
        background: linear-gradient(143deg, #f7c51e 14%, #ffd445 87%);
        color: var(--zp-btn-text);
        border: 1px solid #967509;
        border-radius: 6px;
        box-shadow: 0 4px 0 #bd9611, var(--zp-shadow);
    }

    .gallery-actions--desktop .zp-btn--gold img {
        width: 22px;
        height: 22px;
    }

    .gallery-actions--desktop .zp-btn--ghost:not(.gallery-actions__delete) {
        width: 172px;
        height: 47px;
        font-size: 14px;
    }

    .gallery-actions--desktop .zp-btn--ghost:not(.gallery-actions__delete) img {
        width: 12px;
        height: 17px;
    }

    .gallery-footer {
        display: none;
    }

    .video-player {
        max-width: 900px;
        top: 40px;
        bottom: 40px;
        border-radius: 16px;
        overflow: hidden;
    }
}

@media (min-width: 1024px) and (max-width: 1280px) {
    .gallery {
        padding: 28px 48px 48px;
    }

    .desktop-nav {
        max-width: 640px;
    }

    .desktop-nav__link {
        font-size: 13px;
    }

    .gallery-tab {
        min-width: 100px;
        padding: 0 12px;
    }

    .gallery-grid {
        gap: 16px;
    }

    .gallery-actions__delete,
    .gallery-actions--desktop .zp-btn--ghost:not(.gallery-actions__delete) {
        width: 150px;
    }

    .gallery-actions--desktop .zp-btn--gold {
        width: 180px;
    }
}
