@import "dock-nav.css";

/* ==========================================================================
   UU Bus Portal - Official Routes & Tracking Guide Design System
   Matches Portal Standard: dash-header, floating-header-menu, bottom-nav
   Complies with AGENTS.md mobile breakpoints (480px, 360px), zero-emojis
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --ink: #0E1B33;
    --ink-soft: #5C6B8A;
    --ink-faint: #93A2C2;
    --primary: #2451C4;
    --primary-dark: #15306B;
    --primary-soft: #EAF0FC;
    --surface: #F3F6FC;
    --card: #FFFFFF;
    --border: #DCE6F5;
    --success: #15A567;
    --success-soft: #E8F6F0;
    --danger: #E0483B;
    --danger-soft: #FCEAE8;
    --accent: #F5A623;
    --accent-soft: #FEF6E9;
    --telegram: #229ED9;
    --messenger: #0084FF;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --shadow-sm: 0 4px 12px rgba(20, 40, 90, 0.04);
    --shadow-md: 0 8px 24px rgba(20, 40, 90, 0.08);
    --shadow-lg: 0 16px 36px rgba(20, 40, 90, 0.12);
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-blur: blur(24px) saturate(180%);
    --glass-border: 1px solid rgba(255, 255, 255, 0.6);

    --drawer-bg: rgba(255, 255, 255, 0.98);
    --bottom-nav-bg: rgba(255, 255, 255, 0.45);
    --bottom-nav-border: 1px solid rgba(255, 255, 255, 0.55);
    --icon-btn-bg: rgba(255, 255, 255, 0.5);
    --drawer-item-border: 1px solid rgba(14, 27, 51, 0.05);
}

:root.dark-theme {
    --ink: #FFFFFF;
    --ink-soft: #A1A1AA;
    --ink-faint: #71717A;
    --surface: #000000;
    --card: #0D0D11;
    --border: rgba(255, 255, 255, 0.12);
    --primary-soft: rgba(36, 81, 196, 0.2);
    --danger-soft: rgba(224, 72, 59, 0.15);
    --success-soft: rgba(21, 165, 103, 0.15);
    --accent-soft: rgba(245, 166, 35, 0.15);
    --glass-bg: rgba(0, 0, 0, 0.85);
    --glass-border: 1px solid rgba(255, 255, 255, 0.12);
    --drawer-bg: rgba(6, 6, 8, 0.96);
    --bottom-nav-bg: rgba(0, 0, 0, 0.65);
    --bottom-nav-border: 1px solid rgba(255, 255, 255, 0.15);
    --icon-btn-bg: rgba(255, 255, 255, 0.08);
    --drawer-item-border: 1px solid rgba(243, 246, 252, 0.05);
}

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--surface);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}

/* ==========================================================================
   Standard Portal Header (.dash-header)
   ========================================================================== */
.dash-header {
    background: var(--card) !important;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: var(--shadow-sm);
    z-index: 1200;
    flex-shrink: 0;
    height: 60px;
    position: sticky;
    top: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(36, 81, 196, 0.35);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-text .title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
}

.brand-text .live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--success);
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    position: relative;
}

.live-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1.5px solid var(--success);
    opacity: 0.6;
    animation: liveDotPulse 1.8s ease-out infinite;
}

@keyframes liveDotPulse {
    0% { transform: scale(0.6); opacity: 0.7; }
    100% { transform: scale(2.2); opacity: 0; }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.desktop-nav {
    display: flex;
    gap: 6px;
}

.desktop-nav .nav-btn {
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    padding: 8px 14px;
    border-radius: 10px;
    transition: 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.desktop-nav .nav-btn:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.desktop-nav .nav-btn.active {
    background: var(--card);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(36, 81, 196, 0.08);
    border: 1px solid rgba(36, 81, 196, 0.18);
}

.desktop-nav svg {
    width: 17px;
    height: 17px;
}

.icon-btn {
    background: var(--icon-btn-bg);
    color: var(--ink);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--border);
}

/* ==========================================================================
   Drawer Backdrop & Floating Header Menu
   ========================================================================== */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1250;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.drawer-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.floating-header-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: min(84vw, 320px);
    height: 100vh;
    height: 100dvh;
    background: var(--drawer-bg);
    border-left: 1px solid var(--border);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 1300;
    padding: 24px 16px 90px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-header-menu.active {
    right: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.drawer-header span {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.floating-header-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--ink);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    border: var(--drawer-item-border);
}

.floating-header-menu .menu-item:hover,
.floating-header-menu .menu-item.active {
    background: var(--primary-soft);
    color: var(--primary);
}

.floating-header-menu .menu-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.drawer-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* ==========================================================================
   Page Main Wrapper & Layout
   ========================================================================== */
.dash-content {
    flex: 1;
    padding: 20px 14px 40px;
}

.main-wrapper {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Page Hero Block */
.hero-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.hero-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid rgba(36, 81, 196, 0.2);
    border-radius: 999px;
    padding: 4px 12px;
    margin-bottom: 12px;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.hero-card h1 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.25;
    letter-spacing: -0.3px;
    margin-bottom: 8px;
}

.hero-card p {
    font-size: 13.5px;
    color: var(--ink-soft);
    line-height: 1.6;
    max-width: 680px;
}

/* Quick Navigation / Bot Promo Grid */
.bot-promo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.bot-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.bot-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.bot-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.bot-card.messenger::before {
    background: linear-gradient(90deg, #0084FF, #00C6FF);
}

.bot-card.telegram::before {
    background: linear-gradient(90deg, #229ED9, #1E88E5);
}

.bot-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.bot-card.messenger .bot-icon-circle {
    background: #0084FF;
}

.bot-card.telegram .bot-icon-circle {
    background: #229ED9;
}

.bot-card-title {
    font-size: 15px;
    font-weight: 750;
    color: var(--ink);
    line-height: 1.2;
}

.bot-card-sub {
    font-size: 11.5px;
    color: var(--ink-soft);
    margin-top: 2px;
    font-weight: 600;
}

.bot-card-desc {
    font-size: 12.5px;
    color: var(--ink-soft);
    line-height: 1.5;
}

.bot-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    transition: opacity 0.2s;
    width: 100%;
}

.bot-card.messenger .bot-card-action {
    background: #0084FF;
}

.bot-card.telegram .bot-card-action {
    background: #229ED9;
}

.bot-card-action:hover {
    opacity: 0.92;
}

/* ==========================================================================
   Stoppage Interactive Search Box
   ========================================================================== */
.search-container {
    position: sticky;
    top: 68px;
    z-index: 100;
    margin-bottom: 4px;
}

.search-wrap {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 6px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
}

.search-icon-svg {
    position: absolute;
    left: 18px;
    color: var(--ink-faint);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 42px;
    border: none;
    border-radius: 12px;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    outline: none;
}

.search-input::placeholder {
    color: var(--ink-faint);
    font-weight: 500;
}

.search-clear {
    position: absolute;
    right: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 26px;
    height: 26px;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.search-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 4px 0;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-soft);
}

/* ==========================================================================
   Route Cards & Stoppage Lists
   ========================================================================== */
.routes-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.route-group-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color 0.2s;
}

.route-group-card:hover {
    border-color: rgba(36, 81, 196, 0.35);
}

.route-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.route-title-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.route-number-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid rgba(36, 81, 196, 0.2);
    border-radius: 8px;
    padding: 3px 8px;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    width: fit-content;
}

.route-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 750;
    color: var(--ink);
    line-height: 1.3;
}

.route-meta-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-pill {
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-soft);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 9px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.stoppages-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--ink-faint);
    margin-bottom: 6px;
}

.stoppages-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.stop-tag {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 10px;
    transition: all 0.15s;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.stop-tag.highlight {
    background: #FEF3C7;
    border-color: #F59E0B;
    color: #92400E;
    font-weight: 750;
}

.dark-theme .stop-tag.highlight {
    background: rgba(245, 158, 11, 0.2);
    border-color: #F59E0B;
    color: #FBBF24;
}

.route-actions {
    display: flex;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.action-chip-btn {
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--border);
}

.action-chip-btn:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: rgba(36, 81, 196, 0.3);
}

.action-chip-btn.primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.action-chip-btn.primary:hover {
    background: var(--primary-dark);
}

/* FAQ Accordion Section */
.faq-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.faq-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.faq-question {
    font-size: 14px;
    font-weight: 750;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.faq-answer {
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.6;
    margin-top: 8px;
}

/* ==========================================================================
   Mobile Bottom Navigation (.bottom-nav)
   ========================================================================== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--card);
    border-top: 1px solid var(--border);
    z-index: 1100;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 16px rgba(14, 27, 51, 0.06);
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    flex: 1;
    height: 100%;
    transition: color 0.15s;
}

.bottom-nav .nav-item.active {
    color: var(--primary);
}

.bottom-nav .nav-item svg {
    width: 22px;
    height: 22px;
}

/* ==========================================================================
   Mobile Breakpoints Standard per AGENTS.md
   ========================================================================== */
@media (max-width: 768px) {
    .desktop-nav {
        display: none !important;
    }
    .bottom-nav {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .dash-content {
        padding: 14px 12px calc(76px + env(safe-area-inset-bottom, 10px)) !important;
    }
    .hero-card,
    .route-group-card,
    .bot-card,
    .faq-section {
        padding: 14px 12px !important;
        border-radius: 14px !important;
    }
    .hero-card h1 {
        font-size: 18px !important;
    }
    .hero-card p {
        font-size: 12px !important;
    }
    .guide-search-input {
        font-size: 12px !important;
        height: 38px !important;
    }
    .route-title {
        font-size: 14px !important;
    }
    .stop-tag {
        font-size: 11px !important;
        padding: 3.5px 7px !important;
    }
    .faq-question {
        font-size: 12.5px !important;
    }
    .faq-answer {
        font-size: 11.5px !important;
    }
    .bot-card h3 {
        font-size: 13.5px !important;
    }
    .bot-card p {
        font-size: 11.5px !important;
    }
    .bot-btn {
        font-size: 11.5px !important;
        padding: 7px 12px !important;
    }
}

@media (max-width: 360px) {
    .hero-card,
    .route-group-card,
    .bot-card,
    .faq-section {
        padding: 12px 10px !important;
    }
    .hero-card h1 {
        font-size: 16px !important;
    }
    .route-title {
        font-size: 13px !important;
    }
    .bot-promo-grid {
        grid-template-columns: 1fr !important;
    }
}
