/* ==========================================================================
   Padellica oyuncu uygulaması kabuğu (_AppLayout). PadelWeb sitesiyle aynı tasarım dili:
   Inter, #1E8FD5 mavi, #0E1820 koyu lacivert, yumuşak mavi parıltılar, cam yüzeyler, hap
   biçimli düğmeler ve Apple tarzı yavaşlayan eğriler. theme.css YÜKLENMEZ (performans):
   bu dosya gereken tüm token'ları tanımlar. Token adları install-banner.css ve network.css
   ile uyumludur. Animasyonlar yalnızca transform/opacity kullanır.
   ========================================================================== */

:root {
    /* Marka */
    --brand: #1e8fd5;
    --brand-hover: #0f6ea9;
    --brand-fill: #0f6ea9; /* beyaz metin taşıyan mavi dolgu: beyazla 5,5:1 (--brand ile 3,5:1) */
    --brand-soft: rgba(30, 143, 213, 0.12);
    --blue-soft: #eaf6fd;
    --sky: #73c5f2;

    /* Koyu lacivert */
    --navy: #0e1820;
    --navy-2: #16232f;
    --navy-text: #b7c5cf;

    /* Yüzeyler ve çizgiler */
    --page-bg: #f3f7fa;
    --surface: #fff;
    --surface-muted: #eef3f7;
    --surface-hover: #f7fafc;
    --border-soft: #e4eaf0;
    --border-control: #d9e2ea;
    --border-control-hover: #c3d0da;
    --border-faint: #eef2f6;
    --info-bg: #eaf6fd;
    --info-line: #cfe6f6;

    /* Metin */
    --text-main: #1d2a36;
    --text-strong: #101820;
    --text-mid: #46555f;
    --text-soft: #61707d;
    --text-faint: #8a99a5;

    /* Vurgu */
    --accent-warning: #f0a93b;
    --accent-success: #1fa96b;
    --accent-success-soft: #edf9f1;
    --accent-heart: #e5484d;

    /* Şekil */
    --radius-card: 22px;
    --radius-xl: 28px;
    --radius-control: 14px;
    --shadow-card: 0 1px 2px rgba(16, 24, 32, 0.04), 0 10px 30px rgba(16, 24, 32, 0.06);
    --shadow-pop: 0 18px 50px rgba(16, 24, 32, 0.14);

    /* Cam */
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-line: rgba(16, 24, 32, 0.07);

    /* Hareket */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-apple: cubic-bezier(0.28, 0.11, 0.32, 1);

    --app-header-height: 56px;
    --app-tabbar-height: 68px;
}

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

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

body.app-body {
    margin: 0;
    background: var(--page-bg);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: transparent;
}

.app-body a {
    color: inherit;
    text-decoration: none;
}

.app-body h1, .app-body h2, .app-body h3 {
    margin: 0;
    color: var(--text-strong);
    font-weight: 800;
}

/* --- Arka plan parıltısı: sabit katman, kaydırınca yavaşça kayar (parallax) --- */
.app-glow {
    position: fixed;
    top: -10vh;
    left: 0;
    right: 0;
    height: 120vh;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(60% 38% at 92% 6%, rgba(30, 143, 213, 0.17), transparent 70%),
        radial-gradient(50% 32% at 0% 30%, rgba(30, 143, 213, 0.09), transparent 70%);
    will-change: transform;
}

/* --- Üst bar: tepede şeffaf, kaydırınca cam --- */
.app-header {
    /* Üst bar sayfayla birlikte kayar: küçük ekranlarda içeriğe yer açar. */
    position: relative;
    z-index: 40;
    padding-top: env(safe-area-inset-top);
    transition: background 0.5s var(--ease-apple), box-shadow 0.5s var(--ease-apple);
    view-transition-name: app-header;
}

.app-header.scrolled {
    background: var(--glass-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 1px 0 var(--glass-line);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .app-header.scrolled {
        background: rgba(255, 255, 255, 0.96);
    }
}

.app-header-inner {
    max-width: 900px;
    margin: 0 auto;
    height: var(--app-header-height);
    padding: 0 18px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}

/* Logo ortada; "Uygulamayı indir" sağ sütunda (yoksa sütun boş kalır, logo yine ortadadır). */
.app-brand img {
    display: block;
    height: 24px;
    width: auto;
}

.app-header-inner .app-install-btn {
    grid-column: 3;
    justify-self: end;
}

/* --- İçerik: yüzen sekme çubuğunun altında kalmasın --- */
.app-main {
    min-height: calc(100vh - var(--app-header-height));
    padding-bottom: calc(var(--app-tabbar-height) + 36px + env(safe-area-inset-bottom));
}

/* --- Yüzen cam sekme çubuğu --- */
.app-tabbar {
    position: fixed;
    z-index: 40;
    left: 50%;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: min(420px, calc(100% - 24px));
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    padding: 6px;
    /* Camsı: arkadaki düğmeler ve içerik seçilebilir kalsın */
    background: rgba(255, 255, 255, 0.5);
    -webkit-backdrop-filter: saturate(200%) blur(24px);
    backdrop-filter: saturate(200%) blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 26px;
    box-shadow: var(--shadow-pop), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    view-transition-name: app-tabbar;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .app-tabbar,
    .lica-pill,
    .fab-request {
        background: rgba(255, 255, 255, 0.97);
    }

    .fab-request {
        background: rgba(255, 255, 255, 0.97);
    }
}

.app-tab {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 9px 4px 8px;
    border-radius: 20px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: color 0.3s var(--ease-apple), transform 0.4s var(--ease);
}

.app-tab:active {
    transform: scale(0.93);
    transition-duration: 0.12s;
}

.app-tab svg {
    position: relative;
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-tab span:not(.app-tab-pill) {
    position: relative;
}

/* Etkin sekmenin arkasındaki hap: sayfa geçişinde tarayıcı konumunu kaydırarak taşır. */
.app-tab-pill {
    position: absolute;
    inset: 3px 12px;
    border-radius: 20px;
    background: var(--brand-soft);
    opacity: 0;
}

.app-tab.active {
    color: var(--brand-hover);
}

.app-tab.active .app-tab-pill {
    opacity: 1;
    view-transition-name: tab-pill;
}

/* --- Sayfa geçişleri (tarayıcı destekliyorsa): çapraz solma + sabit çubuklar --- */
@view-transition {
    navigation: auto;
}

::view-transition-group(root) {
    animation-duration: 0.32s;
    animation-timing-function: var(--ease-apple);
}

::view-transition-group(tab-pill) {
    animation-duration: 0.45s;
    animation-timing-function: var(--ease);
}

/* --- Düğmeler --- */
.btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), background 0.3s ease;
}

.btn-pill:active {
    transform: scale(0.97);
    transition-duration: 0.12s;
}

.btn-pill-primary {
    background: var(--brand-fill);
    color: #fff;
    box-shadow: 0 10px 26px rgba(30, 143, 213, 0.38);
}

.btn-pill-glass {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.16);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

/* --- Ana sayfa kahramanı: koyu lacivert, cam istatistikler, parallax parıltılar --- */
.home-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin: 6px 12px 0;
    padding: 30px 22px 22px;
    border-radius: var(--radius-xl);
    color: #fff;
    background:
        radial-gradient(circle at 92% 8%, rgba(30, 143, 213, 0.32), transparent 40%),
        radial-gradient(circle at 0% 100%, rgba(30, 143, 213, 0.16), transparent 42%),
        var(--navy);
    box-shadow: 0 24px 60px rgba(14, 24, 32, 0.28);
}

.hero-glow {
    position: absolute;
    z-index: -1;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform;
    background: radial-gradient(circle, rgba(30, 143, 213, 0.5), transparent 65%);
    top: -110px;
    right: -90px;
}

.hero-glow-2 {
    top: auto;
    right: auto;
    bottom: -140px;
    left: -100px;
    background: radial-gradient(circle, rgba(115, 197, 242, 0.26), transparent 65%);
}

.hero-inner {
    position: relative;
    will-change: transform, opacity;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--sky);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-eyebrow::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sky);
    box-shadow: 0 0 0 4px rgba(115, 197, 242, 0.18);
}

.home-hero h1 {
    margin: 16px 0 10px;
    color: #fff;
    font-size: clamp(34px, 10.5vw, 46px);
    line-height: 1.02;
    letter-spacing: -0.045em;
}

.home-hero h1 .accent {
    color: var(--sky);
}

.hero-lead {
    margin: 0 0 22px;
    color: var(--navy-text);
    font-size: 16px;
    line-height: 1.45;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 24px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.hero-stat {
    padding: 15px 6px 13px;
    text-align: center;
}

.hero-stat + .hero-stat {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-stat b {
    display: block;
    color: #fff;
    font-size: 27px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.hero-stat span {
    color: var(--navy-text);
    font-size: 12px;
    font-weight: 600;
}

/* --- Bölümler --- */
.app-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 16px 0;
}

.app-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0 2px;
}

.app-section-head h2 {
    font-size: 22px;
    letter-spacing: -0.03em;
}

.app-section-head a {
    color: var(--brand-hover);
    font-size: 14px;
    font-weight: 700;
}

.app-empty {
    padding: 22px 16px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    background: var(--surface);
    color: var(--text-mid);
    text-align: center;
}

.app-empty a {
    color: var(--brand-hover);
    font-weight: 700;
}

/* --- Açılış ve kaydırma animasyonları (JS bayrağı olmadan hiçbir şey gizlenmez) --- */
.js .m {
    opacity: 0;
    translate: 0 26px;
    transition: opacity 0.9s var(--ease), translate 1s var(--ease), transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.js .m.in {
    opacity: 1;
    translate: 0 0;
}

.js .home-hero h1:not(.words) {
    opacity: 0;
    animation: reveal-fallback 0s 1.5s forwards;
}

@keyframes reveal-fallback {
    to { opacity: 1; }
}

.w {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    padding: 0.22em 0.1em 0.18em;
    margin: -0.22em -0.1em -0.18em;
}

.wi {
    display: inline-block;
    transform: translate3d(0, 110%, 0);
    filter: blur(6px);
    transition: transform 1.1s var(--ease), filter 1s var(--ease);
}

.words.in .wi {
    transform: none;
    filter: none;
}

@media (prefers-reduced-motion: no-preference) {
    .hero-eyebrow,
    .hero-lead,
    .hero-actions,
    .hero-stats {
        animation: hero-in 1.2s var(--ease) both;
    }

    .hero-lead { animation-delay: 0.45s; }
    .hero-actions { animation-delay: 0.6s; }
    .hero-stats { animation-delay: 0.75s; }
}

@keyframes hero-in {
    from { opacity: 0; translate: 0 24px; }
    to { opacity: 1; translate: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
    .js .m {
        opacity: 1;
        translate: none;
        transition: none;
    }

    .js .home-hero h1:not(.words) {
        opacity: 1;
        animation: none;
    }

    .hero-glow,
    .app-glow,
    .hero-inner {
        will-change: auto;
    }

    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }
}

/* --- Bildirim (TempData["Notice"]): üstte kısa süre görünen cam hap --- */
.app-toast {
    position: fixed;
    z-index: 60;
    top: calc(env(safe-area-inset-top) + 12px);
    left: 50%;
    max-width: min(420px, calc(100% - 32px));
    padding: 11px 18px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    box-shadow: var(--shadow-pop);
    color: var(--text-strong);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    pointer-events: none;
    transform: translateX(-50%);
    animation: toast-life 4.2s var(--ease) both;
}

.app-toast-error {
    color: var(--accent-heart);
}

@keyframes toast-life {
    0% { opacity: 0; translate: 0 -16px; }
    8%, 85% { opacity: 1; translate: 0 0; }
    100% { opacity: 0; translate: 0 -10px; }
}

/* --- Favori (kalp) düğmesi --- */
.fav-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.4s var(--ease), color 0.25s ease;
}

.fav-btn:focus,
.fav-btn:focus-visible {
    outline: none;
}

.fav-btn svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fav-btn:active {
    transform: scale(0.82);
    transition-duration: 0.1s;
}

/* Favori: yalnızca kalp kırmızı; halka ya da gölge yok */
.fav-btn.on {
    color: var(--accent-heart);
}

.fav-btn.on svg {
    fill: currentColor;
}

/* --- Telefon doğrulama kutusu (_PhoneVerify) uygulama kabuğunda: Bootstrap olmadan --- */
.app-body .otp-box .form-control {
    width: 150px;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--border-control);
    border-radius: var(--radius-control);
    background: var(--surface);
    color: var(--text-strong);
    font: inherit;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.25em;
    text-align: center;
}

.app-body .otp-box .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.app-body .otp-box .btn[disabled] { opacity: 0.5; }
.app-body .otp-box .btn-primary { background: var(--brand-fill); color: #fff; }
.app-body .otp-box .btn-outline-primary { background: var(--blue-soft); color: var(--brand-hover); }
.app-body .otp-box .btn-link { background: transparent; color: var(--brand-hover); padding: 0 8px; }
.app-body .text-danger { color: var(--accent-heart); }
.app-body .text-muted { color: var(--text-soft); }
.app-body .text-navy { color: var(--accent-success); }

/* ==========================================================================
   Keşfet kabuğu: yüzen "Kort talep et" düğmesi ve ortak boşluk ölçeği.
   Ölçek: 4 / 8 / 12 / 16 / 24 / 32. Dokunma hedefleri en az 44px.
   ========================================================================== */
:root {
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --control-height: 48px;
}

.app-main.has-fab {
    padding-bottom: calc(var(--app-tabbar-height) + 80px + env(safe-area-inset-bottom));
}

.fab-request {
    position: fixed;
    z-index: 39;
    left: 16px;
    bottom: calc(var(--app-tabbar-height) + 20px + env(safe-area-inset-bottom));
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 18px 0 14px;
    border-radius: 999px;
    /* Cam: açık, yarı saydam; arkasındaki içerik görünür kalır. Mavi yalnızca metin ve simgede. */
    background: rgba(255, 255, 255, 0.38);
    -webkit-backdrop-filter: saturate(200%) blur(22px);
    backdrop-filter: saturate(200%) blur(22px);
    border: 1px solid rgba(255, 255, 255, 0.75);
    color: var(--brand-hover) !important;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    box-shadow: 0 10px 28px rgba(16, 24, 32, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
    view-transition-name: fab-request;
}

.fab-request:active {
    transform: scale(0.95);
    transition-duration: 0.12s;
}

.fab-request svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
}

/* Sekme çubuğu 4 sekmeyle daha ferah */
.app-tabbar {
    width: min(380px, calc(100% - 24px));
}

.app-tab-pill {
    inset: 3px 8px;
}

/* ".app-body a { color: inherit }" düğmelerin rengini ezmesin */
.app-body .btn-pill-primary {
    color: #fff;
}

/* Açık zeminde ikincil düğme (btn-pill-glass koyu zemin içindir) */
.btn-pill-soft {
    background: var(--brand-soft);
    color: var(--brand-hover);
}

.app-body .btn-pill-soft {
    color: var(--brand-hover);
}

/* LICA bakiyesi: sağ altta, "Maç kur" düğmesiyle aynı hizada */
.lica-pill {
    position: fixed;
    z-index: 39;
    right: 16px;
    bottom: calc(var(--app-tabbar-height) + 20px + env(safe-area-inset-bottom));
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 44px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.38);
    -webkit-backdrop-filter: saturate(200%) blur(22px);
    backdrop-filter: saturate(200%) blur(22px);
    color: var(--text-strong) !important;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 10px 28px rgba(16, 24, 32, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.lica-pill b {
    color: var(--brand-hover);
    font-size: 16px;
    font-weight: 800;
}
