/* =========================================
   MS MOTORMATE - PREMIUM MIDNIGHT THEME
   ========================================= */

:root {
    /* Core Palette: Midnight & Neon */
    --bg-body: #050505;
    --bg-card: #101010;
    --bg-glass: rgba(20, 20, 20, 0.7);
    --border-glass: rgba(255, 255, 255, 0.08);

    --primary: #00e5ff;
    /* Cyan */
    --primary-glow: rgba(0, 229, 255, 0.4);
    --secondary: #00ff9d;
    /* Greenish Teal */

    --accent-red: #ff3366;
    --accent-gold: #ffb700;

    --text-main: #ffffff;
    --text-muted: #a1a1aa;

    --font-main: system-ui, 'Poppins', -apple-system, sans-serif;

    --radius-l: 24px;
    --radius-m: 16px;
    --radius-s: 12px;
}

/* Base Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

body {
    background-color: var(--bg-body);
    /* Subtle mesh gradient background */
    background-image:
        radial-gradient(circle at 10% 20%, rgba(0, 229, 255, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 255, 157, 0.03) 0%, transparent 40%);
    color: var(--text-main);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    padding-bottom: 80px;
    /* Space for FAB */
}

body.splash-done {
    overflow-y: auto;
}

main {
    max-width: 540px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 10px;
}

/* =========================================
   TYPOGRAPHY & UTILS
   ========================================= */
h1,
h2,
h3 {
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.02em;
}

p {
    margin: 0;
    color: var(--text-muted);
}

.section-title {
    font-size: 18px;
    margin: 24px 0 12px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
    display: inline-block;
    box-shadow: 0 0 8px var(--primary);
}

.tab-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* =========================================
   HEADER
   ========================================= */
header {
    text-align: center;
    margin-bottom: 20px;
    padding-top: 10px;
}

header h1 {
    font-size: 26px;
    background: linear-gradient(135deg, #fff 30%, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    font-size: 13px;
    opacity: 0.7;
    margin-top: 4px;
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    position: relative;
}

/* Profile / Cloud Button */
.profile-img-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #1a1a1a;
    border: 1px solid var(--border-glass);
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    overflow: hidden;
    transition: 0.3s;
}

.profile-img-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.profile-img-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.install-btn {
    background: #1a1a1a;
    color: var(--primary);
    border: 1px solid var(--border-glass);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================
   NAVIGATION (TABS)
   ========================================= */
nav {
    display: flex;
    background: #151515;
    padding: 6px;
    border-radius: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border-glass);
    overflow-x: auto;
    gap: 5px;
}

.tab-btn {
    flex: 1;
    text-align: center;
    padding: 10px 16px;
    border-radius: 14px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.3s;
}

.tab-btn.active {
    background: #252525;
    color: var(--primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    font-weight: 600;
}

.tab {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   CARDS & GRID
   ========================================= */
.card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-m);
    padding: 16px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    /* Subtle Shine */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
}

.card h3 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.card p {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

/* =========================================
   DASHBOARD COMPONENTS
   ========================================= */
/* Quick Find */
.quick-btn {
    flex: 0 0 auto;
    padding: 12px 18px;
    background: #1a1a1a;
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    border-radius: 30px;
    font-size: 13px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}

.quick-btn:hover {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Vehicle Bar */
.vehicle-bar {
    background: linear-gradient(135deg, #111, #1a1a1a);
    padding: 16px 20px;
    border-radius: var(--radius-l);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-glass);
    margin-bottom: 20px;
    position: relative;
}

.vehicle-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.vehicle-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.vehicle-edit-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-glass);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.vehicle-edit-btn:hover {
    background: var(--primary);
    color: #000;
}

/* Vehicle Switcher */
.vehicle-switcher {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f0f0f;
    padding: 10px 14px;
    border-radius: var(--radius-m);
    margin-bottom: 16px;
    border: 1px solid var(--border-glass);
}

.vehicle-switcher-left span {
    font-size: 12px;
    color: var(--text-muted);
    margin-right: 8px;
}

.vehicle-switcher select {
    background: transparent;
    border: none;
    color: #fff;
    font-weight: 600;
    outline: none;
}

.vehicle-add-btn {
    background: var(--primary);
    color: #000;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

/* Care Reminders */
.care-reminders {
    background: #111;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-m);
    padding: 16px;
    margin-bottom: 20px;
}

.care-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.care-item:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.care-title {
    font-size: 14px;
    font-weight: 600;
}

.care-status {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.care-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--secondary);
    border: 1px solid var(--border-glass);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.care-btn:hover {
    background: var(--secondary);
    color: #000;
}

/* Charts */
.chart-wrapper {
    background: #111;
    padding: 12px;
    border-radius: var(--radius-m);
    border: 1px solid var(--border-glass);
    margin-bottom: 16px;
}

/* =========================================
   FORMS & LISTS
   ========================================= */
.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

input,
select {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    background: #1a1a1a;
    border: 1px solid var(--border-glass);
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
}

input:focus,
select:focus {
    border-color: var(--primary);
}

.primary-btn {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, var(--primary), #00b8d4);
    color: #000;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--primary-glow);
    margin-top: 10px;
}

.primary-btn:active {
    transform: scale(0.98);
}

.danger-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: rgba(255, 51, 102, 0.1);
    color: var(--accent-red);
    font-weight: 600;
    margin-top: 10px;
    cursor: pointer;
    border: 1px solid rgba(255, 51, 102, 0.2);
}

.entry {
    background: #151515;
    padding: 12px;
    border-radius: 12px;
    border-left: 3px solid var(--primary);
    margin-bottom: 8px;
    font-size: 13px;
}

/* =========================================
   FAB (FLOATING BUTTON)
   ========================================= */
.fab-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 800;
}

.fab-main {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #000;
    font-size: 28px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--primary-glow);
}

.fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: 0.3s;
}

.fab-container.open .fab-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.fab-item {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #222;
    border: 1px solid var(--border-glass);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   MODALS
   ========================================= */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
}

.modal-content {
    width: 90%;
    max-width: 400px;
    max-height: 85vh;
    overflow-y: auto;
    background: #111;
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: transparent;
    border: 1px solid var(--border-glass);
    color: #fff;
    border-radius: 12px;
    cursor: pointer;
}

/* Auth / Cloud Modal Specifics */
.auth-tabs {
    display: flex;
    background: #222;
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    border-radius: 8px;
}

.auth-tab.active {
    background: #333;
    color: #fff;
    font-weight: 600;
}

/* =========================================
   SPLASH SCREEN
   ========================================= */
#splash {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.5s;
}

.splash-logo {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 900;
    margin: 0 auto 20px;
    box-shadow: 0 0 30px var(--primary-glow);
}

.splash-title {
    font-size: 24px;
    color: #fff;
    letter-spacing: 2px;
}

.splash-subtitle {
    color: var(--secondary);
    font-size: 14px;
    letter-spacing: 1px;
}

body.splash-done #splash {
    opacity: 0;
    pointer-events: none;
}

/* =========================================
   TOAST
   ========================================= */
.toast {
    background: #222;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-size: 13px;
}

/* Missing Functional Utils */
#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    margin-bottom: 10px;
}

/* Vehicle Type Toggle */
.type-switcher {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: #222;
    padding: 4px;
    border-radius: 12px;
}

.type-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
}

.type-btn.active {
    background: var(--primary);
    color: #000;
    font-weight: 700;
}

/* Export Button */
.export-btn {
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    background: transparent;
    border: 1px dashed var(--text-muted);
    color: var(--text-muted);
    border-radius: 12px;
    cursor: pointer;
    font-size: 12px;
}

.export-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}


/* Fix: Save Button Style */
.save-vehicle-btn {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, var(--primary), #00b8d4);
    color: #000;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--primary-glow);
    margin-top: 10px;
}

.save-vehicle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

/* Fix: Vehicle Select Option Background */
select option {
    background-color: #111;
    color: #fff;
    padding: 10px;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.08),
            rgba(255, 255, 255, 0.02));
    color: #e5e7eb;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.25s ease;
}

.logout-btn:hover {
    background: linear-gradient(135deg,
            rgba(239, 68, 68, 0.25),
            rgba(239, 68, 68, 0.1));
    border-color: rgba(239, 68, 68, 0.6);
    color: #fee2e2;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

.logout-btn:active {
    transform: scale(0.97);
}

.logout-icon {
    font-size: 13px;
    opacity: 0.85;
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.08),
            rgba(255, 255, 255, 0.02));
    color: #e5e7eb;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
    white-space: nowrap;
}

.logout-btn:hover {
    background: linear-gradient(135deg,
            rgba(239, 68, 68, 0.25),
            rgba(239, 68, 68, 0.1));
    border-color: rgba(239, 68, 68, 0.6);
    color: #fee2e2;
}