/**
 * Mektup Merkezi - Ana Stil Dosyası
 * Dosya: public/css/style.css
 */

/* ==========================================================================
   1. GENEL AYARLAR & SCROLLBAR
   ========================================================================== */
[x-cloak] { 
    display: none !important; 
}

html {
    scroll-behavior: smooth;
}

/* Modern Minimal Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #faf8f5;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   2. GERÇEKÇİ KAĞIT DOKULARI (PAPER TEXTURES)
   ========================================================================== */

/* Çizgili Klasik Defter Kağıdı */
.paper-lines {
    background-color: #ffffff;
    background-image: repeating-linear-gradient(transparent, transparent 31px, #e2e8f0 31px, #e2e8f0 32px);
    line-height: 32px;
}

/* Vintage Samur Kraft Kağıt Dokusu */
.paper-kraft {
    background-color: #f4ebe1;
    background-image: radial-gradient(#e5d9c0 1px, transparent 1px);
    background-size: 16px 16px;
    border-color: #dfcfbd;
}

/* Fildişi Parşömen Dokusu */
.paper-parchment {
    background: radial-gradient(circle at 50% 50%, #fdfbf7 0%, #f6edd9 100%);
    border-color: #e8ddc9;
}

/* Romantik Gül Pembesi Kağıt */
.paper-romantic {
    background: #fff5f5;
    background-image: radial-gradient(#fecdd3 0.8px, transparent 0.8px);
    background-size: 20px 20px;
    border-color: #fecdd3;
}

/* ==========================================================================
   3. GERÇEKÇİ BALMUMU MÜHÜR & DAMGA (WAX SEAL)
   ========================================================================== */
.wax-seal {
    position: relative;
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.45), 
        inset 0 -2px 5px rgba(0, 0, 0, 0.35), 
        0 6px 14px rgba(159, 18, 57, 0.4);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wax-seal:hover {
    transform: scale(1.08) rotate(-3deg);
}

.wax-seal-gold {
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.5), 
        inset 0 -2px 5px rgba(0, 0, 0, 0.4), 
        0 6px 14px rgba(180, 83, 9, 0.4);
}

/* ==========================================================================
   4. POLAROID FOTOĞRAF KARTI EFEKTİ
   ========================================================================== */
.polaroid-card {
    background: #ffffff;
    box-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.1), 0 2px 6px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.polaroid-card:hover {
    transform: translateY(-4px) rotate(0deg) scale(1.03);
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   5. ANİMASYONLAR VE GÖRSEL MİKRO ETKİLEŞİMLER
   ========================================================================== */
@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

.animate-float {
    animation: floatSlow 5s ease-in-out infinite;
}

/* Vurgu Işıltısı (Glow) */
.glow-brand {
    box-shadow: 0 0 35px -5px rgba(225, 29, 72, 0.35);
}

.glow-amber {
    box-shadow: 0 0 35px -5px rgba(217, 119, 6, 0.35);
}

/* ==========================================================================
   6. ULTRA MOBİL & DOKUNMATİK ERGONOMİSİ
   ========================================================================== */

/* Dokunmatik gecikmesini kaldır ve mobil tıklama vurgusunu şeffaflaştır */
* {
    -webkit-tap-highlight-color: transparent;
}

button, a, input, select, textarea, label {
    touch-action: manipulation;
}

/* iOS Safari form odaklanmalarında otomatik yakınlaşmayı (auto-zoom) engelle */
@media screen and (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* iPhone çentik ve alt kontrol çubuğu (Safe Area) desteği */
.safe-area-bottom {
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

.safe-area-top {
    padding-top: env(safe-area-inset-top, 0px);
}

/* Yatay kaydırılabilir buton barları için gizli kaydırma çubuğu */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Yumuşak dokunmatik ivmeli kaydırma */
.touch-scroll {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Mobil Alt Gezinti Çubuğu Gölgesi */
.mobile-nav-shadow {
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08), 0 -1px 3px rgba(0, 0, 0, 0.04);
}


/* ---------- Mektup kağıdı editörü (mektup-yaz 2. adım) ---------- */
.mm-letter-body { white-space: pre-wrap; word-break: break-word; }
.mm-letter-body b { font-weight: 700; }
.mm-letter-body u { text-decoration: underline; }
.mm-letter-body div { min-height: 1em; }

.mm-paper {
    position: relative; margin: 0 auto; max-width: 720px; min-height: 720px;
    padding: 56px 52px 64px; border-radius: 3px; color: #2b2521;
    box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 12px 30px -18px rgba(60,40,20,.5);
    transition: background .25s;
}
.mm-paper::before { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(90,60,30,.12); border-radius: 2px; pointer-events: none; }
.mm-paper.paper-lines { background-image: repeating-linear-gradient(transparent 0 35px, #d6e4f3 35px 36px); background-position: 0 54px; line-height: 36px; }
.mm-paper .mm-holes { position: absolute; left: 22px; top: 56px; width: 10px; height: 10px; border-radius: 50%; background: rgba(0,0,0,.08);
    box-shadow: 0 70px 0 rgba(0,0,0,.08), 0 140px 0 rgba(0,0,0,.08), 0 210px 0 rgba(0,0,0,.08), 0 280px 0 rgba(0,0,0,.08), 0 350px 0 rgba(0,0,0,.08), 0 420px 0 rgba(0,0,0,.08), 0 490px 0 rgba(0,0,0,.08); }
.mm-paper .mm-date { position: absolute; right: 52px; top: 26px; font-size: 13px; opacity: .6; font-family: "Plus Jakarta Sans", sans-serif; }
.mm-paper[data-font="caveat"] { font-family: "Caveat", cursive; font-size: 24px; line-height: 36px; }
.mm-paper[data-font="sacramento"] { font-family: "Sacramento", cursive; font-size: 27px; line-height: 36px; }
.mm-paper[data-font="serif"] { font-family: "Playfair Display", Georgia, serif; font-size: 17px; line-height: 36px; }
.mm-paper .mm-title { font-weight: 600; min-height: 36px; outline: none; }
.mm-paper .mm-title:empty::before { content: attr(data-placeholder); opacity: .35; }
.mm-paper .mm-body { outline: none; min-height: 380px; white-space: pre-wrap; word-break: break-word; }
.mm-paper .mm-body:empty::before { content: attr(data-placeholder); opacity: .35; }
.mm-paper .mm-body b { font-weight: 700; } .mm-paper .mm-body u { text-decoration: underline; }
.mm-pagemark { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(90,60,30,.35); pointer-events: none; }
.mm-pagemark span { position: absolute; right: 16px; top: -9px; font: 800 10px "Plus Jakarta Sans", sans-serif; letter-spacing: .08em; text-transform: uppercase; color: rgba(90,60,30,.7); background: #fff; padding: 2px 6px; border-radius: 4px; }
.mm-tools button[aria-pressed="true"] { background: #f6ead9; border-color: #b4782f; color: #7a4a1f; }
.mm-ink { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.mm-ink[aria-pressed="true"] { box-shadow: 0 0 0 2px #7a4a1f; }
.mm-swatch { width: 28px; height: 28px; border-radius: 9px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); cursor: pointer; }
.mm-swatch[aria-pressed="true"] { border-color: #7a4a1f; transform: scale(1.08); }
.mm-envelope { width: 112px; height: 72px; border-radius: 6px; position: relative; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); flex-shrink: 0; transition: background .25s; }
.mm-envelope::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom right, transparent 49%, rgba(0,0,0,.12) 50%, transparent 51%), linear-gradient(to bottom left, transparent 49%, rgba(0,0,0,.12) 50%, transparent 51%); background-size: 50% 50%; background-repeat: no-repeat; background-position: top left, top right; }
.mm-envelope .mm-seal { position: absolute; left: 50%; top: 40%; width: 22px; height: 22px; border-radius: 50%; transform: translate(-50%,-50%); box-shadow: inset 0 2px 4px rgba(255,255,255,.3), 0 2px 4px rgba(0,0,0,.3); }
/* Seçenek kartları (Zarf Rengi / Kağıt Rengi / Yazı Stili): üstte etiket + renk noktası, altta tam genişlik açılır liste */
.mm-opt { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 16px; background: #fff; border: 1px solid #e7e5e4; cursor: pointer; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.mm-opt:hover { border-color: #d6cfc7; }
.mm-opt:focus-within { border-color: #b4782f; box-shadow: 0 0 0 3px rgba(180,120,47,.15); }
.mm-opt-label { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #78716c; display: flex; align-items: center; gap: 6px; }
.mm-opt-label i { color: #7a4a1f; font-size: 11px; width: 14px; text-align: center; }
.mm-opt-dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); margin-left: auto; order: -1; align-self: flex-end; position: absolute; right: 14px; top: 12px; }
.mm-opt { position: relative; }
.mm-dot-kraft { background: #f4ebe1; } .mm-dot-parchment { background: #fbf7ee; } .mm-dot-romantic { background: #fff5f5; }
.mm-dot-lined { background: #fff; background-image: repeating-linear-gradient(transparent 0 4px, #cfe0f3 4px 5px); }
.mm-opt-select { width: 100%; min-width: 0; font-size: 15px; font-weight: 700; color: #1c1917; background: #fafaf9 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 12px center; border: 1px solid #e7e5e4; border-radius: 12px; padding: 11px 36px 11px 12px; outline: none; appearance: none; -webkit-appearance: none; cursor: pointer; }
.mm-opt-select:focus { border-color: #b4782f; background-color: #fff; }
.mm-opt-fee { font-size: 11px; font-weight: 800; color: #92400e; white-space: nowrap; }

@media (max-width: 640px) {
    .mm-paper { padding: 40px 18px 44px; min-height: 70vh; max-width: none; }
    .mm-paper .mm-body { min-height: 50vh; }
    .mm-paper[data-font="caveat"] { font-size: 26px; }
    .mm-paper[data-font="sacramento"] { font-size: 29px; }
    .mm-paper[data-font="serif"] { font-size: 18px; }
    .mm-paper .mm-holes { display: none; }
    .mm-paper .mm-date { right: 22px; }
}

/* ---------- Mektup Yaz: tür kartları & ana buton ---------- */
.mm-type-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 12px 18px; border-radius: 22px; background: #fff; border: 2px solid #e7e5e4; box-shadow: 0 6px 20px -14px rgba(28,25,23,.35); cursor: pointer; transition: transform .18s, border-color .18s, box-shadow .18s, background .18s; }
.mm-type-card:hover { transform: translateY(-3px); border-color: #d6d3d1; box-shadow: 0 14px 28px -16px rgba(28,25,23,.35); }
.mm-type-card.is-active { border-color: #dc2626; background: #fff5f5; box-shadow: 0 0 0 4px rgba(220,38,38,.12), 0 14px 28px -16px rgba(220,38,38,.35); }
.mm-type-img { width: 100%; max-width: 150px; height: 104px; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0,0,0,.12)); }
.mm-type-label { font-size: 17px; font-weight: 800; color: #1c1917; letter-spacing: -.01em; }
.mm-type-check { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; background: #dc2626; color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(220,38,38,.4); }
.mm-btn-primary { display: inline-flex; align-items: center; gap: 10px; padding: 16px 28px; border-radius: 16px; background: #dc2626; color: #fff; font-weight: 800; font-size: 15px; box-shadow: 0 12px 24px -12px rgba(220,38,38,.7); transition: transform .15s, background .15s, box-shadow .15s; }
.mm-btn-primary:hover { background: #b91c1c; transform: translateY(-1px); box-shadow: 0 16px 28px -12px rgba(220,38,38,.75); }
.mm-btn-primary:active { transform: translateY(0); }
@media (max-width: 640px) { .mm-type-img { height: 84px; } .mm-type-label { font-size: 15px; } .mm-btn-primary { width: 100%; justify-content: center; } }

/* ---------- Özet: gerçekçi zarf (uçak postası kenarlı) & özet kutucukları ---------- */
.mm-env-air { max-width: 680px; margin: 0 auto; padding: 9px; border-radius: 6px;
    background: repeating-linear-gradient(-45deg, #d11f2f 0 14px, #ffffff 14px 21px, #1f4fa8 21px 35px, #ffffff 35px 42px);
    box-shadow: 0 18px 40px -22px rgba(30,20,10,.55), 0 2px 6px rgba(0,0,0,.08); }
.mm-env-inner { position: relative; border-radius: 3px; padding: 16px 18px; min-height: 250px; display: flex; flex-direction: column; justify-content: space-between;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), inset 0 0 40px rgba(0,0,0,.04); transition: background .25s; }
.mm-env-type { font-family: "Courier Prime", "Courier New", monospace; font-size: 12px; line-height: 1.45; color: #1c1917; word-break: break-word; }
.mm-env-stamp { width: 52px; height: 60px; padding: 4px; transform: rotate(3deg); filter: drop-shadow(0 2px 2px rgba(0,0,0,.18));
    background: radial-gradient(circle at 4px 4px, transparent 2.6px, #fff 3px) -4px -4px / 8px 8px; }
.mm-env-stamp-in { width: 100%; height: 100%; background: #fff; border: 1px solid #f1d5d8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #c81e2b; font-size: 20px; }
.mm-env-stamp span { font: 800 9px "Plus Jakarta Sans", sans-serif; letter-spacing: .12em; color: #1c1917; }
.mm-env-barcode { background: #fff; padding: 5px 8px 3px; border-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.mm-env-barcode-real { padding: 4px 4px 0; }
.mm-env-barcode-real svg { display: block; width: 190px; max-width: 46vw; height: auto; }
@media (min-width: 640px) { .mm-env-barcode-real svg { width: 230px; } }
.mm-env-bars { width: 128px; height: 24px; background: repeating-linear-gradient(90deg, #111 0 2px, transparent 2px 3px, #111 3px 4px, transparent 4px 7px, #111 7px 10px, transparent 10px 11px, #111 11px 12px, transparent 12px 15px); }
.mm-sum-tile { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 16px; background: #fff; border: 1px solid #e7e5e4; min-width: 0; }
.mm-sum-k { font-size: 11px; font-weight: 700; color: #a8a29e; }
.mm-sum-v { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: #1c1917; min-width: 0; }
.mm-sum-v > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-sum-dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
@media (min-width: 640px) { .mm-env-inner { padding: 22px 26px; min-height: 300px; } .mm-env-type { font-size: 13.5px; } .mm-env-stamp { width: 60px; height: 70px; } .mm-env-stamp-in { font-size: 24px; } .mm-env-bars { width: 160px; height: 30px; } }

/* Görselli seçim (Zarf Rengi / Kağıt Rengi): her seçenek küçük bir resimle gösterilir */
.mm-pick { padding: 12px 14px 14px; border-radius: 16px; background: #fff; border: 1px solid #e7e5e4; }
.mm-pick-grid { display: grid; gap: 8px; margin-top: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 640px) { .mm-pick-env { grid-template-columns: repeat(6, minmax(0, 1fr)); } .mm-pick-paper { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .mm-pick-paper { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.mm-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; min-height: 44px; padding: 10px 6px 8px; border-radius: 14px; border: 2px solid #e7e5e4; background: #fafaf9; cursor: pointer; text-align: center; transition: border-color .15s, box-shadow .15s, background-color .15s, transform .15s; }
.mm-tile:hover { border-color: #d6b98f; background: #fff; }
.mm-tile:active { transform: scale(.97); }
.mm-tile:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(180,120,47,.35); }
.mm-tile[aria-checked="true"] { border-color: #b4782f; background: #fffaf2; box-shadow: 0 4px 12px rgba(122,74,31,.14); }
.mm-tile-env { width: 100%; max-width: 92px; height: auto; display: block; filter: drop-shadow(0 2px 3px rgba(60,40,20,.14)); }
.mm-tile-paper { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 54px; height: 70px; padding: 0 9px; border-radius: 4px; border: 1px solid rgba(60,40,20,.2); box-shadow: 0 2px 5px rgba(60,40,20,.14); }
.mm-tile-paper span { display: block; height: 2px; border-radius: 2px; background: rgba(60,40,20,.34); }
.mm-tile-paper span:nth-child(2) { width: 85%; } .mm-tile-paper span:nth-child(4) { width: 55%; }
.mm-tile-name { font-size: 12px; font-weight: 800; color: #1c1917; line-height: 1.2; max-width: 100%; overflow-wrap: anywhere; }
.mm-tile-fee { font-size: 10.5px; font-weight: 700; color: #78716c; white-space: nowrap; }
.mm-tile[aria-checked="true"] .mm-tile-fee { color: #92400e; }
.mm-tile-check { position: absolute; top: 5px; right: 6px; font-size: 14px; color: #b4782f; opacity: 0; transition: opacity .15s; }
.mm-tile[aria-checked="true"] .mm-tile-check { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .mm-tile, .mm-tile-check { transition: none; } .mm-tile:active { transform: none; } }
/* Yönetim panelinden yüklenen zarf/kağıt fotoğrafları */
.mm-tile-img { display: block; object-fit: cover; border-radius: 6px; box-shadow: 0 2px 5px rgba(60,40,20,.16); }
.mm-tile-img-env { width: 100%; max-width: 92px; height: auto; aspect-ratio: 10 / 7; }
.mm-tile-img-paper { width: 54px; height: 70px; }
