/**
 * assets/css/common.css
 * Professional Unified Stylesheet
 */

/* ============================================================================
   1. CORE RESET & LAYOUT
   ========================================================================== */
:root {
    --accent: #0ea5e9;
    --zinc-900: #18181b;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* Prevent horizontal bounce */
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
}

/* Landing Page Typography Override */
body.landing-theme {
    font-family: 'Space Grotesk', sans-serif;
    background-color: #050505;
    color: #fff;
}

/* ============================================================================
   2. MOBILE NAVIGATION FIXES (Persistent Overlapping Fix)
   ========================================================================== */
#mobile-menu {
    z-index: 9999;
}

#mobile-menu-panel {
    background: #000 !important;
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu-backdrop {
    background: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(8px);
}

body.mobile-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
}

/* ============================================================================
   3. HERO & TEXT RESPONSIVENESS (Viewport Fix)
   ========================================================================== */
@media (max-width: 768px) {
    /* Prevent massive headers from pushing the viewport wide */
    h1, .hero-title {
        font-size: clamp(2.5rem, 12vw, 5rem) !important;
        line-height: 0.9 !important;
        word-break: break-word;
    }

    .glass-card {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 1.5rem !important;
    }
}

/* ============================================================================
   4. DICHOTOMY TREE (Graph & Table Fixes)
   ========================================================================== */
.tree-container {
    max-width: 100%;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .dichotomy-fork {
        flex-direction: row !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        padding: 0 0.5rem;
    }

    .node {
        width: 46% !important; /* Allow side-by-side on mobile */
        min-width: 0 !important;
        padding: 0.75rem 0.5rem !important;
        font-size: 10px !important;
    }

    /* Transform Table to Cards for Mobile */
    #tree table, #tree tbody, #tree tr, #tree td {
        display: block;
        width: 100%;
    }

    #tree thead { display: none; }

    #tree tr {
        margin-bottom: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
        padding: 1rem;
        border-radius: 12px;
    }

    #tree td {
        display: flex;
        justify-content: space-between;
        padding: 0.4rem 0 !important;
        border: none !important;
        font-size: 0.85rem;
    }

    #tree td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--accent);
        text-transform: uppercase;
        font-size: 0.65rem;
    }
}

/* ============================================================================
   5. CHECKER SECTION (Tabs & Inputs)
   ========================================================================== */
#checker-birthdate {
    background-color: #f8fafc !important;
    color: #000 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 0.5rem 1rem !important;
    min-height: 3.5rem;
}

/* Tabs Horizontal Scroll */
.tab-scroll-container {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.5rem;
    padding-bottom: 8px;
    scrollbar-width: none; /* Firefox */
}

.tab-scroll-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.context-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    min-width: 120px;
}

/* Fix for artifacts on the "Check" section decoration */
@media (max-width: 1024px) {
    #check-availability .absolute-skew-decoration {
        display: none;
    }
}

/* ============================================================================
   8. BREATHING DOT ANIMATION (4-4-4-4 Pattern)
   ========================================================================== */
.breathing-dot {
    animation: breathe 16s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
}

@keyframes breathe {
    /* Inhale: 0-25% (4 seconds) - expand */
    0% {
        transform: scale(1);
        opacity: 0.8;
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    25% {
        transform: scale(1.5);
        opacity: 1;
        box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.5);
    }

    /* Hold: 25-50% (4 seconds) - stay expanded */
    50% {
        transform: scale(1.5);
        opacity: 1;
        box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.5);
    }

    /* Exhale: 50-75% (4 seconds) - contract */
    75% {
        transform: scale(1);
        opacity: 0.8;
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }

    /* Hold: 75-100% (4 seconds) - stay contracted */
    100% {
        transform: scale(1);
        opacity: 0.8;
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
}

/* Subtle glow effect on hover */
.breathing-dot:hover {
    animation-play-state: paused;
    transform: scale(1.3);
    box-shadow: 0 0 15px 3px rgba(14, 165, 233, 0.6);
}
