/* ============================================================
   Zone2 — app.css
   /assets/css/app.css
   Koyu/Açık tema: [data-theme="dark"] / [data-theme="light"]
   ============================================================ */

/* ── Tema değişkenleri ────────────────────────────────────── */
:root {
    --bg:           #080c12;
    --surface:      #0d1119;
    --surface-alt:  #121820;
    --border:       rgba(255,255,255,.08);
    --border-s:     rgba(255,255,255,.14);
    --text:         #f0f4f8;
    --text-sub:     rgba(240,244,248,.5);
    --text-muted:   rgba(240,244,248,.28);

    --accent:       #ff6a00;
    --accent-glow:  rgba(255,106,0,.18);
    --health:       #e84040;
    --health-glow:  rgba(232,64,64,.15);
    --score:        #f5c518;
    --score-glow:   rgba(245,197,24,.14);
    --green:        #00cc6a;
    --green-glow:   rgba(0,204,106,.14);
    --cyan:         #00b8d4;

    --card-bg:      rgba(255,255,255,.035);
    --nav-bg:       rgba(8,12,18,.97);

    --radius-sm:    10px;
    --radius-md:    14px;
    --radius-lg:    20px;
    --radius-xl:    24px;
}

[data-theme="light"] {
    --bg:           #f0f2f5;
    --surface:      #fafbfc;
    --surface-alt:  #ffffff;
    --border:       rgba(0,0,0,.07);
    --border-s:     rgba(0,0,0,.13);
    --text:         #0f1923;
    --text-sub:     rgba(15,25,35,.5);
    --text-muted:   rgba(15,25,35,.65);

    --accent:       #e85a00;
    --accent-glow:  rgba(232,90,0,.12);
    --health:       #c0392b;
    --health-glow:  rgba(192,57,43,.1);
    --score:        #b8860b;
    --score-glow:   rgba(184,134,11,.1);
    --green:        #1a9e52;
    --green-glow:   rgba(26,158,82,.1);
    --cyan:         #0077a8;

    --card-bg:      rgba(255,255,255,.8);
    --nav-bg:       rgba(240,242,245,.97);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Barlow', sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── App kapsayıcı (mobil merkez) ─────────────────────────── */
#app {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

/* ── Tipografi yardımcıları ───────────────────────────────── */
.f-bebas  { font-family: 'Bebas Neue', cursive; }
.f-bc     { font-family: 'Barlow Condensed', sans-serif; }

/* ── Ekran kapsayıcı ──────────────────────────────────────── */
.screen {
    padding: 52px 20px 100px;
    min-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }

/* ── Ambient arka plan ışıkları ───────────────────────────── */
.ambient-1, .ambient-2 {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(60px);
}
.ambient-1 {
    top: -80px; right: -80px;
    width: 280px; height: 280px;
    background: var(--accent-glow);
}
.ambient-2 {
    bottom: 100px; left: -60px;
    width: 220px; height: 220px;
    background: var(--score-glow);
}

/* İçerik z-index */
#app > .screen, #app > .screens-wrap { position: relative; z-index: 1; }

/* ── Tema toggle ──────────────────────────────────────────── */
#theme-toggle {
    position: fixed;
    top: 12px; right: 16px;
    z-index: 200;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 12px;
    color: var(--text-sub);
    font-size: 16px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ── FAB ──────────────────────────────────────────────────── */
#fab {
    position: fixed;
    bottom: 95px;
    right: max(16px, calc(50% - 215px + 16px));
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    font-size: 22px;
    cursor: pointer;
    z-index: 99;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 22px var(--accent-glow), 0 4px 16px rgba(0,0,0,.35);
    transition: transform .15s;
}
#fab:active { transform: scale(.88); }

/* ── Tab Bar ──────────────────────────────────────────────── */
#tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 430px;
    background: var(--nav-bg);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    padding: 8px 0 18px;
}
.tab-bar-inner {
    display: flex;
    justify-content: space-around;
}
.tab-btn {
    background: none; border: none; cursor: pointer;
    padding: 6px 10px;
    display: flex; flex-direction: column;
    align-items: center; gap: 3px;
    /*opacity: .3;*/
    transition: opacity .2s;
}
.tab-btn.active { opacity: 1; }
.tab-btn .tab-icon { font-size: 18px; }
.tab-btn .tab-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 14px; font-weight: 600; letter-spacing: .5px;
    color: var(--text-muted);
    transition: color .2s;
}
.tab-btn.active .tab-label { color: var(--accent); }
.tab-dot {
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--accent);
    display: none;
}
.tab-btn.active .tab-dot { display: block; }

/* ── Section başlık ───────────────────────────────────────── */
.screen-title {
    font-family: 'Bebas Neue', cursive;
    font-size: 38px;
    letter-spacing: 1px;
    color: var(--text);
    margin-bottom: 22px;
}
.screen-title span { color: var(--accent); }

/* ── Animasyonlar ─────────────────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(100%); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes heartBeat {
    0%,100% { transform: scale(1); }
    14%     { transform: scale(1.2); }
    28%     { transform: scale(1); }
    42%     { transform: scale(1.12); }
    70%     { transform: scale(1); }
}
@keyframes fireWiggle {
    0%,100% { transform: rotate(-5deg) scale(1); }
    50%     { transform: rotate(5deg) scale(1.08); }
}
@keyframes celebrate {
    0%  { opacity: 0; transform: translate(-50%,-50%) scale(.6); }
    60% {              transform: translate(-50%,-50%) scale(1.04); }
    100%{ opacity: 1;  transform: translate(-50%,-50%) scale(1); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes ekgDraw {
    from { stroke-dasharray: 0 400; }
    to   { stroke-dasharray: 400 0; }
}

.anim-fade-up { animation: fadeUp .3s ease both; }

/* ── Splash ───────────────────────────────────────────────── */
#splash {
    position: fixed; inset: 0;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    transition: opacity .4s;
}
#splash.hide { opacity: 0; pointer-events: none; }
#splash svg { animation: spin 1s linear infinite; }

/* ── Kutlama modal ────────────────────────────────────────── */
#celebration-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.8);
    z-index: 498;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

#celebration-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 499;
    animation: slideUp 0.4s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
    width: 90%; max-width: 320px;
}

#celebration-modal .celeb-inner {
    background: var(--surface);
    border: 1px solid rgba(255,106,0,.45);
    border-radius: var(--radius-xl);
    padding: 36px 28px;
    text-align: center;
    box-shadow: 0 0 80px var(--accent-glow);
}

/* ── Konfeti canvas ───────────────────────────────────────── */
#confetti-canvas {
    position: fixed; inset: 0;
    z-index: 500; pointer-events: none;
}

/* ── Range input global ────────────────────────────────────── */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%; height: 6px;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}
input[type="range"]::-moz-range-thumb {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
}

/* ── Textarea & Input ─────────────────────────────────────── */
textarea, input[type="text"], input[type="email"] {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    outline: none;
    padding: 12px 14px;
    width: 100%;
    resize: none;
    transition: border-color .2s;
}
textarea:focus, input[type="text"]:focus, input[type="email"]:focus {
    border-color: var(--accent);
}
::placeholder { color: var(--text-muted); }

/* ── PWA Install Butonu ───────────────────────────────────── */
.pwa-install-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 260px;
    padding: 11px 20px;
    border-radius: var(--radius-md);
    background: rgba(255,106,0,.08);
    border: 1px dashed rgba(255,106,0,.4);
    color: var(--accent);
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .5px;
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .15s, box-shadow .2s;
    position: relative;
    overflow: hidden;
}

.pwa-install-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,106,0,.06) 50%, transparent 100%);
    transform: translateX(-100%);
    animation: pwaShimmer 2.8s ease-in-out infinite;
}

@keyframes pwaShimmer {
    0%   { transform: translateX(-100%); }
    60%  { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}

.pwa-install-btn:hover {
    background: rgba(255,106,0,.14);
    border-color: rgba(255,106,0,.7);
    border-style: solid;
    box-shadow: 0 0 18px rgba(255,106,0,.18);
    transform: translateY(-1px);
}

.pwa-install-btn:active {
    transform: scale(.97);
}

.pwa-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-btn-text {
    flex: 1;
    text-align: left;
}

.pwa-btn-badge {
    font-size: 9px;
    letter-spacing: 1px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(0,204,106,.15);
    border: 1px solid rgba(0,204,106,.3);
    color: var(--green);
    flex-shrink: 0;
}

/* ── iOS PWA Banner ───────────────────────────────────────── */
#ios-pwa-banner {
    width: 100%;
    max-width: 300px;
    transition: opacity .3s, transform .3s;
}

.ios-pwa-inner {
    position: relative;
    background: var(--surface);
    border: 1px solid rgba(255,106,0,.25);
    border-radius: var(--radius-lg);
    padding: 18px 18px 16px;
    text-align: center;
}

.ios-pwa-close {
    position: absolute;
    top: 8px; right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color .2s, background .2s;
}
.ios-pwa-close:hover { color: var(--text); background: var(--card-bg); }

.ios-pwa-icon { font-size: 28px; margin-bottom: 6px; }

.ios-pwa-title {
    font-family: 'Bebas Neue', cursive;
    font-size: 20px;
    letter-spacing: 1px;
    color: var(--text);
    margin-bottom: 14px;
}

.ios-pwa-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.ios-pwa-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--text-sub);
    line-height: 1.5;
}

.ios-step-num {
    flex-shrink: 0;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: rgba(255,106,0,.15);
    border: 1px solid rgba(255,106,0,.3);
    color: var(--accent);
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    margin-top: 1px;
}

.ios-pwa-step strong { color: var(--text); }

.ios-pwa-desc {
    font-size: 14px;
    color: var(--text-sub);
    line-height: 1.6;
}
.ios-pwa-desc strong { color: var(--text); }