/* ── 1) CSS Variables ────────────────────────────── */

:root {
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 18px 50px rgba(0,0,0,.10);
    --shadow-sm: 0 10px 30px rgba(0,0,0,.08);

    --bg: #f7f8fb;
    --bgElev: #ffffff;
    --bgElev2: #fbfbfe;

    --text: #111827;
    --muted: #6b7280;

    --border: rgba(17, 24, 39, 0.12);

    --accent: #2563eb;
    --accent2: #7c3aed;
    --danger: #ef4444;
}

html[data-theme="dark"] {
    --bg: #0b0f19;
    --bgElev: #0f172a;
    --bgElev2: #111c33;

    --text: #e5e7eb;
    --muted: #9ca3af;

    --border: rgba(229, 231, 235, 0.14);

    --accent: #60a5fa;
    --accent2: #a78bfa;
    --danger: #f87171;

    --shadow: 0 18px 50px rgba(0,0,0,.35);
    --shadow-sm: 0 10px 30px rgba(0,0,0,.28);
}

/* ── 2) Base resets ──────────────────────────────── */

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

html { scroll-behavior: smooth; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
p { margin: 0.75rem 0; }
ul { margin: 0; padding-left: 1.2rem; }

/* ── 3) Layout helpers ───────────────────────────── */

.container {
    width: min(1100px, calc(100vw - 2rem));
    margin-inline: auto;
}

#appMainContainer {
    position: relative;
}

.section {
    padding: clamp(2.25rem, 5vw, 4rem) 0;
}

.mt-xl { margin-top: 1.25rem; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.w-100 { width: 100%; }

.grid-1 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }

@media (max-width: 900px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ── Privacy page ────────────────────────────────── */

.privacy-page {
    max-width: 760px;
}

.privacy-page h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
}

.privacy-page h2 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.privacy-updated {
    color: var(--muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.privacy-page ul {
    line-height: 1.75;
}

.privacy-page a {
    color: var(--accent);
    text-decoration: underline;
}

.privacy-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin-top: 0.75rem;
}

.privacy-table th,
.privacy-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.privacy-table th {
    font-weight: 600;
    color: var(--muted);
}

.privacy-table code {
    font-size: 0.8rem;
    background: var(--bgElev2);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

/* ── 4) Typography ───────────────────────────────── */

.h1 {
    font-size: clamp(2.3rem, 4.5vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin: 0;
    font-weight: 850;
}

.h2 {
    font-size: clamp(1.6rem, 2.5vw, 2.1rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin: 0;
    font-weight: 800;
}

.lead {
    margin-top: .55rem;
    color: var(--muted);
    font-size: 1.05rem;
}

/* ── 5) Buttons ──────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .6rem .95rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-weight: 650;
    letter-spacing: -0.01em;
    cursor: pointer;
    user-select: none;
    transition: transform .08s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.btn:hover {
    background: color-mix(in srgb, var(--bgElev) 82%, var(--text) 18%);
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--accent) 92%, #0000),
        color-mix(in srgb, var(--accent2) 55%, #0000)
    );
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover { box-shadow: var(--shadow); }

.btn-ghost { background: transparent; }

.btn-lg { padding: .75rem 1.1rem; border-radius: 16px; }

/* ── 6) Page shell (inherited by all layouts) ───── */

.page-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background:
        radial-gradient(1200px 800px at 15% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent),
        radial-gradient(900px 600px at 80% 0%, color-mix(in srgb, var(--accent2) 16%, transparent), transparent),
        var(--bg);
}

.page-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ── 6b) Site header & nav pill ──────────────────── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 0.75rem 0.5rem 0;
    background: transparent;
}

.nav-pill {
    width: min(90vw, 1500px);
    margin-inline: auto;
    padding: .85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--bgElev);
    backdrop-filter: none;
    box-shadow: var(--shadow-sm);
}

/* ── 7) Site footer ──────────────────────────────── */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    background: var(--bg);
}

/* ── 8) Focus ────────────────────────────────────── */

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 2px;
    border-radius: 14px;
}

/* ── 9) Syncfusion overrides ─────────────────────── */

html[data-theme="light"] .e-btn.e-outline {
    border-color: rgba(17, 24, 39, 0.20) !important;
}

/* ── 10) App shell (MainLayout) ──────────────────── */

.app-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.grid-container {
    margin-top: 1rem;
}

.content-area {
    padding: 2rem;
    width: 100%;
}

.sidebar-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.sidebar-nav { flex: 1; }

.sidebar-footer { padding-bottom: 1rem; }

.footer-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
}

.footer-icon {
    width: 30px;
    text-align: center;
    font-size: 1.2rem;
}

::deep .e-sidebar.e-close .footer-text,
::deep .e-sidebar.e-close .user-info {
    display: none;
}

/* ── 11) Utilities ───────────────────────────────── */

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.switch-label {
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

/* ── 12) Section page wrapper ────────────────────── */

.section-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 0.75rem;
    padding-bottom: 1rem;
    flex: 1 1 0;
    min-height: 0;
    width: min(1100px, calc(100vw - 2rem));
    margin-inline: auto;
}

.section-header h3 { margin: 0; }

.section-header p {
    margin: .25rem 0 0;
    color: var(--muted, #6c757d);
}

.actions-menu {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
    min-width: 0;
}

/* ── 13) Section layout ──────────────────────────── */

.section-layout {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: .5rem;
    align-items: start;
    flex: 1 1 0;
    min-height: 0;
}

.section-layout > .section-main { align-self: stretch; }

.section-side-nav {
    position: sticky;
    top: 20px;
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
}

.section-main {
    min-width: 0;
    border: 1px solid var(--border, #dee2e6);
    border-radius: 16px;
    background: var(--bgElev, #fff);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.section-main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border, #dee2e6);
    flex-shrink: 0;
}

.section-main-header h4 { margin: 0; }

.section-main-header p {
    margin: .25rem 0 0;
    color: var(--muted, #6c757d);
}

.section-main-body {
    position: relative;
    padding: 1.25rem;
    min-width: 0;
    flex: 1 1 0;
    overflow: auto;
}

@media (max-width: 900px) {
    .section-layout { grid-template-columns: 1fr; }
    .section-side-nav { position: static; }
}

/* ── 14) Trip components ─────────────────────────── */

.trip-merged-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 4px;
    background: color-mix(in srgb, var(--primary, #6366f1) 12%, transparent);
    color: var(--primary, #6366f1);
    flex-shrink: 0;
}

.trip-merged-badge .e-icons {
    font-size: .65rem;
    line-height: 1;
}

.trip-action-btn .e-caret,
.trip-action-btn .e-btn-icon { display: none !important; }

/* ── 15) Section menu ────────────────────────────── */

.section-menu.e-menu-wrapper,
.section-menu.e-menu-container {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.section-menu.e-menu-wrapper ul.e-menu,
.section-menu.e-menu-container ul.e-menu {
    width: 100%;
    padding: 0;
    background: transparent;
}

.section-menu.e-menu-wrapper .e-menu-item,
.section-menu.e-menu-container .e-menu-item {
    width: 100%;
    min-height: 36px;
    height: 36px;
    border-radius: 10px;
    margin-bottom: .25rem;
}

.section-menu.e-menu-wrapper .e-menu-item .e-menu-url,
.section-menu.e-menu-container .e-menu-item .e-menu-url,
.section-menu.e-menu-wrapper .e-menu-item .e-menu-text,
.section-menu.e-menu-container .e-menu-item .e-menu-text {
    line-height: 36px;
    font-size: .9rem;
}

.section-menu.e-menu-wrapper .e-menu-item .e-menu-icon,
.section-menu.e-menu-container .e-menu-item .e-menu-icon {
    font-size: .95rem;
    line-height: 36px;
}

.section-menu.e-menu-wrapper .e-menu-item.e-selected,
.section-menu.e-menu-container .e-menu-item.e-selected,
.section-menu.e-menu-wrapper .e-menu-item.e-focused,
.section-menu.e-menu-container .e-menu-item.e-focused {
    background: color-mix(in srgb, var(--accent, #0d6efd) 14%, transparent);
}

/* ── 16) Section slide-in panel ──────────────────── */

.section-panel {
    border-radius: 18px 0 0 18px;
    overflow: hidden;
}

.section-panel-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100vh;
    background: var(--bgElev, #fff);
}

.section-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.section-panel-header h4 { margin: 0 0 .25rem 0; }

.section-panel-header p {
    margin: 0;
    color: var(--muted, #6b7280);
}

.section-panel-content {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1.5rem;
}

.section-panel-footer {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border, #e5e7eb);
    background: var(--bgElev, #fff);
}

.section-panel-footer-spacer { flex: 1 1 auto; }

@media (max-width: 640px) {
    .section-panel {
        width: 100% !important;
        max-width: 100vw;
        border-radius: 0;
    }
}

/* ── 17) Vehicle pill ────────────────────────────── */

.veh-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    line-height: 1;
    white-space: nowrap;
}

.veh-meta {
    opacity: 0.9;
    font-size: 12px;
}

.map-fullscreen-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1000;
    width: 30px;
    height: 30px;
    background: #fff;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #333;
    padding: 0;
}

.map-fullscreen-btn:hover {
    background: #f4f4f4;
}

#trips-route-map:fullscreen,
#share-route-map:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
}

/* ── 18) Landing page ────────────────────────────── */


.hero {
    padding: clamp(2.5rem, 6vw, 4.5rem) 0 1rem;
}

.hero-title {
    font-size: clamp(2.3rem, 4.5vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin: 0;
    font-weight: 850;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    align-items: center;
    gap: 2rem;
}

@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; }
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .35rem .6rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bgElev) 90%, transparent);
    color: var(--muted);
    font-weight: 650;
    width: fit-content;
}

.hero-subtitle {
    margin-top: .65rem;
    font-size: 1.15rem;
    color: var(--muted);
}

.hero-meta {
    margin-top: .65rem;
    color: var(--muted);
    font-weight: 650;
}

.dot { opacity: .55; margin: 0 .25rem; }

.hero-actions {
    margin-top: 1.1rem;
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: center;
}

.hero-footnote { margin-top: .9rem; }

.hero-visual {
    display: flex;
    justify-content: flex-end;
}

.route-card {
    width: min(420px, 100%);
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--bgElev) 88%, transparent), var(--bgElev));
    box-shadow: var(--shadow);
    padding: 1rem;
}

.route-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: .25rem .55rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bgElev2) 92%, transparent);
    font-weight: 700;
    color: var(--text);
    font-size: .9rem;
}

.route-line {
    height: 1px;
    background: var(--border);
    margin: 1rem 0;
}

.route-points { display: grid; gap: .85rem; }

.pt { display: grid; grid-template-columns: 18px 1fr; gap: .65rem; align-items: start; }
.pt-title { font-weight: 750; letter-spacing: -0.01em; }

.pin {
    width: 12px; height: 12px;
    margin-top: .25rem;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}

.pin2 { background: color-mix(in srgb, var(--accent2) 75%, var(--accent)); }
.pin3 { background: color-mix(in srgb, var(--accent) 65%, #22c55e); }

.route-bottom {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.metric-value {
    font-weight: 850;
    letter-spacing: -0.02em;
    font-size: 1.1rem;
}

.list {
    margin: .75rem 0 1rem;
    padding-left: 1.15rem;
    color: var(--muted);
}

.list li { margin: .35rem 0; }

.price {
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    margin: .75rem 0 .25rem;
    color: var(--text);
}

.price span {
    font-size: 1rem;
    font-weight: 700;
    color: var(--muted);
    margin-left: .25rem;
}

.price-sub { margin-top: 0; }
.hardware { margin: .75rem 0 1rem; }
.price-note { margin-top: .75rem; font-size: .92rem; }

/* Fallback global styles for home page sections (applies if scoped CSS doesn't match) */
.pricing-section {
    min-height: 100vh;
    padding: 95px 24px 120px;
    background: url('/img/White_BG.jpg') center/cover no-repeat !important;
}

.how-section {
    min-height: 100vh;
    padding: 120px 24px;
    background: url('/img/Dark_Green_BG.jpg') center/cover no-repeat !important;
    display: flex;
    align-items: center;
    color: #fff;
}

.problem-section {
    min-height: 100vh;
    padding: 140px 24px 90px;
    background: url('/img/White_BG_Dots.jpg') center/cover no-repeat !important;
    display: flex;
    align-items: center;
}

@media (max-width: 1120px) {
    .pricing-section { padding: 80px 28px 100px; }
    .how-section { padding: 100px 24px; }
    .problem-section { padding: 120px 24px 80px; }
}

@media (max-width: 720px) {
    .pricing-section { padding: 70px 18px 90px; }
    .how-section { padding: 85px 18px; }
    .problem-section { padding: 95px 18px 70px; }
}
