﻿:root {
    --ivory: #FFFDF9;
    --blush: #F9ECEC;
    --champagne: #F3E5D8;
    --gold: #D4AF37;
    --gold-soft: #C5A059;
    --ink: #7A5C28;
    --font-script: "Great Vibes", "Brush Script MT", cursive;
    --font-serif: "Cormorant Garamond", "Playfair Display", Georgia, serif;
    --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    height: 100dvh;
    overflow: hidden;
    background: var(--champagne);
    color: var(--ink);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
    color: inherit;
    border: 0;
    background: none;
    padding: 0;
    cursor: pointer;
}

button:focus-visible {
    outline: 2px solid var(--gold-soft);
    outline-offset: 2px;
}

/* Fotoğraf: kesinlikle basıklaşmadan tam ekran, yavaş Ken Burns hareketi */
.couple-photo {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: var(--champagne) url("../images/couple-bg.jpg") center 35% / cover no-repeat;
    object-fit: cover;
    object-position: center 35%;
    animation: kenBurns 18s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes kenBurns {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.07);
    }
}

/* Üst/alt okunabilirlik için sıcak krem/şampanya vinyet */
.photo-vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(255, 250, 244, 0.82) 0%,
        rgba(255, 250, 244, 0.05) 36%,
        rgba(255, 250, 244, 0.05) 62%,
        rgba(255, 248, 238, 0.92) 100%
    );
}

/* Altın ve sedef beyazı parıltı tanecikleri */
.sparkle-layer {
    position: fixed;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    bottom: -20px;
    width: var(--s-size, 4px);
    height: var(--s-size, 4px);
    border-radius: 50%;
    background: var(--s-color, var(--gold));
    box-shadow: 0 0 6px 1px var(--s-color, var(--gold));
    opacity: 0;
    animation: sparkle-rise var(--rise-duration, 9s) linear var(--rise-delay, 0s) infinite,
        sparkle-twinkle var(--twinkle-duration, 2.2s) ease-in-out var(--rise-delay, 0s) infinite;
}

@keyframes sparkle-rise {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(var(--rise-drift, 20px), -115vh, 0);
    }
}

@keyframes sparkle-twinkle {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

/* Üst başlık: çizilen kalp + gelin & damat ismi */
.invite-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding-top: calc(env(safe-area-inset-top, 0px) + 72px);
    pointer-events: none;
}

.heart-draw {
    width: 46px;
    height: 42px;
    overflow: visible;
    animation: heart-glow 2.4s ease-in-out 1.8s infinite;
}

.heart-path {
    fill: none;
    stroke: var(--gold-soft);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 320;
    stroke-dashoffset: 320;
    animation: heart-draw 1.6s ease forwards 0.3s;
}

@keyframes heart-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes heart-glow {
    0%, 100% {
        filter: drop-shadow(0 0 2px rgba(197, 160, 89, 0.35));
    }
    50% {
        filter: drop-shadow(0 0 9px rgba(212, 175, 55, 0.85));
    }
}

.couple-names {
    margin: 2px 0 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 90vw;
    font-family: var(--font-script);
    font-size: clamp(2.1rem, 9vw, 3.1rem);
    line-height: 1.15;
    color: var(--gold-soft);
    text-shadow: 0 1px 2px rgba(122, 92, 40, 0.25);
}

.couple-names span {
    display: inline-block;
    opacity: 0;
    letter-spacing: 0.35em;
    transform: translateY(6px);
    background: linear-gradient(100deg, var(--gold-soft) 35%, #fff 50%, var(--gold-soft) 65%);
    background-size: 300% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: name-in 0.6s ease 2.1s forwards, name-shimmer 3.5s ease-in-out 2.7s infinite;
}

@keyframes name-in {
    to {
        opacity: 1;
        letter-spacing: normal;
        transform: none;
    }
}

@keyframes name-shimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

.marrying-tag {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
    opacity: 0;
    animation: welcome 1.2s ease 2.9s forwards;
}

.tag-line {
    width: 26px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-soft));
}

.marrying-tag .tag-line:last-child {
    background: linear-gradient(90deg, var(--gold-soft), transparent);
}

.tag-text {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    color: var(--ink);
}

@keyframes welcome {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* Yüzen cam bar */
.upload-bar {
    position: fixed;
    z-index: 2;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 32px);
    max-width: 440px;
    margin: 0;
    padding: 10px;
    border-radius: 28px;
    background: rgba(255, 253, 249, 0.85);
    border: 1px solid rgba(197, 160, 89, 0.5);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 35px rgba(150, 115, 75, 0.18);
    transform: translateX(-50%);
    animation: bar-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 1.6s both;
    transition: min-height 0.4s ease;
}

@keyframes bar-in {
    from {
        opacity: 0;
        transform: translate(-50%, 24px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.bar-invite {
    display: none;
    margin: 4px 10px 10px;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.98rem;
    line-height: 1.4;
    text-align: center;
    color: var(--ink);
}

.upload-bar[data-state="idle"] .bar-invite {
    display: block;
}

.bar-view {
    display: none;
}

.upload-bar[data-state="idle"] .view-idle,
.upload-bar[data-state="selected"] .view-selected,
.upload-bar[data-state="thanks"] .view-thanks {
    display: flex;
}

.upload-bar[data-state="uploading"] .view-uploading {
    display: flex;
}

/* Seç butonu, parlayan altın ışık geçişi */
.pick-btn {
    position: relative;
    width: 100%;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--gold), var(--gold-soft));
    color: var(--ivory);
    font-size: 0.98rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    box-shadow: 0 6px 18px rgba(197, 160, 89, 0.35);
    transition: transform 0.15s ease;
}

.pick-btn::after,
.share-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 50%;
    height: 100%;
    background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    animation: btn-shimmer 3.2s ease-in-out infinite;
}

@keyframes btn-shimmer {
    0% {
        left: -60%;
    }
    45%, 100% {
        left: 130%;
    }
}

.pick-btn svg {
    width: 20px;
    height: 20px;
    color: var(--ivory);
}

.pick-btn:active {
    transform: scale(0.98);
}

/* Yukarı doğru genişleyen önizleme şeridi */
.bar-expand {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.upload-bar[data-state="selected"] .bar-expand {
    grid-template-rows: 1fr;
    opacity: 1;
}

.bar-expand-inner {
    min-height: 0;
    overflow: hidden;
}

.thumb-strip {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 4px 4px 12px;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.thumb-strip::-webkit-scrollbar {
    display: none;
}

.thumb {
    position: relative;
    flex: 0 0 68px;
    height: 68px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--champagne);
    border: 1px solid rgba(255, 255, 255, 0.9);
    scroll-snap-align: start;
}

.thumb img,
.thumb video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-play {
    position: absolute;
    left: 6px;
    bottom: 6px;
    width: 18px;
    height: 18px;
    padding: 4px;
    border-radius: 50%;
    background: rgba(255, 253, 249, 0.85);
    color: var(--gold-soft);
}

.thumb-remove {
    position: absolute;
    top: 0;
    right: 0;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
}

.thumb-remove span {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 253, 249, 0.9);
    color: var(--ink);
}

.thumb-remove svg {
    width: 10px;
    height: 10px;
}

.thumb-add {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--gold-soft);
    background: var(--blush);
}

.thumb-add svg {
    width: 22px;
    height: 22px;
}

/* Gönder butonu */
.share-btn {
    position: relative;
    width: 100%;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--gold), var(--gold-soft));
    color: var(--ivory);
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    box-shadow: 0 6px 18px rgba(197, 160, 89, 0.35);
    transition: transform 0.15s ease, opacity 0.2s ease;
}

.share-btn:active {
    transform: scale(0.98);
}

.share-btn:disabled {
    opacity: 0.5;
    box-shadow: none;
    cursor: not-allowed;
}

.bar-error {
    margin: 0;
    padding: 2px 10px 10px;
    font-size: 0.78rem;
    line-height: 1.4;
    text-align: center;
    color: #A8575C;
}

/* Gönderim ilerlemesi: altın dönen halka */
.bar-progress {
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 12px;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1rem;
}

.gold-ring {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 3px solid rgba(197, 160, 89, 0.25);
    border-top-color: var(--gold-soft);
    animation: ring-spin 0.9s linear infinite;
}

@keyframes ring-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Teşekkür */
.bar-thanks {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 12px;
    animation: thanks-in 0.5s ease both;
}

.thanks-heart {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    color: var(--gold-soft);
}

.thanks-text {
    margin: 0;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.3;
    text-align: center;
}

.new-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 999px;
    background: var(--blush);
    color: var(--gold-soft);
    border: 1px solid rgba(197, 160, 89, 0.5);
    font-size: 0.85rem;
    font-weight: 500;
}

.new-btn svg {
    width: 16px;
    height: 16px;
}

@keyframes thanks-in {
    from {
        opacity: 0;
        transform: scale(0.97);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* Konfeti: süzülen altın/beyaz kalp ve yapraklar */
.celebration-layer {
    position: fixed;
    inset: 0;
    z-index: 4;
    overflow: hidden;
    pointer-events: none;
}

.celebration-particle {
    position: absolute;
    top: -40px;
    width: var(--p-size, 12px);
    height: var(--p-size, 12px);
    color: var(--p-color, #fff);
    filter: drop-shadow(0 1px 3px rgba(197, 160, 89, 0.45));
    animation: drift-down var(--fall-duration, 5s) ease-in var(--fall-delay, 0s) both;
}

.celebration-petal {
    background: var(--p-color, #fff);
    border-radius: 0 100% 0 100%;
}

.celebration-heart svg {
    display: block;
    width: 100%;
    height: 100%;
}

@keyframes drift-down {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) rotate(0deg);
    }
    10% {
        opacity: 0.95;
    }
    50% {
        transform: translate3d(var(--fall-drift, 40px), 55vh, 0) rotate(calc(var(--fall-rotate, 180deg) / 2));
    }
    85% {
        opacity: 0.9;
    }
    100% {
        opacity: 0;
        transform: translate3d(calc(var(--fall-drift, 40px) * -0.4), 112vh, 0) rotate(var(--fall-rotate, 180deg));
    }
}

@media (prefers-reduced-motion: reduce) {
    .couple-photo {
        animation-duration: 0.01s;
    }

    .heart-path,
    .heart-draw,
    .couple-names span {
        animation-duration: 0.01s;
    }

    .upload-bar {
        animation-duration: 0.01s;
        animation-delay: 1.5s;
    }

    .bar-expand,
    .bar-thanks {
        transition: none;
        animation: none;
    }

    .celebration-layer,
    .sparkle-layer {
        display: none;
    }
}
