/* Road Trip Daily - Public site styles */

* { box-sizing: border-box; }

:root {
    --tab-bar-h: 60px;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    margin: 0;
    color: #2d3748;
    background: #fff;
    line-height: 1.5;
}
body.has-bottom-tabs {
    padding-bottom: 0;
}
@media (max-width: 720px) {
    body.has-bottom-tabs {
        padding-bottom: calc(var(--tab-bar-h) + env(safe-area-inset-bottom, 0));
    }
}

a { color: #2b6cb0; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ====================================================================
   Top nav (desktop primary, minimal on mobile)
   ==================================================================== */

.topnav {
    background: #1a1a1a;
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.topnav .brand {
    color: white;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.topnav .brand svg { display: block; height: 36px; width: auto; }
.topnav .brand:hover { text-decoration: none; opacity: 0.9; }
.topnav-links {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    font-size: 0.95rem;
}
.topnav-links a { color: rgba(255,255,255,0.85); padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.topnav-links a:hover { color: white; text-decoration: none; }
.topnav-links a.active { color: white; border-bottom-color: #c8102e; }
.topnav-sep { color: rgba(255,255,255,0.3); }
.topnav-user { color: rgba(255,255,255,0.6); font-size: 0.85rem; }
.topnav .cta {
    background: #c8102e;
    color: white !important;
    padding: 0.4rem 0.95rem;
    border-radius: 4px;
    font-weight: 600;
    border-bottom: none !important;
}
.topnav .cta:hover { background: #a30d24; }

/* On mobile, hide the desktop nav links - the bottom tab bar takes over */
@media (max-width: 720px) {
    .topnav-links { display: none; }
    .topnav { padding: 0.6rem 1rem; }
    .topnav .brand { font-size: 1rem; }
    .topnav .brand svg { height: 30px; }
}

/* ====================================================================
   Bottom tab bar (mobile only)
   ==================================================================== */

.bottomtabs {
    display: none;
}
@media (max-width: 720px) {
    .bottomtabs {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: white;
        border-top: 1px solid #e2e8f0;
        padding-bottom: env(safe-area-inset-bottom, 0);
        box-shadow: 0 -1px 8px rgba(0,0,0,0.04);
    }
    .bottomtabs a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.5rem 0.25rem;
        height: var(--tab-bar-h);
        color: #718096;
        font-size: 0.7rem;
        text-decoration: none;
        gap: 0.15rem;
    }
    .bottomtabs a:hover { text-decoration: none; }
    .bottomtabs a.active { color: #c8102e; }
    .bottomtabs a svg { display: block; }
}

/* ====================================================================
   Page containers
   ==================================================================== */

.container { max-width: 1000px; margin: 0 auto; padding: 2rem 1.5rem; }
.container-wide { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.5rem; }
.container-narrow { max-width: 560px; margin: 0 auto; padding: 2rem 1.5rem; }

@media (max-width: 720px) {
    .container, .container-wide, .container-narrow { padding: 1.25rem 1rem; }
}

/* ====================================================================
   Legacy hero (top of landing/marketing)
   ==================================================================== */

.hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    padding: 4rem 1.5rem 3rem;
    text-align: center;
}
.hero h1 { font-size: 2.5rem; margin: 0 0 0.75rem; letter-spacing: -0.02em; }
.hero p { font-size: 1.15rem; color: rgba(255,255,255,0.9); max-width: 640px; margin: 0 auto 1.5rem; }
.hero .btn-primary {
    background: #c8102e; color: white;
    padding: 0.85rem 1.75rem;
    font-size: 1rem; font-weight: 600;
    border-radius: 4px; display: inline-block;
}
.hero .btn-primary:hover { background: #a30d24; text-decoration: none; }
.hero .btn-secondary { color: white; padding: 0.85rem 1.5rem; margin-left: 0.5rem; font-weight: 500; }
.hero .btn-secondary:hover { text-decoration: underline; }

@media (max-width: 720px) {
    .hero { padding: 2.5rem 1rem 2rem; }
    .hero h1 { font-size: 1.75rem; }
    .hero p { font-size: 1rem; }
}

/* ====================================================================
   Route cards (homepage grid)
   ==================================================================== */

.route-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.route-card {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.route-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    border-color: #cbd5e0;
    text-decoration: none;
}
.route-card-image {
    aspect-ratio: 16 / 9;
    background: #edf2f7 center/cover no-repeat;
    position: relative;
}
.route-card-image.placeholder {
    background: linear-gradient(135deg, #1a1a1a 0%, #c8102e 100%);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 700; letter-spacing: 0.02em;
    text-align: center; padding: 1rem;
}
.route-card-body {
    padding: 1rem 1.25rem 1.25rem;
    display: flex; flex-direction: column; gap: 0.4rem;
    flex: 1;
}
.route-card-body h3 { margin: 0; color: #1a1a1a; font-size: 1.1rem; }
.route-card-body p { margin: 0; color: #4a5568; font-size: 0.9rem; }
.route-card-stats {
    display: flex; gap: 0.35rem; flex-wrap: wrap;
    margin-top: auto; padding-top: 0.6rem;
    font-size: 0.72rem;
}
.route-card-stats .pill {
    background: #edf2f7; color: #4a5568;
    padding: 0.18rem 0.55rem; border-radius: 999px;
    font-weight: 600;
}

/* ====================================================================
   Route detail page hero
   ==================================================================== */

.route-hero {
    position: relative;
    min-height: 260px;
    background-size: cover;
    background-position: center;
    color: white;
    display: flex; align-items: flex-end;
}
.route-hero-plain {
    background: linear-gradient(135deg, #1a1a1a 0%, #c8102e 100%);
}
.route-hero-overlay {
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.15) 70%, transparent 100%);
    padding: 3rem 1.5rem 1.5rem;
}
.route-hero h1 {
    margin: 0 auto;
    max-width: 1000px;
    font-size: 2.25rem;
    letter-spacing: -0.02em;
    line-height: 1.15;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.route-hero .tagline {
    margin: 0.5rem auto 0;
    max-width: 1000px;
    font-size: 1.05rem;
    color: rgba(255,255,255,0.95);
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
@media (max-width: 720px) {
    .route-hero { min-height: 200px; }
    .route-hero-overlay { padding: 2rem 1rem 1rem; }
    .route-hero h1 { font-size: 1.6rem; }
    .route-hero .tagline { font-size: 0.95rem; }
}

/* ====================================================================
   Route detail page body
   ==================================================================== */

.route-stats {
    display: flex; gap: 1.5rem; justify-content: center;
    margin: 2rem 0 1.5rem;
    flex-wrap: wrap;
}
.route-stats .stat { text-align: center; min-width: 100px; }
.route-stats .stat-num { font-size: 2rem; font-weight: 700; color: #1a1a1a; line-height: 1; }
.route-stats .stat-label { font-size: 0.8rem; color: #718096; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.2rem; }

.route-cta {
    display: flex; gap: 0.75rem; justify-content: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}
.route-cta .btn-primary,
.route-cta .btn-secondary {
    padding: 0.85rem 1.75rem;
    font-size: 1rem; font-weight: 600;
    border-radius: 4px;
    display: inline-block;
    text-align: center;
}
.route-cta .btn-primary { background: #c8102e; color: white; }
.route-cta .btn-primary:hover { background: #a30d24; text-decoration: none; }
.route-cta .btn-secondary { background: #edf2f7; color: #4a5568; }
.route-cta .btn-secondary:hover { background: #e2e8f0; text-decoration: none; }

.route-description { margin: 2rem 0; font-size: 1.02rem; color: #4a5568; max-width: 720px; }
.route-description p { margin: 0; }

.route-map-section { margin: 2rem 0; }
.route-map-section h2, .route-waypoints h2 { margin: 0 0 0.75rem; font-size: 1.35rem; color: #1a1a1a; }
.route-map-section #map { height: 420px; }

.route-waypoints { margin: 2rem 0; }

.wp-list {
    display: flex; flex-direction: column;
    border-top: 1px solid #e2e8f0;
}
.wp-list-item {
    display: flex; gap: 1rem; align-items: flex-start;
    padding: 0.9rem 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    text-decoration: none; color: inherit;
    transition: background 0.15s;
}
.wp-list-item:hover { background: #f7fafc; text-decoration: none; }
.wp-mile {
    background: #1a1a1a;
    color: white;
    width: 3rem; min-width: 3rem; height: 3rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    font-weight: 700; font-size: 1rem;
}
.wp-info { flex: 1; min-width: 0; }
.wp-name { font-weight: 600; font-size: 1rem; color: #1a1a1a; }
.wp-blurb { color: #4a5568; font-size: 0.9rem; margin-top: 0.2rem; }
.wp-cat { color: #718096; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.25rem; }

/* ====================================================================
   Features grid (legacy)
   ==================================================================== */

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}
.feature h3 { margin: 0 0 0.4rem; font-size: 1.05rem; color: #1a1a1a; }
.feature p { margin: 0; color: #4a5568; font-size: 0.95rem; }

/* Sections */
.section { padding: 3rem 0; border-top: 1px solid #e2e8f0; }
.section h2 { font-size: 1.6rem; margin: 0 0 1.25rem; color: #1a1a1a; }

/* ====================================================================
   Cards (legacy generic)
   ==================================================================== */

.card {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: background 0.15s, transform 0.15s;
}
.card:hover { background: #edf2f7; text-decoration: none; transform: translateY(-2px); }
.card h3 { margin: 0 0 0.4rem; color: #c8102e; }
.card p { margin: 0; color: #4a5568; font-size: 0.9rem; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

/* ====================================================================
   Forms
   ==================================================================== */

.form-box {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 2rem;
    max-width: 460px;
    margin: 2rem auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.form-box h1 { margin: 0 0 1.5rem; font-size: 1.4rem; text-align: center; }

label {
    display: block;
    margin-top: 1.15rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #4a5568;
}
.hint {
    font-weight: normal;
    color: #718096;
    font-size: 0.82rem;
    margin-top: 0.15rem;
    display: block;
}
input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], input[type=date], input[type=range], select, textarea {
    width: 100%;
    padding: 0.65rem;
    margin-top: 0.35rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}
input[type=range] { padding: 0; }
textarea { min-height: 90px; resize: vertical; }

.btn {
    display: inline-block;
    padding: 0.7rem 1.25rem;
    background: #c8102e;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}
.btn:hover { background: #a30d24; text-decoration: none; }
.btn-secondary { background: #edf2f7; color: #4a5568; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: #c53030; }
.btn-danger:hover { background: #9b2c2c; }
.btn-block { display: block; width: 100%; margin-top: 1.5rem; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }

.actions { margin-top: 1.75rem; }

.errors, .success {
    padding: 0.9rem 1.15rem;
    border-radius: 4px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}
.errors { background: #fed7d7; color: #742a2a; border-left: 4px solid #c53030; }
.success { background: #c6f6d5; color: #22543d; border-left: 4px solid #38a169; }
.errors ul, .success ul { margin: 0.5rem 0 0; padding-left: 1.5rem; }

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #718096;
}

/* ====================================================================
   Footer
   ==================================================================== */

footer.site-footer {
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    padding: 2rem 1.5rem;
    text-align: center;
    color: #718096;
    font-size: 0.85rem;
    margin-top: 3rem;
}
footer.site-footer p { margin: 1rem 0 0; }
.footer-logo {
    display: inline-block;
    line-height: 0;
    opacity: 0.75;
    transition: opacity 0.2s;
}
.footer-logo:hover { opacity: 1; text-decoration: none; }
.footer-logo svg { display: block; height: 90px; width: auto; }
.footer-links { margin: 0.75rem 0; font-size: 0.9rem; }
.footer-links a { color: #4a5568; }

@media (max-width: 720px) {
    footer.site-footer { padding: 1.5rem 1rem; margin-top: 2rem; }
    .footer-logo svg { height: 60px; }
}

/* ====================================================================
   Utility
   ==================================================================== */

.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mt-1 { margin-top: 1rem; }
.muted { color: #718096; }
.small { font-size: 0.85rem; }

/* ====================================================================
   Trip dashboard (existing)
   ==================================================================== */

.trip-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    padding: 1.5rem;
}
.trip-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}
.trip-header h1 { margin: 0 0 0.25rem; font-size: 1.4rem; }
.trip-header .trip-sub {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}
.trip-header .trip-sub a { color: rgba(255,255,255,0.85); }
.trip-header-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.trip-header-actions .btn {
    background: rgba(255,255,255,0.15);
    color: white;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}
.trip-header-actions .btn:hover { background: rgba(255,255,255,0.25); }

.progress-bar {
    max-width: 1200px;
    margin: 1rem auto 0;
    height: 8px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar > div {
    height: 100%;
    background: #ed8936;
    transition: width 0.4s;
}
.progress-label {
    max-width: 1200px;
    margin: 0.4rem auto 0;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    display: flex;
    justify-content: space-between;
}

.dashboard {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
}
@media (max-width: 900px) {
    .dashboard { grid-template-columns: 1fr; }
}

.dash-main > section { margin-bottom: 2rem; }
.dash-side > section { margin-bottom: 1.25rem; }

.panel {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
}
.panel h2 {
    margin: 0 0 0.9rem;
    font-size: 1.05rem;
    color: #1a1a1a;
    display: flex; justify-content: space-between; align-items: center;
    gap: 0.5rem;
}
.panel h2 .sub {
    font-size: 0.8rem;
    font-weight: normal;
    color: #718096;
}

#map {
    width: 100%;
    height: 380px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    z-index: 0;
}

.quick-add {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.quick-add a {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    text-decoration: none;
    color: #2d3748;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
}
.quick-add a:hover { background: #edf2f7; border-color: #cbd5e0; transform: translateY(-1px); text-decoration: none; }
.quick-add .qa-icon { display: block; font-size: 1.5rem; margin-bottom: 0.15rem; }

.log-entry {
    border-left: 3px solid #ed8936;
    padding: 0.75rem 1rem;
    background: #f7fafc;
    border-radius: 0 6px 6px 0;
    margin-bottom: 0.75rem;
}
.log-entry .meta {
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 0.25rem;
}
.log-entry .title { font-weight: 600; }
.log-entry .note { font-size: 0.9rem; color: #4a5568; margin-top: 0.25rem; }

.log-empty {
    background: #f7fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    color: #718096;
    font-size: 0.9rem;
}

.upcoming-city {
    margin-top: 1.25rem;
}
.upcoming-city:first-child { margin-top: 0; }
.upcoming-city h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: #2c5282;
    display: flex; align-items: center; gap: 0.4rem;
}
.upcoming-city h3 .distance {
    font-size: 0.8rem;
    color: #718096;
    font-weight: normal;
}
.upcoming-item {
    display: block;
    padding: 0.65rem 0.9rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 0.4rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.upcoming-item:hover { background: #f7fafc; text-decoration: none; }
.upcoming-item .item-title {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex; justify-content: space-between; gap: 0.5rem;
}
.upcoming-item .item-cat {
    font-size: 0.75rem;
    color: #718096;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.upcoming-item .item-blurb { font-size: 0.85rem; color: #4a5568; margin-top: 0.15rem; }
.upcoming-item .item-distance { font-size: 0.75rem; color: #718096; margin-top: 0.2rem; }

.progress-control label { margin-top: 0.5rem; }
.progress-control .row { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.progress-control .row select { flex: 1; margin-top: 0; }
.progress-control .btn-gps {
    background: #2c5282;
    color: white;
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}
.progress-control .btn-gps:hover { background: #2b6cb0; }
.progress-control .btn-gps:disabled { opacity: 0.5; cursor: not-allowed; }
.progress-control .gps-status {
    font-size: 0.8rem;
    color: #718096;
    margin-top: 0.4rem;
    min-height: 1em;
}

.range-row { display: flex; gap: 0.75rem; align-items: center; }
.range-row input[type=range] { flex: 1; }
.range-row .range-val { font-weight: 600; font-size: 0.9rem; min-width: 3.5rem; text-align: right; }

/* ====================================================================
   Menu page (mobile-first hub)
   ==================================================================== */

.menu-list {
    display: flex; flex-direction: column;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 1rem;
}
.menu-list a, .menu-list .item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem;
    color: #1a1a1a;
    text-decoration: none;
    border-bottom: 1px solid #e2e8f0;
    font-size: 1rem;
    transition: background 0.15s;
}
.menu-list a:last-child, .menu-list .item:last-child { border-bottom: none; }
.menu-list a:hover { background: #f7fafc; text-decoration: none; }
.menu-list .item.user { color: #718096; background: #f7fafc; font-size: 0.9rem; }
.menu-list .chev { color: #cbd5e0; font-size: 1.1rem; }