/**
 * TTC Scrolled Sub-Header Navigation
 * Scoped styles recreating the exact double-beveled glass capsule from the design specification.
 * Fully responsive across Desktop, Tablet, and Mobile.
 * Outer border harmonized with the dark scrolled header palette for a seamless blend.
 */

/* ==========================================================
   DESKTOP FLOATING PILL SUB-NAV
========================================================== */
.ttc-sub-nav {
    position: fixed;
    top: 92px; /* Floats with clean space below 76px scrolled header */
    left: 50%;
    transform: translate(-50%, -8px);
    z-index: 9990;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease-out, transform 0.22s ease-out;
    width: auto;
    max-width: 96vw;
}

.ttc-sub-nav.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Smart Scroll Down: smoothly fades out in place */
.ttc-sub-nav.is-visible.is-scroll-down {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -8px);
    transition: opacity 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Outer Glass Bezel (Authentic Frosted Glass Double-Bevel) */
.ttc-sub-nav__bezel {
    position: relative;
    display: inline-flex;
    align-items: center;
    border-radius: 100px;
    padding: 5px;
    border: 1px solid rgba(24, 18, 12, 0.07);
    border-top: 1px solid rgba(24, 18, 12, 0.10);
    border-bottom: 1px solid rgba(24, 18, 12, 0.05);
    box-shadow: 0 14px 30px -4px rgba(0, 0, 0, 0.22),
                0 4px 12px -2px rgba(0, 0, 0, 0.12),
                inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.5),
                inset 0 -1px 1.5px 0 rgba(255, 255, 255, 0.15);
    box-sizing: border-box;
    overflow: hidden;
    isolation: isolate;
}

.ttc-sub-nav__bezel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.22);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    backdrop-filter: blur(28px) saturate(180%);
    z-index: 0;
    pointer-events: none;
}

/* Inner Glass Core (The inner nested pill capsule) */
.ttc-sub-nav__container {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    height: 58px;
    padding: 0 16px 0 24px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.30);
    border: 1px solid rgba(24, 18, 12, 0.04);
    border-top: 1px solid rgba(24, 18, 12, 0.06);
    border-bottom: 1px solid rgba(24, 18, 12, 0.03);
    box-shadow: inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.75),
                inset 0 -1px 1px 0 rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
}

/* Course Badge & Left Hairline */
.ttc-sub-nav__badge-wrapper {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.ttc-sub-nav__badge {
    font-family: 'Josefin Sans', serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--dark, #18120C);
    white-space: nowrap;
    user-select: none;
    line-height: 1;
}

.ttc-sub-nav__divider {
    width: 1px;
    height: 28px;
    background: rgba(24, 18, 12, 0.16);
    margin: 0 20px 0 18px;
    flex-shrink: 0;
}

/* Track & List */
.ttc-sub-nav__track-wrapper {
    display: flex;
    align-items: center;
    overflow: visible;
}

.ttc-sub-nav__list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 3px;
}

.ttc-sub-nav__item {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

/* Faint vertical hairline dividers between items */
.ttc-sub-nav__sep {
    width: 1px;
    height: 20px;
    background: rgba(0, 0, 0, 0.06);
    margin: 0 3px;
    flex-shrink: 0;
    list-style: none;
}

/* Nav Item Link */
.ttc-sub-nav__link {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 15px;
    min-width: auto;
    height: 40px;
    border-radius: 100px;
    color: var(--dark, #18120C);
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    box-sizing: border-box;
}

.ttc-sub-nav__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    color: inherit;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.ttc-sub-nav__icon svg {
    display: block;
    width: 17px;
    height: 17px;
    stroke: currentColor;
    transition: stroke 0.2s ease;
}

.ttc-sub-nav__label {
    display: block;
    line-height: 1;
}

/* Inactive Hover */
.ttc-sub-nav__link:hover {
    color: #1A1208;
    background: rgba(255, 255, 255, 0.32);
}

.ttc-sub-nav__link:hover .ttc-sub-nav__icon {
    transform: scale(1.08);
}

/* Active State: Adhisha Brand Gold with White Text & Icons */
.ttc-sub-nav__link.active {
    background: var(--gold, #C49A35);
    color: #ffffff;
    font-weight: 600;
    border-radius: 100px;
    box-shadow: 0 3px 12px rgba(196, 154, 53, 0.35),
                inset 0 1px 1px 0 rgba(255, 255, 255, 0.4);
}

.ttc-sub-nav__link.active .ttc-sub-nav__icon svg {
    stroke: #ffffff;
    stroke-width: 2;
}

/* Scroll cue hidden on desktop */
.ttc-sub-nav__scroll-cue {
    display: none;
}

/* ==========================================================
   TABLET & MOBILE RESPONSIVE
========================================================== */
@media (max-width: 991px) {
    .ttc-sub-nav {
        top: 74px; /* Directly below 70px mobile header */
        left: 8px;
        right: 8px;
        width: calc(100% - 16px);
        max-width: none;
        padding: 0;
        box-sizing: border-box;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity 0.22s ease-out, transform 0.22s ease-out;
    }

    .ttc-sub-nav.is-visible {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* Smart Scroll Down on Mobile: smoothly fades out in place */
    .ttc-sub-nav.is-visible.is-scroll-down {
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .ttc-sub-nav__bezel {
        position: relative;
        display: block;
        width: 100%;
        border-radius: 22px;
        padding: 4px;
        border: 1px solid rgba(24, 18, 12, 0.07);
        box-sizing: border-box;
        box-shadow: 0 8px 24px -2px rgba(0, 0, 0, 0.20),
                    0 3px 8px -1px rgba(0, 0, 0, 0.10);
        overflow: hidden;
        isolation: isolate;
    }

    .ttc-sub-nav__bezel::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        background: rgba(255, 255, 255, 0.22);
        -webkit-backdrop-filter: blur(24px) saturate(180%);
        backdrop-filter: blur(24px) saturate(180%);
        z-index: 0;
        pointer-events: none;
    }

    .ttc-sub-nav__container {
        position: relative;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        height: auto;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.40);
        border: 1px solid rgba(24, 18, 12, 0.04);
        padding: 6px 8px 7px;
        gap: 5px;
        box-sizing: border-box;
    }

    /* Top sub-row: Course Badge */
    .ttc-sub-nav__badge-wrapper {
        justify-content: center;
        padding-top: 1px;
    }

    .ttc-sub-nav__badge {
        font-size: 11px;
        letter-spacing: 0.12em;
    }

    .ttc-sub-nav__divider {
        display: none;
    }

    /* Bottom sub-row: Horizontal Touch Scrolling Rail */
    .ttc-sub-nav__track-wrapper {
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        padding: 2px 28px 2px 2px;
        width: 100%;
        box-sizing: border-box;
    }

    .ttc-sub-nav__track-wrapper::-webkit-scrollbar {
        display: none;
    }

    .ttc-sub-nav__list {
        display: flex;
        align-items: center;
        gap: 4px;
        min-width: max-content;
        padding: 0;
    }

    .ttc-sub-nav__link {
        flex-direction: row;
        padding: 0 12px;
        min-width: auto;
        height: 34px;
        font-size: 11.5px;
        gap: 6px;
        border-radius: 100px;
    }

    .ttc-sub-nav__link.active {
        border-radius: 100px;
    }

    .ttc-sub-nav__icon {
        width: 15px;
        height: 15px;
    }

    .ttc-sub-nav__icon svg {
        width: 15px;
        height: 15px;
    }

    .ttc-sub-nav__sep {
        height: 20px;
        margin: 0 2px;
    }

    /* Circular scroll cue button on mobile right */
    .ttc-sub-nav__scroll-cue {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        right: 8px;
        bottom: 7px;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.85);
        border: 1px solid rgba(24, 18, 12, 0.14);
        color: var(--gold-dark, #A8832A);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        cursor: pointer;
        padding: 0;
        transition: opacity 0.25s ease, transform 0.25s ease;
        z-index: 5;
    }

    .ttc-sub-nav__scroll-cue.is-hidden {
        opacity: 0;
        pointer-events: none;
        transform: scale(0.85);
    }
}
