/* "Ana ekrana ekle" önerisi (Shared/_InstallBanner). Hem _AppLayout hem kulüp _Layout'unda
   yüklenir; yalnızca theme.css token'larını kullanır. Sekme çubuğu olmayan sayfalarda
   --app-tabbar-height tanımsızdır ve 0'a düşer. */

/* --- "Ana ekrana ekle" önerisi: sekme çubuğunun hemen üstünde --- */
.install-banner {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(var(--app-tabbar-height, 0px) + 24px + env(safe-area-inset-bottom));
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    box-shadow: var(--shadow-pop);
    padding: 10px 12px;
}

.install-banner[hidden] {
    display: none;
}

.install-text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--text-mid);
}

.install-text strong {
    display: block;
    color: var(--text-strong);
}

.install-accept {
    border: 0;
    border-radius: var(--radius-control);
    background: var(--brand-fill);
    color: #fff;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
}

.install-dismiss {
    border: 0;
    background: transparent;
    color: var(--text-soft);
    font-size: 22px;
    line-height: 1;
    padding: 4px 6px;
    cursor: pointer;
}

/* --- Üst çubuktaki "Uygulamayı indir" düğmesi --- */
.app-install-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    background: var(--surface);
    color: var(--brand-hover, var(--brand));
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.app-install-btn[hidden] {
    display: none;
}

/* Dar telefonda ortadaki logo ile çakışmasın: kısa etiket */
.install-btn-short {
    display: none;
}

@media (max-width: 420px) {
    .install-btn-long { display: none; }
    .install-btn-short { display: inline; }
}

.app-install-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Ana ekrana ekleme rehberi (alt panel) --- */
.install-sheet {
    position: fixed;
    inset: 0;
    z-index: 60;
}

.install-sheet[hidden] {
    display: none;
}

.install-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(14, 24, 32, 0.3);
}

.install-sheet-panel {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: calc(var(--app-tabbar-height, 0px) + 16px + env(safe-area-inset-bottom));
    max-width: 380px;
    max-height: 70vh;
    overflow-y: auto;
    margin: 0 auto;
    padding: 18px 18px 16px;
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 12px 40px rgba(14, 24, 32, 0.28);
}

.install-sheet-panel h2 {
    margin: 0 0 4px;
    font-size: 17px;
    letter-spacing: -0.02em;
}

.install-sheet-lead {
    margin: 0 0 12px;
    color: var(--text-soft);
    font-size: 13px;
}

.install-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.install-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text-mid);
    font-size: 14px;
    line-height: 1.4;
}

.install-step-no {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--brand-fill);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 26px;
    text-align: center;
}

.install-sheet-action {
    width: 100%;
    margin-top: 16px;
}

.install-sheet-note {
    margin: 14px 0 0;
    color: var(--text-soft);
    font-size: 13px;
}

/* "Anladım": panelin tek kapatma düğmesi, rehberin altında tam genişlik */
.install-sheet-done {
    width: 100%;
    margin-top: 16px;
}

/* iPhone Safari: alt çubuktaki Paylaş simgesini gösteren ok (sheet altta, ok aşağıya işaret eder) */
.install-arrow {
    display: block;
    width: 28px;
    height: 28px;
    margin: 0 auto 10px;
    color: var(--brand);
    animation: install-arrow-bob 1.2s ease-in-out infinite;
}

.install-arrow[hidden] {
    display: none;
}

.install-arrow svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes install-arrow-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

@media (prefers-reduced-motion: reduce) {
    .install-arrow { animation: none; }
}

/* Paylaş simgesi: Profil'deki küçük mavi simgeyle aynı (burada tanımlı değilse SVG sayfayı kaplıyordu) */
.install-share {
    display: inline-flex;
    width: 18px;
    height: 18px;
    vertical-align: -3px;
    color: var(--brand);
}

.install-share svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Uygulama içi tarayıcı açılış kartı --- */
.inapp-gate {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(243, 247, 250, 0.55);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
    backdrop-filter: saturate(180%) blur(22px);
}

.inapp-gate[hidden],
.inapp-gate [hidden] {
    display: none;
}

.inapp-gate-panel {
    width: 100%;
    max-width: 380px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 22px 20px 16px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 18px 50px rgba(16, 24, 32, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.inapp-gate-panel h2 {
    margin: 0 0 6px;
    font-size: 26px;
    letter-spacing: -0.04em;
}

.inapp-gate-action {
    width: 100%;
    margin-top: 10px;
}

.inapp-gate-action:first-of-type {
    margin-top: 16px;
}

.inapp-gate-continue {
    display: block;
    margin: 14px auto 0;
    padding: 6px 12px;
    border: 0;
    background: transparent;
    color: var(--text-soft);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
