/* Typify Components Shared Styles - Unique Classes to avoid conflicts */

:root {
    --nav-bg: #050505;
    --nav-glass: rgba(5, 5, 5, 0.85);
    --nav-text: #ffffff;
    --nav-text-muted: rgba(255, 255, 255, 0.7);
    --nav-accent: #00f0ff;
    --nav-height: 80px;
    --botnav-height: 62px;
    --nav-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Wrapper */
.tpf-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: var(--nav-glass);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    height: var(--nav-height);
    display: flex;
    align-items: center;
}

/* Inner Container */
.tpf-nav-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.tpf-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 1.5rem;
}

.tpf-logo-icon {
    color: var(--nav-accent) !important;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

/* Links */
.tpf-nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.tpf-nav-link {
    text-decoration: none;
    color: var(--nav-text-muted) !important;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.tpf-nav-link:hover {
    color: #ffffff !important;
}

/* Hamburger Button */
.tpf-hamburger-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0.5rem;
    z-index: 10001;
}

.tpf-hamburger-line {
    width: 24px;
    height: 2px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: all 0.3s var(--nav-ease);
}

/* Hamburger Active State */
.tpf-hamburger-btn[aria-expanded="true"] .tpf-hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.tpf-hamburger-btn[aria-expanded="true"] .tpf-hamburger-line:nth-child(2) {
    opacity: 0;
}
.tpf-hamburger-btn[aria-expanded="true"] .tpf-hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ─── Test Dropdown (Desktop) ─── */
.tpf-dropdown {
    position: relative;
    cursor: pointer;
}
.tpf-dropdown-menu {
    position: absolute;
    top: 100%;
    right: -1rem;
    min-width: 210px;
    background: rgba(5, 5, 5, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s ease;
    z-index: 10002;
}
.tpf-dropdown:hover .tpf-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}
.tpf-dropdown-link {
    display: block;
    padding: 0.5rem 1.25rem;
    color: rgba(255, 255, 255, 0.65) !important;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.tpf-dropdown-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.04);
}

/* ─── Mobile Drawer ─── */
.tpf-mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--nav-bg);
    padding-top: var(--nav-height);
    transform: translateX(100%);
    transition: transform 0.4s var(--nav-ease);
    z-index: 9999;
    overflow-y: auto;
}

.tpf-mobile-drawer.open {
    transform: translateX(0);
}

.tpf-mobile-drawer-content {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    gap: 1.25rem;
}

.tpf-mobile-link {
    color: var(--nav-text-muted) !important;
    text-decoration: none;
    font-size: 1.35rem;
    font-weight: 500;
    transition: color 0.2s;
}

.tpf-mobile-link:hover {
    color: #ffffff !important;
}

.tpf-mobile-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.tpf-mobile-section-title {
    color: var(--nav-accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 0.35rem;
}
.tpf-mobile-sub-link {
    color: rgba(255, 255, 255, 0.5) !important;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}
.tpf-mobile-sub-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.03);
}

/* Desktop vs Mobile display */
@media (min-width: 769px) {
    .tpf-hamburger-btn { display: none; }
    .tpf-mobile-drawer { display: none; }
}

@media (max-width: 768px) {
    :root { --nav-height: 60px; }
    .tpf-nav {
        height: 60px;
    }
    .desktop-only { display: none; }
}

/* =====================================================
   Mobile Bottom Tab Bar  +  Account Sheet
   ===================================================== */
.tpf-botnav { display: none; }
.tpf-sheet,
.tpf-sheet-backdrop { display: none; }

@media (max-width: 768px) {
    /* Reserve space so fixed bottom bar never covers content/footer */
    body {
        padding-bottom: calc(var(--botnav-height) + env(safe-area-inset-bottom, 0px)) !important;
    }

    .tpf-botnav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10000;
        height: calc(var(--botnav-height) + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: rgba(5, 5, 5, 0.92);
        backdrop-filter: blur(14px) saturate(180%);
        -webkit-backdrop-filter: blur(14px) saturate(180%);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.4);
        transition: transform 0.32s var(--nav-ease);
    }
    .tpf-botnav.tpf-botnav--hidden { transform: translateY(120%); }

    .tpf-tab {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-height: var(--botnav-height);
        padding: 6px 2px;
        background: none;
        border: none;
        cursor: pointer;
        text-decoration: none;
        font-family: inherit;
        font-size: 0.66rem;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.55) !important;
        position: relative;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.2s ease;
    }
    .tpf-tab svg {
        width: 25px;
        height: 25px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.9;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
    .tpf-tab .tpf-tab-label { line-height: 1; }
    .tpf-tab:active { color: #ffffff !important; }
    .tpf-tab.is-active { color: var(--nav-accent) !important; }
    .tpf-tab.is-active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 28px;
        height: 3px;
        border-radius: 0 0 3px 3px;
        background: var(--nav-accent);
        box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
    }

    /* Account / more sheet */
    .tpf-sheet-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 10001;
        background: rgba(0, 0, 0, 0.55);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    .tpf-sheet-backdrop.open { opacity: 1; visibility: visible; }

    .tpf-sheet {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10002;
        background: #0d0d12;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 22px 22px 0 0;
        padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px));
        max-height: 82vh;
        overflow-y: auto;
        transform: translateY(100%);
        visibility: hidden;
        transition: transform 0.34s var(--nav-ease), visibility 0.34s var(--nav-ease);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    }
    .tpf-sheet.open { transform: translateY(0); visibility: visible; }
    .tpf-sheet-handle {
        width: 42px;
        height: 4px;
        border-radius: 99px;
        background: rgba(255, 255, 255, 0.22);
        margin: 4px auto 14px;
    }
    .tpf-sheet-title {
        color: var(--nav-accent);
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        margin: 0 6px 10px;
    }
    .tpf-sheet-body { display: flex; flex-direction: column; gap: 4px; }
    .tpf-sheet-link {
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 52px;
        padding: 0 14px;
        border-radius: 12px;
        color: rgba(255, 255, 255, 0.88) !important;
        text-decoration: none;
        font-size: 1.02rem;
        font-weight: 500;
        transition: background 0.2s ease;
    }
    .tpf-sheet-link:active,
    .tpf-sheet-link:hover { background: rgba(255, 255, 255, 0.05); }
}

@media (min-width: 769px) {
    .tpf-botnav,
    .tpf-sheet,
    .tpf-sheet-backdrop { display: none !important; }
}

/* =====================================================
   Footer — modern, multi-column, branded (dark/cyan, RTL)
   ===================================================== */
.footer {
    background: #08080c;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.6);
    padding: 3.25rem 1.5rem 2rem;
}
.footer-grid {
    max-width: 1160px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.7fr 1fr 1fr 1fr;
    gap: 2rem 1.5rem;
    text-align: right;
}
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff !important;
    font-weight: 800;
    font-size: 1.3rem;
    text-decoration: none;
}
.footer-logo-ic { color: var(--nav-accent); text-shadow: 0 0 12px rgba(0, 240, 255, 0.5); }
.footer-tagline {
    margin: 0.85rem 0 1.1rem;
    font-size: 0.85rem;
    line-height: 1.95;
    color: rgba(255, 255, 255, 0.5);
    max-width: 38ch;
}
.footer-social { display: flex; gap: 0.6rem; }
.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7) !important;
    transition: all 0.2s ease;
}
.footer-social a:hover {
    color: var(--nav-accent) !important;
    border-color: var(--nav-accent);
    background: rgba(0, 240, 255, 0.08);
    transform: translateY(-2px);
}
.footer-social svg { width: 18px; height: 18px; fill: currentColor; }
.footer-col h4 {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.9rem;
}
.footer-col a {
    display: block;
    color: rgba(255, 255, 255, 0.6) !important;
    text-decoration: none;
    font-size: 0.88rem;
    padding: 0.34rem 0;
    transition: color 0.2s ease;
}
.footer-col a:hover { color: var(--nav-accent) !important; }
.footer-bottom {
    max-width: 1160px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}
.footer-copy { font-size: 0.82rem; color: rgba(255, 255, 255, 0.45); }

@media (max-width: 768px) {
    .footer { padding: 2.5rem 1.25rem 2rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.75rem 1rem; }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 430px) {
    .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* =====================================================
   Sticky Footer — Works on ALL pages via shared CSS
   ===================================================== */
body {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
}
body > main,
main,
.page-shell,
.content-page,
.intro-page,
.main-wrapper,
.app-shell,
.glass-container:not(.tpf-nav-container) {
    flex: 1 !important;
    min-height: 0 !important;
}
/* Wrapper-independent fallback: push the injected footer to the bottom even
   when no content element above it is set to flex:1 (prevents a floating
   footer on short pages). Harmless when a flex:1 wrapper already fills the gap. */
#typify-footer,
body > .footer {
    margin-top: auto !important;
}
