/**
 * Nexvia Digital Studio — 3D Balmumu Mühürlü Aşk Mektubu & Story Akışı
 * Lux Dark Theme, Rose Gold Accents & 3D CSS Animation Engine
 */

.blk-love-letter-wrap {
    position: relative;
    width: 100%;
    min-height: 680px;
    margin: 40px 0;
    padding: 20px 10px;
    background: radial-gradient(circle at center, #161a26 0%, #0c0e14 100%);
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    color: #f1f5f9;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

/* ==========================================================================
   1. ZARF SAHNESİ (ENVELOPE STAGE)
   ========================================================================== */
.letter-stage-envelope {
    position: relative;
    width: 100%;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.envelope-ambient-glow {
    position: absolute;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(225, 29, 72, 0.15) 0%, rgba(212, 175, 55, 0.08) 50%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
}

/* 3D Zarf Konteyneri */
.envelope-container {
    position: relative;
    width: 380px;
    max-width: 90vw;
    height: 250px;
    perspective: 1200px;
    z-index: 2;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.envelope-container:hover {
    transform: translateY(-6px) scale(1.02);
}

/* Zarf Arka Duvarı */
.envelope-back {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1b202e 0%, #11141d 100%);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

/* Zarf İçindeki Gizli Mektup Kartı (Insert) */
.envelope-letter-insert {
    position: absolute;
    width: 330px;
    max-width: 82vw;
    height: 210px;
    background: #fdfbf7;
    border-radius: 12px;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #1e293b;
    transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.insert-seal-mini {
    color: #e11d48;
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.insert-to {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #881337;
    letter-spacing: 0.05em;
}

.insert-preview-line {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
    margin-top: 10px;
}

/* Zarf Ön Cepleri (CSS Geometrisi) */
.envelope-pocket-left {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 125px 0 125px 190px;
    border-color: transparent transparent transparent #151822;
    z-index: 3;
    pointer-events: none;
}

.envelope-pocket-right {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 125px 190px 125px 0;
    border-color: transparent #151822 transparent transparent;
    z-index: 3;
    pointer-events: none;
}

.envelope-pocket-bottom {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 190px 145px 190px;
    border-color: transparent transparent #191e2b transparent;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    z-index: 4;
    pointer-events: none;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2);
}

/* Katlanan Üst Kapak (Flap) */
.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 145px 190px 0 190px;
    border-color: #212636 transparent transparent transparent;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    transform-origin: top center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), z-index 0.2s 0.2s;
    z-index: 5;
}

/* Balmumu Mühür (Wax Seal) */
.wax-seal-btn {
    position: absolute;
    top: -155px;
    left: -28px;
    width: 56px;
    height: 56px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    outline: none;
    pointer-events: auto;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wax-seal-btn:hover {
    transform: scale(1.12);
}

.wax-seal-outer {
    display: block;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 35% 35%, #e11d48, #9f1239, #4c0519);
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.4), inset 0 -3px 6px rgba(0, 0, 0, 0.7);
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.wax-seal-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1.5px dashed rgba(253, 224, 71, 0.6);
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4));
}

.wax-seal-monogram {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #fef08a;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Zarf Açılış Animasyon State'i */
.envelope-container.is-open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 1;
}

.envelope-container.is-open .envelope-letter-insert {
    transform: translate(-50%, -120px);
    z-index: 6;
}

/* Zarf Altı Yönerge */
.envelope-instruction {
    margin-top: 35px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.25);
    padding: 10px 22px;
    border-radius: 30px;
    color: #cbd5e1;
    font-size: 0.92rem;
    backdrop-filter: blur(10px);
    animation: pulseNotice 2.5s infinite;
}

.envelope-instruction .instruction-icon {
    color: #d4af37;
    animation: floatUpDown 1.6s infinite alternate ease-in-out;
}

@keyframes pulseNotice {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(212, 175, 55, 0); }
}

@keyframes floatUpDown {
    0% { transform: translateY(-2px); }
    100% { transform: translateY(3px); }
}

/* ==========================================================================
   2. AÇILMIŞ MEKTUP & STORY AKIŞI (STORY STAGE)
   ========================================================================== */
.letter-stage-story {
    position: relative;
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    animation: fadeInStory 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.letter-stage-story.is-hidden {
    display: none !important;
}

@keyframes fadeInStory {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Üst Bar */
.story-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(18, 21, 30, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    margin-bottom: 16px;
}

.story-badge {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fda4af;
    display: flex;
    align-items: center;
    gap: 6px;
}

.story-sender {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-left: 10px;
}

.story-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-story-audio,
.btn-story-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.25);
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-story-audio:hover,
.btn-story-close:hover {
    background: rgba(212, 175, 55, 0.2);
    color: #d4af37;
    transform: scale(1.08);
}

.btn-story-audio.is-playing {
    color: #d4af37;
    border-color: #d4af37;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.35);
}

/* Slayt Görünüm Alanı (Viewport) */
.story-slides-viewport {
    position: relative;
    width: 100%;
    min-height: 520px;
    background: #fdfbf7;
    border-radius: 20px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
    color: #1e293b;
    overflow: hidden;
    touch-action: pan-y;
}

.story-slides-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.story-slide {
    position: absolute;
    inset: 0;
    padding: 35px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px);
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow-y: auto;
}

.story-slide.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Slayt Kart İçerikleri */
.slide-card-inner {
    width: 100%;
    margin: auto 0;
}

.slide-eyebrow,
.slide-tag {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9f1239;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.slide-title {
    font-size: 1.85rem;
    line-height: 1.3;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 16px;
}

.slide-divider {
    color: #e11d48;
    font-size: 1.1rem;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.slide-divider::before,
.slide-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.slide-subtitle {
    font-size: 1.1rem;
    color: #475569;
}

.slide-scroll-hint {
    margin-top: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #94a3b8;
    animation: floatUpDown 1.4s infinite alternate ease-in-out;
}

/* Mektup Gövdesi */
.letter-quote-mark {
    color: #cbd5e1;
    font-size: 2.2rem;
    margin-bottom: -10px;
}

.letter-rich-body {
    font-size: 1.08rem;
    line-height: 1.8;
    color: #334155;
    margin-bottom: 24px;
}

.letter-signoff {
    margin-top: 20px;
    border-top: 1px dashed #e2e8f0;
    padding-top: 16px;
    display: flex;
    flex-direction: column;
}

.signoff-sub {
    font-size: 0.88rem;
    color: #64748b;
    font-style: italic;
}

.signoff-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #881337;
    margin-top: 4px;
}

/* Sende Sevdiğim Şeyler Izgarası */
.reasons-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.reason-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.reason-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #fff1f2;
    color: #e11d48;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.reason-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
}

.reason-desc {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #64748b;
}

/* Hikayemiz & Hayallerimiz */
.story-rich-text,
.dreams-rich-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #334155;
    background: #fff;
    padding: 18px;
    border-radius: 14px;
    border: 1px solid #f1f5f9;
}

.dreams-badge-box {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fdf2f8;
    color: #9d174d;
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 0.92rem;
    font-weight: 600;
}

/* Polaroid Galeri */
.polaroid-gallery {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 12px 4px;
    scroll-snap-type: x mandatory;
}

.polaroid-frame {
    flex: 0 0 220px;
    background: #fff;
    padding: 10px 10px 24px 10px;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    scroll-snap-align: center;
    transform: rotate(-1.5deg);
    transition: transform 0.3s ease;
}

.polaroid-frame:nth-child(even) {
    transform: rotate(1.5deg);
}

.polaroid-frame:hover {
    transform: scale(1.04) rotate(0deg);
}

.polaroid-frame img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
}

.polaroid-caption {
    margin-top: 10px;
    text-align: center;
    font-size: 0.82rem;
    font-family: 'Cinzel', serif;
    color: #475569;
}

/* Alt Gezinme Barı */
.story-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding: 0 10px;
}

.story-nav-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: #f1f5f9;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.story-nav-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    color: #d4af37;
    transform: scale(1.08);
}

.story-dots {
    display: flex;
    gap: 8px;
}

.story-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.story-dot.active {
    width: 22px;
    border-radius: 10px;
    background: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* Temalar */
.theme-romantic-rose {
    background: radial-gradient(circle at center, #26161d 0%, #11090d 100%);
    border-color: rgba(225, 29, 72, 0.25);
}
.theme-vintage-cream {
    background: radial-gradient(circle at center, #23211c 0%, #100f0c 100%);
    border-color: rgba(245, 158, 11, 0.25);
}
