/**
 * VIP scroll shell — dışarı sabit, içeride kayar
 * Mobil + tablet (≤1024px), iOS 15/16 Safari
 */

/* —— Ana gövde kilidi —— */
@media (max-width: 1024px) {
    html.ios-app-shell {
        height: 100vh;
        height: -webkit-fill-available;
        height: 100dvh;
        max-height: 100vh;
        max-height: -webkit-fill-available;
        max-height: 100dvh;
        overflow: hidden;
        overscroll-behavior: none;
        background-color: #08090c;
        -webkit-text-size-adjust: 100%;
    }

    html.ios-app-shell body:not(.msg-thread-page) {
        height: 100vh;
        height: -webkit-fill-available;
        height: 100dvh;
        max-height: 100vh;
        max-height: -webkit-fill-available;
        max-height: 100dvh;
        overflow: hidden;
        overscroll-behavior: none;
        touch-action: manipulation;
        background-color: #08090c;
        position: relative;
    }

    /* .page-wrapper = .app-layout */
    html.ios-app-shell body:not(.msg-thread-page) .app-layout,
    html.ios-app-shell body:not(.msg-thread-page) .page-wrapper {
        height: 100vh;
        height: -webkit-fill-available;
        height: 100dvh;
        max-height: 100vh;
        max-height: -webkit-fill-available;
        max-height: 100dvh;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        overscroll-behavior: none;
    }

    html.ios-app-shell body:not(.msg-thread-page) .app-header {
        flex: 0 0 auto;
        flex-shrink: 0;
        position: relative;
        top: auto;
    }

    /* Orta sütun — scroll taşıyıcı (kendisi kaymaz) */
    html.ios-app-shell body:not(.msg-thread-page) .app-main {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        max-height: none;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        margin-left: auto;
        margin-right: auto;
        width: 100%;
    }

    /* İçerik alanı — bağımsız kaydırma */
    html.ios-app-shell body:not(.msg-thread-page) .app-main-inner,
    html.ios-app-shell body:not(.msg-thread-page) .dashboard-content,
    html.ios-app-shell body:not(.msg-thread-page) .page-content {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }

    /* Alt menü — flex tabanında sabit (fixed yerine akış) */
    html.ios-app-shell body:not(.msg-thread-page) .mob-tabbar {
        flex: 0 0 auto;
        flex-shrink: 0;
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
    }

    /* Kaydırılabilir tüm VIP alanlar */
    html.ios-app-shell .ios-scroll,
    html.ios-app-shell [data-ios-scroll],
    html.ios-app-shell .browse-panel,
    html.ios-app-shell .job-list,
    html.ios-app-shell .venue-dashboard,
    html.ios-app-shell .dashboard {
        -webkit-overflow-scrolling: touch;
    }

    /* Input beyaz/gri katman yaması */
    html.ios-app-shell .profile-card input:not([type="file"]):not([type="checkbox"]):not([type="radio"]),
    html.ios-app-shell .profile-card select,
    html.ios-app-shell .profile-card textarea,
    html.ios-app-shell .form-group input:not([type="file"]):not([type="checkbox"]):not([type="radio"]),
    html.ios-app-shell .form-group select,
    html.ios-app-shell .form-group textarea,
    html.ios-app-shell .filter-bar select,
    html.ios-app-shell .msg-input-wrap textarea {
        background-color: #18181f !important;
        color: #f2f2f7;
        -webkit-text-fill-color: #f2f2f7;
        -webkit-appearance: none;
        appearance: none;
    }

    html.ios-app-shell .form-actions.ios-keyboard-sticky {
        position: fixed;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 350;
        margin: 0;
        padding: 0.65rem 0.85rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
        background-color: #0d0d13 !important;
        border-top: 1px solid rgba(168, 85, 247, 0.15);
        box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.35);
        gap: 0.5rem;
    }

    html.ios-app-shell .form-actions.ios-keyboard-sticky .btn {
        min-height: 44px;
    }

    body.msg-thread-page .mob-tabbar {
        display: none !important;
    }
}

/* Auth */
@media (max-width: 1024px) {
    html.ios-auth-shell {
        height: 100vh;
        height: -webkit-fill-available;
        height: 100dvh;
        overflow: hidden;
        overscroll-behavior: none;
        background-color: #08090c;
    }

    html.ios-auth-shell body {
        height: 100%;
        overflow: hidden;
        overscroll-behavior: none;
        background-color: #08090c;
    }

    html.ios-auth-shell .auth-page {
        height: 100vh;
        height: -webkit-fill-available;
        height: 100dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }

    html.ios-auth-shell .auth-card input,
    html.ios-auth-shell .auth-card textarea,
    html.ios-auth-shell .auth-card select {
        background-color: #18181f !important;
        color: #f2f2f7;
        -webkit-text-fill-color: #f2f2f7;
        -webkit-appearance: none;
    }
}
