/*
 * TURKISHCHE — LESSON PLAYER STYLES
 * Extracted safely from the working Additional HTML V2.
 * Desktop + mobile portrait + mobile landscape rules.
 */

/* =============================================
   SOURCE STYLE BLOCK 8
   ============================================= */

/* =========================================================
   TURKISHCHE — LESSON PROGRESS FLICKER FIX
   Gerçek H5P verisi gelmeden eski/geçici yüzdeyi göstermez.
   ========================================================= */

body.path-mod-h5pactivity .turkishche-lesson-progress:not(.tc-progress-ready),
body.path-mod .turkishche-lesson-progress:not(.tc-progress-ready) {
    opacity: 0 !important;
    visibility: hidden !important;
}

body.path-mod-h5pactivity .turkishche-lesson-progress.tc-progress-ready,
body.path-mod .turkishche-lesson-progress.tc-progress-ready {
    opacity: 1 !important;
    visibility: visible !important;
    transition: opacity 0.12s ease !important;
}

body.path-mod-h5pactivity
.turkishche-lesson-progress.tc-progress-ready
.tc-progress-fill,
body.path-mod
.turkishche-lesson-progress.tc-progress-ready
.tc-progress-fill {
    transition: width 0.35s ease !important;
}

/* =============================================
   SOURCE STYLE BLOCK 12
   ============================================= */

/* =====================================================
   MOBILE PORTRAIT + GENERAL MOBILE
   ===================================================== */

@media (max-width: 767.98px) {

    body.tc-fullscreen-mode {
        width: 100% !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        overflow: hidden !important;
        overscroll-behavior: none !important;
    }

    body.tc-fullscreen-mode .tc-fullscreen-lesson {
        position: fixed !important;
        inset: 0 !important;
        z-index: 1040 !important;

        display: grid !important;
        grid-template-rows:
            auto
            minmax(0, 1fr)
            auto !important;

        width: 100% !important;
        height: 100dvh !important;
        min-height: 100dvh !important;

        overflow: hidden !important;
        background: #f5f8f8 !important;
    }


    /* -----------------------------
       ÜST DERS BAŞLIĞI
       ----------------------------- */

    body.tc-fullscreen-mode .tc-fs-topbar {
        position: relative !important;
        z-index: 5 !important;

        display: grid !important;
        grid-template-columns:
            minmax(58px, auto)
            minmax(0, 1fr)
            auto !important;

        align-items: center !important;
        gap: 8px !important;

        width: 100% !important;
        min-height: 58px !important;
        padding:
            max(6px, env(safe-area-inset-top))
            10px
            7px !important;

        background: #ffffff !important;
        border-bottom: 1px solid rgba(15, 23, 42, 0.10) !important;
        box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06) !important;
    }

    body.tc-fullscreen-mode .tc-fs-brand {
        min-width: 0 !important;
        overflow: hidden !important;
    }

    body.tc-fullscreen-mode .tc-fs-back {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        min-height: 34px !important;
        max-width: 76px !important;
        padding: 6px 8px !important;

        border: 1px solid rgba(0, 150, 136, 0.20) !important;
        border-radius: 9px !important;
        background: rgba(0, 150, 136, 0.07) !important;

        color: #007f73 !important;
        font-size: 0 !important;
        font-weight: 700 !important;
        line-height: 1 !important;
        text-decoration: none !important;
        white-space: nowrap !important;
    }

    body.tc-fullscreen-mode .tc-fs-back::after {
        content: "← Course" !important;
        font-size: 11px !important;
    }

    body.tc-fullscreen-mode .tc-fs-title-wrap {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;

        min-width: 0 !important;
        overflow: hidden !important;
        text-align: left !important;
    }

    body.tc-fullscreen-mode .tc-fs-section-title {
        display: block !important;
        margin: 0 0 2px !important;

        color: #009688 !important;
        font-size: 10px !important;
        font-weight: 800 !important;
        line-height: 1.1 !important;
        letter-spacing: 0.04em !important;
        text-transform: uppercase !important;

        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    body.tc-fullscreen-mode .tc-fs-activity-title {
        display: block !important;
        margin: 0 !important;

        color: #1f2937 !important;
        font-size: 13px !important;
        font-weight: 750 !important;
        line-height: 1.2 !important;

        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    body.tc-fullscreen-mode .tc-fs-counter {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        min-width: 42px !important;
        min-height: 30px !important;
        padding: 5px 7px !important;

        border-radius: 9px !important;
        background: rgba(255, 122, 26, 0.10) !important;
        color: #d95f00 !important;

        font-size: 11px !important;
        font-weight: 800 !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }


    /* -----------------------------
       ANA DERS SAHNESİ
       ----------------------------- */

    body.tc-fullscreen-mode .tc-fs-stage {
        position: relative !important;
        min-width: 0 !important;
        min-height: 0 !important;
        width: 100% !important;
        height: 100% !important;

        overflow: hidden !important;
        padding: 6px !important;
        background: #eef3f3 !important;
    }

    body.tc-fullscreen-mode .tc-fs-stage-frame {
        position: relative !important;
        width: 100% !important;
        height: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;

        overflow: hidden !important;
        border-radius: 12px !important;
        background: #ffffff !important;
        box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08) !important;
    }

    body.tc-fullscreen-mode .tc-fs-scaler {
        max-width: none !important;
        transform-origin: center center !important;
    }

    body.tc-fullscreen-mode .tc-fs-stage-resource video,
    body.tc-fullscreen-mode .tc-fs-stage-resource iframe {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        margin: 0 auto !important;
        object-fit: contain !important;
    }


    /* -----------------------------
       ALT NAVİGASYON
       ----------------------------- */

    body.tc-fullscreen-mode .tc-fs-bottombar {
        position: relative !important;
        z-index: 6 !important;

        width: 100% !important;
        min-height: 74px !important;
        padding:
            7px
            8px
            max(7px, env(safe-area-inset-bottom)) !important;

        overflow: hidden !important;
        background: #ffffff !important;
        border-top: 1px solid rgba(15, 23, 42, 0.10) !important;
        box-shadow: 0 -3px 14px rgba(15, 23, 42, 0.07) !important;
    }

    body.tc-fullscreen-mode .tc-fs-bottombar .activity-navigation {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.tc-fullscreen-mode
    .tc-fs-bottombar
    .activity-navigation
    > .row {
        display: grid !important;
        grid-template-columns:
            minmax(70px, 0.85fr)
            minmax(108px, 1.3fr)
            minmax(70px, 0.85fr) !important;

        align-items: center !important;
        gap: 7px !important;

        width: 100% !important;
        margin: 0 !important;
    }

    body.tc-fullscreen-mode
    .tc-fs-bottombar
    .activity-navigation
    > .row
    > * {
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        flex: none !important;
    }

    body.tc-fullscreen-mode .tc-previous-button,
    body.tc-fullscreen-mode .tc-next-button {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        width: 100% !important;
        min-width: 0 !important;
        min-height: 42px !important;
        padding: 8px 6px !important;

        border-radius: 10px !important;
        font-size: 11px !important;
        font-weight: 800 !important;
        line-height: 1.1 !important;
        text-align: center !important;
        text-decoration: none !important;
        white-space: nowrap !important;

        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    body.tc-fullscreen-mode .tc-previous-button {
        background: #009688 !important;
        border-color: #009688 !important;
        color: #ffffff !important;
    }

    body.tc-fullscreen-mode .tc-next-button {
        background: #ff7a1a !important;
        border-color: #ff7a1a !important;
        color: #ffffff !important;
    }

    body.tc-fullscreen-mode .turkishche-lesson-progress {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;

        min-width: 0 !important;
        min-height: 42px !important;
        padding: 5px 2px !important;
    }

    body.tc-fullscreen-mode .tc-progress-top {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 4px !important;
        margin-bottom: 5px !important;
    }

    body.tc-fullscreen-mode .tc-progress-label {
        min-width: 0 !important;
        color: #52606d !important;
        font-size: 9px !important;
        font-weight: 700 !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }

    body.tc-fullscreen-mode .tc-progress-value {
        color: #d95f00 !important;
        font-size: 10px !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }

    body.tc-fullscreen-mode .tc-progress-track {
        width: 100% !important;
        height: 7px !important;
        overflow: hidden !important;
        border-radius: 999px !important;
        background: #e8ecec !important;
    }

    body.tc-fullscreen-mode .tc-progress-fill {
        height: 100% !important;
        min-width: 0 !important;
        border-radius: inherit !important;
        background: #ff7a1a !important;
    }

    body.tc-fullscreen-mode .turkishche-hide-previous {
        visibility: hidden !important;
        pointer-events: none !important;
    }


    /* -----------------------------
       COURSE INDEX BUTONU
       Ekranın ortasına taşmasını engeller.
       ----------------------------- */

    body.tc-fullscreen-mode
    .drawer-toggler.drawer-left-toggle {
        position: fixed !important;
        left: 0 !important;
        top: 50% !important;
        right: auto !important;
        bottom: auto !important;
        z-index: 1060 !important;

        width: 34px !important;
        height: 48px !important;
        margin: 0 !important;

        transform: translateY(-50%) !important;
    }

    body.tc-fullscreen-mode
    .drawer-toggler.drawer-left-toggle
    .btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        width: 34px !important;
        min-width: 34px !important;
        height: 48px !important;
        min-height: 48px !important;
        padding: 0 !important;
        margin: 0 !important;

        border: 0 !important;
        border-radius: 0 11px 11px 0 !important;
        background: #ff7a1a !important;
        color: #ffffff !important;

        box-shadow: 3px 3px 12px rgba(15, 23, 42, 0.20) !important;
    }

    body.tc-fullscreen-mode
    .drawer-toggler.drawer-left-toggle
    .btn
    .icon {
        margin: 0 !important;
        font-size: 15px !important;
    }


    /* Drawer açıkken buton drawer kenarında kalır. */
    body.tc-fullscreen-mode
    #theme_boost-drawers-courseindex.show
    ~ *
    .drawer-toggler.drawer-left-toggle {
        left: 0 !important;
    }


    /* -----------------------------
       PDF DERS KARTI
       ----------------------------- */

    body.tc-fullscreen-mode .tc-fs-stage-pdf {
        overflow: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.tc-fullscreen-mode .tc-fs-stage-pdf .tc-fs-stage-frame {
        overflow: auto !important;
    }

    body.tc-fullscreen-mode .tc-pdf-lesson-card {
        width: min(100%, 420px) !important;
        max-width: calc(100vw - 28px) !important;
    }

    body.tc-fullscreen-mode .tc-pdf-card-inner {
        padding: 18px 15px !important;
    }

    body.tc-fullscreen-mode .tc-pdf-title {
        font-size: 21px !important;
        line-height: 1.2 !important;
    }

    body.tc-fullscreen-mode .tc-pdf-description {
        font-size: 13px !important;
        line-height: 1.5 !important;
    }

    body.tc-fullscreen-mode .tc-pdf-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    body.tc-fullscreen-mode .tc-pdf-open,
    body.tc-fullscreen-mode .tc-pdf-download {
        width: 100% !important;
        min-height: 42px !important;
    }
}


/* =====================================================
   VERY NARROW PHONES
   ===================================================== */

@media (max-width: 374.98px) {

    body.tc-fullscreen-mode .tc-fs-topbar {
        grid-template-columns:
            56px
            minmax(0, 1fr)
            38px !important;

        gap: 5px !important;
        padding-left: 7px !important;
        padding-right: 7px !important;
    }

    body.tc-fullscreen-mode .tc-fs-activity-title {
        font-size: 12px !important;
    }

    body.tc-fullscreen-mode .tc-fs-counter {
        min-width: 38px !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
        font-size: 10px !important;
    }

    body.tc-fullscreen-mode
    .tc-fs-bottombar
    .activity-navigation
    > .row {
        grid-template-columns:
            minmax(60px, 0.78fr)
            minmax(92px, 1.2fr)
            minmax(60px, 0.78fr) !important;

        gap: 5px !important;
    }

    body.tc-fullscreen-mode .tc-previous-button,
    body.tc-fullscreen-mode .tc-next-button {
        font-size: 10px !important;
        padding-left: 3px !important;
        padding-right: 3px !important;
    }

    body.tc-fullscreen-mode .tc-progress-label {
        font-size: 8px !important;
    }
}


/* =====================================================
   PHONE LANDSCAPE
   İçerik alanını mümkün olduğunca büyütür.
   ===================================================== */

@media
    (max-width: 932px)
    and (orientation: landscape)
    and (max-height: 500px) {

    body.tc-fullscreen-mode .tc-fullscreen-lesson {
        grid-template-rows:
            44px
            minmax(0, 1fr)
            54px !important;
    }

    body.tc-fullscreen-mode .tc-fs-topbar {
        min-height: 44px !important;
        padding:
            max(3px, env(safe-area-inset-top))
            10px
            3px !important;

        grid-template-columns:
            72px
            minmax(0, 1fr)
            44px !important;
    }

    body.tc-fullscreen-mode .tc-fs-back {
        min-height: 30px !important;
        padding: 4px 7px !important;
    }

    body.tc-fullscreen-mode .tc-fs-section-title {
        display: none !important;
    }

    body.tc-fullscreen-mode .tc-fs-activity-title {
        font-size: 12px !important;
    }

    body.tc-fullscreen-mode .tc-fs-counter {
        min-height: 28px !important;
        font-size: 10px !important;
    }

    body.tc-fullscreen-mode .tc-fs-stage {
        padding: 3px !important;
    }

    body.tc-fullscreen-mode .tc-fs-stage-frame {
        border-radius: 8px !important;
    }

    body.tc-fullscreen-mode .tc-fs-bottombar {
        min-height: 54px !important;
        padding:
            4px
            max(8px, env(safe-area-inset-right))
            max(4px, env(safe-area-inset-bottom))
            max(8px, env(safe-area-inset-left)) !important;
    }

    body.tc-fullscreen-mode .tc-previous-button,
    body.tc-fullscreen-mode .tc-next-button {
        min-height: 38px !important;
        font-size: 10px !important;
    }

    body.tc-fullscreen-mode .turkishche-lesson-progress {
        min-height: 38px !important;
        padding-top: 3px !important;
        padding-bottom: 3px !important;
    }

    body.tc-fullscreen-mode .tc-progress-top {
        margin-bottom: 3px !important;
    }

    body.tc-fullscreen-mode .tc-progress-track {
        height: 6px !important;
    }

    body.tc-fullscreen-mode
    .drawer-toggler.drawer-left-toggle {
        width: 30px !important;
        height: 42px !important;
    }

    body.tc-fullscreen-mode
    .drawer-toggler.drawer-left-toggle
    .btn {
        width: 30px !important;
        min-width: 30px !important;
        height: 42px !important;
        min-height: 42px !important;
    }
}

/* =============================================
   SOURCE STYLE BLOCK 13
   ============================================= */

/* =====================================================
   PORTRAIT — EŞİT PREVIOUS / NEXT
   ===================================================== */

@media
    (max-width: 767.98px)
    and (orientation: portrait) {

    body.tc-fullscreen-mode
    .tc-fs-bottombar
    .activity-navigation
    > .row {
        display: grid !important;
        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1fr) !important;
        grid-template-areas:
            "progress progress"
            "previous next" !important;

        column-gap: 14px !important;
        row-gap: 9px !important;
        align-items: center !important;
    }

    body.tc-fullscreen-mode
    .tc-fs-bottombar
    .turkishche-lesson-progress {
        grid-area: progress !important;
        width: 100% !important;
        min-height: 34px !important;
        padding: 2px 0 !important;
    }

    body.tc-fullscreen-mode
    .tc-fs-bottombar
    .tc-previous-button {
        grid-area: previous !important;
    }

    body.tc-fullscreen-mode
    .tc-fs-bottombar
    .tc-next-button {
        grid-area: next !important;
    }

    body.tc-fullscreen-mode
    .tc-fs-bottombar
    .tc-previous-button,
    body.tc-fullscreen-mode
    .tc-fs-bottombar
    .tc-next-button {
        width: 100% !important;
        max-width: 148px !important;
        min-height: 44px !important;
    }

    body.tc-fullscreen-mode
    .tc-fs-bottombar
    .tc-previous-button {
        justify-self: start !important;
    }

    body.tc-fullscreen-mode
    .tc-fs-bottombar
    .tc-next-button {
        justify-self: end !important;
    }

    body.tc-fullscreen-mode .tc-fs-bottombar {
        min-height: 98px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}


/* =====================================================
   LANDSCAPE — KİLİTLİ EKRAN YERİNE KAYDIRILABİLİR SAYFA
   ===================================================== */

@media
    (max-width: 932px)
    and (orientation: landscape)
    and (max-height: 500px) {

    html {
        height: auto !important;
        min-height: 100% !important;
        overflow-y: auto !important;
        overscroll-behavior-y: auto !important;
    }

    body.tc-fullscreen-mode {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        min-height: 100dvh !important;

        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.tc-fullscreen-mode .tc-fullscreen-lesson {
        position: relative !important;
        inset: auto !important;

        width: 100% !important;
        height: auto !important;
        min-height: 100dvh !important;

        grid-template-rows:
            44px
            minmax(290px, calc(100dvh - 98px))
            54px !important;

        overflow: visible !important;
    }

    body.tc-fullscreen-mode .tc-fs-stage {
        width: 100% !important;
        height: auto !important;
        min-height: 290px !important;

        overflow: hidden !important;
    }

    body.tc-fullscreen-mode .tc-fs-stage-frame {
        width: 100% !important;
        height: 100% !important;
        min-height: 286px !important;

        overflow: hidden !important;
    }

    body.tc-fullscreen-mode .tc-fs-bottombar {
        position: relative !important;
        bottom: auto !important;

        width: 100% !important;
        min-height: 54px !important;
        flex-shrink: 0 !important;
    }

    /*
     * Chrome adres çubuğunun açılıp kapanması sırasında
     * sayfanın birkaç piksel aşağıda kalmasını engeller.
     */
    body.tc-fullscreen-mode::after {
        content: "" !important;
        display: block !important;
        width: 100% !important;
        height: max(8px, env(safe-area-inset-bottom)) !important;
    }
}


/* =====================================================
   NATIVE VIDEO FULLSCREEN
   - Görüntüyü esnetmez veya kırpmaz
   - Ekranın ortasında tutar
   ===================================================== */

body.tc-fullscreen-mode video:fullscreen,
body.tc-fullscreen-mode iframe:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;

    margin: 0 !important;
    padding: 0 !important;

    object-fit: contain !important;
    object-position: center center !important;
    background: #000000 !important;
}

body.tc-fullscreen-mode video:-webkit-full-screen,
body.tc-fullscreen-mode iframe:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;

    margin: 0 !important;
    padding: 0 !important;

    object-fit: contain !important;
    object-position: center center !important;
    background: #000000 !important;
}

