:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --secondary: #ec4899;
    --bg-dark: #020617;
    --card-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #64748b;
    --accent: #06b6d4;
    --warning: #f59e0b;
    --danger: #ef4444;
    --success: #10b981;
    --portal-width: 94%;
    --portal-max-width: 1400px;
    --portal-padding: 1.5rem;
}

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(236, 72, 153, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 1) 0%, transparent 100%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.container, .glass-nav {
    width: 94% !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
    display: block;
}

.container {
    padding: 0 !important;
}

.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    width: 100% !important;
    padding: 30px 1.5rem 100px 1.5rem !important;
    box-sizing: border-box !important;
}

@media (max-width: 850px) {
    .container {
        width: 94%;
        padding: 2rem 0;
    }
}

/* Premium Glassmorphism */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 2.5rem;
    padding: 2.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

@media (max-width: 850px) {
    .glass-card {
        border-radius: 2rem;
        padding: 2rem;
    }
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Typography */
h1, h2, h3 {
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Interactive Elements */
.btn {
    padding: 0.8rem 1.6rem;
    border-radius: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    text-decoration: none;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px var(--primary-glow);
}

/* Badge System */
.badge {
    padding: 0.35rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-stage1 { background: rgba(99, 102, 241, 0.2); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-egr { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-dpf { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-vmax { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Notification Center */
.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-dark);
}

/* Calendar Styling */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.08);
}

.calendar-day.busy {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    cursor: not-allowed;
}

.calendar-day.selected {
    background: var(--primary);
    color: white;
}

/* Car Care Tracker */
.tracker-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    overflow: hidden;
    margin: 1rem 0;
}

.tracker-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--primary));
    width: 70%;
    border-radius: 6px;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Warnings and Notes */
.user-note {
    padding: 1rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.user-warning {
    padding: 1rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--danger);
    background: rgba(239, 68, 68, 0.05);
    animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
    0% { background: rgba(239, 68, 68, 0.05); }
    50% { background: rgba(239, 68, 68, 0.1); }
    100% { background: rgba(239, 68, 68, 0.05); }
}

/* Table Enhancements */
.table-premium {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
}

.table-premium tr {
    background: rgba(255, 255, 255, 0.02);
    transition: transform 0.2s;
}

.table-premium tr:hover {
    transform: scale(1.01);
    background: rgba(255, 255, 255, 0.04);
}

.table-premium td {
    padding: 1.2rem;
}

.table-premium td:first-child { border-radius: 1rem 0 0 1rem; }
.table-premium td:last-child { border-radius: 0 1rem 1rem 0; }

/* Responsive Grid */
.grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

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

/* Dashboard & Portal Layout */
.dashboard-container { 
    display: flex; 
    flex-direction: column; 
    gap: 2.5rem; 
    padding: 2.5rem 0 10rem 0; 
}

@media (max-width: 850px) {
    .dashboard-container {
        padding-top: 1.5rem;
        padding-bottom: 12rem;
    }
}
.hero-row { display: grid; grid-template-columns: 1fr 2fr; gap: 2.5rem; }
.content-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 2.5rem; }
.history-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
@media (max-width: 1200px) { .hero-row, .content-layout, .history-grid { grid-template-columns: 1fr; } }

/* Elite Alerts & Notifications */
.elite-alert-container { position: fixed; top: 100px; left: 50%; transform: translateX(-50%); z-index: 9999; pointer-events: none; }
.elite-alert { background: rgba(10,10,12,0.9); backdrop-filter: blur(20px); border: 1px solid var(--glass-border); border-radius: 50px; padding: 1rem 2.5rem; display: flex; align-items: center; gap: 1rem; box-shadow: 0 15px 50px rgba(0,0,0,0.6); opacity: 0; transform: translateY(-20px); animation: alertIn 0.5s forwards, alertOut 0.5s 4.5s forwards; }
@keyframes alertIn { to { opacity:1; transform:translateY(0); } }
@keyframes alertOut { to { opacity:0; transform:translateY(-20px); } }

/* Shared Component Styles */
.action-btn { background: linear-gradient(135deg, var(--primary), #4f46e5); color: #fff !important; border: none; padding: 1.6rem; border-radius: 2rem; font-weight: 800; cursor: pointer; transition: 0.4s; display: flex; align-items: center; justify-content: center; gap: 1rem; text-decoration: none !important; font-size: 1.1rem; }
.action-btn:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(99,102,241,0.3); }
.action-btn.success { background: linear-gradient(135deg, var(--success), #059669); }
.action-btn.success:hover { box-shadow: 0 10px 30px rgba(16,185,129,0.4); }

/* Dashboard Cards & Widgets */
.car-display { position: relative; height: 450px; border-radius: 3rem; overflow: hidden; border: 1px solid var(--glass-border); }
.car-display img { width: 100%; height: 100%; object-fit: cover; }
.car-overlay { position: absolute; bottom: 0; left: 0; width: 100%; padding: 2.5rem; background: linear-gradient(transparent, rgba(0,0,0,0.9)); box-sizing: border-box; }
@media (max-width: 850px) { 
    .car-display { height: 320px; } 
    .car-overlay h1 { font-size: 2.2rem !important; }
}

.weather-widget { display: flex; align-items: center; justify-content: space-between; padding: 2.5rem 4rem; }
.weather-main { display: flex; align-items: center; gap: 3rem; }
.weather-joke { font-style: italic; color: #fbbf24; font-weight: 700; max-width: 250px; text-align: right; }
@media (max-width: 850px) {
    .weather-widget { flex-direction: column; text-align: center; padding: 2rem !important; gap: 1.5rem; }
    .weather-main { flex-direction: column; gap: 1rem; }
    .weather-main i { font-size: 3.5rem !important; }
    .weather-joke { text-align: center; max-width: 100%; font-size: 0.85rem; }
}

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.stat-card { padding: 2rem !important; text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.stat-label { font-size: 0.75rem; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 3px; font-weight: 700; margin-bottom: 0.5rem; display: block; }
.stat-val { font-size: 3rem; font-weight: 800; color: var(--primary); display: block; line-height: 1; }
.stat-unit { font-size: 0.7rem; color: rgba(255,255,255,0.3); font-weight: 700; text-transform: uppercase; margin-top: 0.5rem; display: block; }
@media (max-width: 850px) { .stat-grid { grid-template-columns: 1fr 1fr; } .stat-val { font-size: 2.2rem; } }

/* Mobile Cards */
.mobile-cards { display: none; flex-direction: column; gap: 1.5rem; margin-top: 1.5rem; }
.mobile-card { background: rgba(255,255,255,0.02); border: 1px solid var(--glass-border); border-radius: 2rem; padding: 1.8rem; position: relative; }
@media (max-width: 850px) { .mobile-cards { display: flex; } }

.table-premium { width: 100%; border-collapse: collapse; }
.table-premium th { text-align: left; padding: 1.5rem 1rem; font-size: 0.75rem; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 2px; border-bottom: 1px solid var(--glass-border); }
.table-premium td { padding: 1.5rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.03); }


/* Modal System */
.modal-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.92); backdrop-filter: blur(15px); 
    display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 1.5rem;
    visibility: hidden; opacity: 0; pointer-events: none;
    transition: visibility 0s 0.4s, opacity 0.4s ease;
}
.modal-overlay.active { visibility: visible; opacity: 1; pointer-events: auto; transition: visibility 0s 0s, opacity 0.4s ease; }
.modal-overlay .glass-card { transform: scale(0.85) translateY(30px); transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); max-width: 600px; width: 100%; }
.modal-overlay.active .glass-card { transform: scale(1) translateY(0); }

.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-size: 0.75rem; font-weight: 800; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 0.8rem; }
.form-control { width: 100%; background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); border-radius: 1.2rem; padding: 1.2rem; color: #fff; font-family: 'Outfit', sans-serif; font-size: 1rem; transition: 0.3s; box-sizing: border-box; }
.form-control:focus { border-color: var(--primary); outline: none; background: rgba(255,255,255,0.08); }


/* MOBILE DOCK */

@media (max-width: 850px) {
    .nav-links, .nav-right { display: none; }
    .nav-left { width: 100%; justify-content: center; }
    .mobile-bell-container { position: absolute; top: 50%; right: 15px; transform: translateY(-50%); display: block !important; }
}

/* NOTIFICATION PANEL MODAL */
.notif-panel-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    display: flex; align-items: center; justify-content: center; z-index: 5000; padding: 1.5rem;
    visibility: hidden; opacity: 0; pointer-events: none;
    transition: visibility 0s 0.4s, opacity 0.4s ease;
}
.notif-panel-overlay.active {
    visibility: visible; opacity: 1; pointer-events: auto;
    transition: visibility 0s 0s, opacity 0.4s ease;
}
.notif-panel {
    background: rgba(15, 15, 20, 0.98); border: 1px solid var(--glass-border);
    border-radius: 3rem; width: 100%; max-width: 600px; max-height: 85vh; overflow: hidden;
    display: flex; flex-direction: column; box-shadow: 0 30px 100px rgba(0,0,0,0.9);
    transform: scale(0.85) translateY(30px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.notif-panel-overlay.active .notif-panel { transform: scale(1) translateY(0); }

/* MOBILE DOCK */
.mobile-dock { display: none; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); width: 92%; max-width: 450px; background: rgba(10,10,12,0.95); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border: 1px solid var(--glass-border); border-radius: 25px; z-index: 2900; justify-content: space-around; padding: 0.8rem 0; box-shadow: 0 15px 50px rgba(0,0,0,0.8); }
.mobile-dock a { color: rgba(255,255,255,0.4); text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.6rem; font-weight: 800; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); padding: 0.6rem 1rem; border-radius: 18px; }
.mobile-dock a:hover, .mobile-dock a:active { color: var(--primary); transform: translateY(-5px); background: rgba(99, 102, 241, 0.08); box-shadow: 0 10px 20px rgba(99,102,241,0.15); }
.mobile-dock a.active { color: var(--primary); transform: translateY(-8px); background: rgba(99, 102, 241, 0.12); border: 1px solid rgba(99,102,241,0.2); }

@media (max-width: 850px) { 
    .mobile-dock { display: flex; } 
}

/* TUNING HUD */
/* TUNING HUD - REDESIGNED */
.tuning-hud-container { 
    position: fixed; 
    bottom: 30px; 
    left: 50%; 
    transform: translateX(-50%); 
    z-index: 2500; 
    pointer-events: none; 
}

.tuning-hud { 
    background: rgba(10, 10, 12, 0.85); 
    backdrop-filter: blur(30px); 
    border: 1px solid rgba(255, 255, 255, 0.08); 
    border-radius: 50px; 
    padding: 0.8rem 2.5rem; 
    display: flex; 
    align-items: center; 
    gap: 2rem; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), inset 0 0 20px rgba(99, 102, 241, 0.05); 
}

.hud-item { 
    display: flex; 
    align-items: center; 
    gap: 1rem; 
}

.hud-icon { 
    width: 38px; 
    height: 38px; 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 0.9rem; 
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
}

.hud-icon.engine { color: var(--primary); box-shadow: 0 0 15px rgba(99,102,241,0.2); }
.hud-icon.system { color: var(--success); box-shadow: 0 0 15px rgba(34,197,94,0.2); }

.hud-info { display: flex; flex-direction: column; gap: 2px; }
.hud-label { font-size: 0.6rem; color: rgba(255,255,255,0.3); font-weight: 900; letter-spacing: 1px; }
.hud-status { font-size: 0.75rem; font-weight: 800; letter-spacing: 1px; }
.hud-status.optimized { color: var(--primary); }
.hud-status.online { color: var(--success); display: flex; align-items: center; gap: 8px; }
.hud-status.online::after {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.hud-separator { width: 1px; height: 30px; background: rgba(255,255,255,0.05); }

@media (max-width: 850px) {
    .tuning-hud-container { bottom: 100px; width: 92%; }
    .tuning-hud { padding: 0.8rem 1.5rem; gap: 1rem; border-radius: 25px; justify-content: center; }
    .hud-icon { width: 32px; height: 32px; font-size: 0.8rem; border-radius: 8px; }
    .hud-status { font-size: 0.65rem; }
}
