/* 3DM Resources — Customer-facing styles
   Sibling to 3dmmotorsport.com: shared dark nav + orange accents,
   light body to signal "Resources, not Store" */

:root {
    /* Brand — matches eCommerce */
    --color-dark: #111111;
    --color-dark-surface: #1a1a1a;
    --color-orange: #ffa500;
    --color-orange-hover: #ffb733;

    /* Resources — light body differentiator */
    --color-bg: #ffffff;
    --color-surface: #f5f5f7;
    --color-border: #e0e0e0;
    --color-text: #1a1a1a;
    --color-text-muted: #6b7280;
    --color-text-light: rgba(255, 255, 255, 0.7);
    --color-link: #d48800;

    /* Status colors */
    --color-service: #3b82f6;
    --color-change: #22c55e;
    --color-note: #6b7280;

    --radius: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.10);
    --max-width: 1040px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--color-link); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--color-orange); }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.topbar {
    background: var(--color-dark);
    border-bottom: 1px solid #222;
    padding: 0 24px;
    font-size: 0.75rem;
}
.topbar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 32px;
    color: var(--color-text-light);
}
.topbar-links { display: flex; gap: 16px; align-items: center; }
.topbar-links a { color: var(--color-text-light); font-size: 0.75rem; }
.topbar-links a:hover { color: white; }
.sign-in-link { color: var(--color-orange) !important; font-weight: 600; }
.sign-in-link:hover { color: var(--color-orange-hover) !important; }

/* ── Main nav ────────────────────────────────────────────────────────────── */
.nav {
    background: var(--color-dark-surface);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid var(--color-orange);
}
.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}
.nav-logo {
    height: 28px;
    width: auto;
    filter: brightness(1.8);
}
.nav-brand-text {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 2px;
    border-left: 1px solid #444;
    padding-left: 12px;
}
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius);
    transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: white; background: rgba(255, 255, 255, 0.08); }
.nav-links a.active { color: var(--color-orange); }
.nav-links a.coming-soon { opacity: 0.4; pointer-events: none; }

/* Nav dropdown (Instructions sub-menu) */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
}
.dropdown-arrow {
    font-size: 0.6rem;
    opacity: 0.6;
    transition: transform 0.15s;
}
.nav-dropdown:hover .dropdown-arrow { transform: rotate(180deg); }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--color-dark-surface);
    border: 1px solid #333;
    border-top: 2px solid var(--color-orange);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 6px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 200;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.dropdown-item {
    display: block;
    padding: 8px 18px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.83rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}
.dropdown-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}
.dropdown-view-all {
    border-bottom: 1px solid #333;
    margin-bottom: 4px;
    padding-bottom: 10px;
    font-weight: 600;
    color: var(--color-orange);
}
.dropdown-view-all:hover { color: var(--color-orange-hover); }
.nav-mobile-sub { display: none; }

/* Breadcrumb separator */
.breadcrumb-sep {
    color: var(--color-text-muted);
    margin: 0 6px;
}

/* Hamburger (mobile) */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    flex-direction: column;
    gap: 5px;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: 0.2s;
}

/* ── Main content ────────────────────────────────────────────────────────── */
.main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 36px 24px;
    width: 100%;
    flex: 1;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 56px 0 40px;
}
.hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--color-text);
}
.hero-sub {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ── Cards grid ──────────────────────────────────────────────────────────── */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-decoration: none;
    color: var(--color-text);
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.card:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--color-orange);
    transform: translateY(-2px);
}
.card-icon { font-size: 2rem; margin-bottom: 14px; }
.card h3 { margin-bottom: 8px; font-size: 1.05rem; font-weight: 600; }
.card p { color: var(--color-text-muted); font-size: 0.9rem; line-height: 1.5; }
.coming-soon-card { opacity: 0.5; pointer-events: none; position: relative; }
.badge-soon {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--color-text-muted);
    background: var(--color-border);
    padding: 3px 10px;
    border-radius: 3px;
}

/* ── Page headings ───────────────────────────────────────────────────────── */
h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 8px; color: var(--color-text); }
h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 12px; color: var(--color-dark); }
.page-sub { color: var(--color-text-muted); margin-bottom: 28px; font-size: 0.95rem; }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb { margin-bottom: 20px; }
.breadcrumb a { color: var(--color-link); font-size: 0.9rem; }
.breadcrumb a:hover { color: var(--color-orange); text-decoration: underline; }

/* ── Kit list (instructions index) ───────────────────────────────────────── */
.kit-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.kit-card {
    display: block;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px 24px;
    text-decoration: none;
    color: var(--color-text);
    transition: box-shadow 0.15s, border-color 0.15s;
}
.kit-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--color-orange);
}
.kit-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 3px; }
.kit-desc { color: var(--color-text-muted); font-size: 0.85rem; margin-bottom: 4px; }
.kit-meta {
    color: var(--color-text-light);
    font-size: 0.78rem;
    background: var(--color-dark);
    padding: 2px 8px;
    border-radius: 3px;
    display: inline-block;
}

/* ── Sections (detail page) ──────────────────────────────────────────────── */
.section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

/* ── Spec grid (spring rates, etc.) ──────────────────────────────────────── */
.spec-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 440px;
}
.spec-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.spec-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 4px;
}
.spec-value {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

/* ── Data tables ─────────────────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin-top: 8px;
    border-radius: var(--radius);
    overflow: hidden;
}
.data-table th {
    text-align: left;
    padding: 10px 14px;
    background: var(--color-dark);
    color: white;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border);
}
.data-table tr:nth-child(even) td { background: var(--color-surface); }
.data-table tr:hover td { background: #eef0f2; }
.mono {
    font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
    font-size: 0.83rem;
    color: var(--color-dark);
}

/* ── BOM category headers ────────────────────────────────────────────────── */
.bom-category { margin-top: 20px; }
.bom-cat-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-dark);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
    padding-left: 2px;
    border-left: 3px solid var(--color-orange);
    padding-left: 10px;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty {
    color: var(--color-text-muted);
    font-style: italic;
    padding: 48px 0;
    text-align: center;
}

/* ── Auth pages (login, register) ────────────────────────────────────────── */
.auth-container {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 40px 36px;
}
.auth-card h1 {
    text-align: center;
    margin-bottom: 4px;
}
.auth-sub {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 28px;
}
.auth-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    margin-bottom: 20px;
}
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-text);
}
.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color 0.15s;
}
.form-group input:focus {
    outline: none;
    border-color: var(--color-orange);
    box-shadow: 0 0 0 3px rgba(255, 165, 0, 0.1);
}
.form-group input::placeholder {
    color: #aaa;
}
.btn-primary {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--color-dark);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 24px;
}
.btn-primary:hover {
    background: #333;
}
.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.88rem;
    color: var(--color-text-muted);
}
.auth-footer a {
    color: var(--color-link);
    font-weight: 600;
}

/* ── My Vehicles list ────────────────────────────────────────────────────── */
.vehicle-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.vehicle-card {
    display: block;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px 24px;
    text-decoration: none;
    color: var(--color-text);
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.vehicle-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--color-orange);
    transform: translateY(-1px);
}
.vehicle-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.vehicle-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}
.vehicle-chassis {
    font-size: 0.78rem;
    background: var(--color-dark);
    color: var(--color-text-light);
    padding: 2px 10px;
    border-radius: 3px;
    font-weight: 500;
}
.vehicle-card-details {
    display: flex;
    gap: 16px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}
.empty-vehicles {
    text-align: center;
    padding: 60px 0 40px;
}
.empty-vehicles-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}
.empty-vehicles h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}
.empty-vehicles p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    max-width: 400px;
    margin: 0 auto;
}
.add-vehicle-section {
    margin-top: 24px;
}
.btn-outline {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}
.btn-outline:hover {
    border-color: var(--color-orange);
    color: var(--color-text);
}
.coming-soon-btn {
    opacity: 0.5;
    pointer-events: none;
}
.coming-soon-btn .badge-soon {
    margin-top: 0;
    margin-left: 8px;
    vertical-align: middle;
}

/* ── Vehicle detail — setup ──────────────────────────────────────────────── */
.setup-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: var(--color-dark);
    color: var(--color-orange);
    padding: 4px 12px;
    border-radius: 3px;
    margin-bottom: 20px;
}
.setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 8px;
}
.setup-group h3 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}
.ride-height-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.rh-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.rh-item {
    padding: 12px 14px;
}
.vehicle-notes {
    margin-top: 20px;
    padding: 14px 18px;
    background: var(--color-surface);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* ── Timeline (service log) ──────────────────────────────────────────────── */
.timeline {
    position: relative;
    padding-left: 28px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--color-border);
}
.timeline-entry {
    position: relative;
    padding-bottom: 24px;
}
.timeline-entry:last-child {
    padding-bottom: 0;
}
.timeline-marker {
    position: absolute;
    left: -28px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid var(--color-bg);
    z-index: 1;
}
.marker-service { background: var(--color-service); }
.marker-change { background: var(--color-change); }
.marker-note { background: var(--color-note); }
.timeline-content {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px 18px;
}
.timeline-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}
.timeline-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
}
.timeline-type {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    background: var(--color-border);
    padding: 2px 8px;
    border-radius: 3px;
}
.timeline-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.timeline-content p {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}
.timeline-service-ref {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--color-service);
    font-weight: 500;
}
.empty-log {
    padding: 32px 0;
    text-align: center;
}
.empty-log p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
    background: var(--color-dark);
    color: var(--color-text-light);
    padding: 48px 24px 0;
    margin-top: auto;
}
.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 36px;
}
.footer-logo {
    height: 36px;
    width: auto;
    margin-bottom: 12px;
    filter: brightness(1.6);
}
.footer-tagline {
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.5);
}
.footer-col h4 {
    color: white;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
}
.footer-col a {
    display: block;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
    margin-bottom: 8px;
    transition: color 0.15s;
}
.footer-col a:hover { color: var(--color-orange); }
.footer-col a.coming-soon { opacity: 0.35; pointer-events: none; }
.footer-bottom {
    border-top: 1px solid #333;
    padding: 18px 0;
    text-align: center;
}
.footer-bottom p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .topbar-inner span { display: none; }
    .nav-toggle { display: flex; }
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--color-dark-surface);
        flex-direction: column;
        padding: 12px 24px 20px;
        border-bottom: 2px solid var(--color-orange);
        gap: 4px;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 10px 0; }
    .nav-dropdown-menu { display: none !important; }
    .dropdown-arrow { display: none; }
    .nav-mobile-sub {
        display: flex;
        flex-direction: column;
        padding-left: 16px;
    }
    .nav-mobile-sub-item {
        color: rgba(255, 255, 255, 0.55);
        font-size: 0.8rem;
        padding: 6px 0;
    }
    .nav-mobile-sub-item:hover { color: var(--color-orange); }
    .hero { padding: 36px 0 28px; }
    .hero h1 { font-size: 1.6rem; }
    .main { padding: 24px 16px; }
    .spec-grid { grid-template-columns: 1fr; }
    .setup-grid { grid-template-columns: 1fr; gap: 24px; }
    .data-table { font-size: 0.8rem; }
    .data-table th, .data-table td { padding: 8px 10px; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .auth-card { padding: 28px 20px; }
}

@media (max-width: 480px) {
    .nav-brand-text { display: none; }
    .topbar-links { gap: 10px; }
}
