/* --- Design Tokens --- */
:root {
    --bg-dark: #0b0f19;
    --bg-card: rgba(17, 24, 39, 0.65);
    --bg-card-hover: rgba(17, 24, 39, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(0, 242, 254, 0.3);
    
    /* Brand Colors */
    --color-primary: #00f2fe;
    --color-secondary: #4facfe;
    --color-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    --color-accent: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* System */
    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Montserrat', sans-serif;
    --radius-lg: 16px;
    --radius-md: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Theme overrides --- */
body[data-theme="tesla-red"] {
    --bg-dark: #0a0a0a;
    --bg-card: rgba(24, 24, 27, 0.65);
    --bg-card-hover: rgba(24, 24, 27, 0.85);
    --border-hover: rgba(239, 68, 68, 0.3);
    --color-primary: #ff2a2a;
    --color-secondary: #e53e3e;
    --color-gradient: linear-gradient(135deg, #ff2a2a 0%, #9b0000 100%);
}

body[data-theme="cyber-green"] {
    --bg-dark: #090214;
    --bg-card: rgba(24, 5, 43, 0.6);
    --bg-card-hover: rgba(24, 5, 43, 0.8);
    --border-hover: rgba(57, 255, 20, 0.3);
    --color-primary: #39ff14;
    --color-secondary: #00ff7f;
    --color-gradient: linear-gradient(135deg, #39ff14 0%, #ff007f 100%);
}

body[data-theme="light-clean"] {
    --bg-dark: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --border-color: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(37, 99, 235, 0.3);
    --color-primary: #2563eb;
    --color-secondary: #1d4ed8;
    --color-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
}

/* --- Theme Dropdown Layout --- */
.theme-select-container {
    position: relative;
    display: inline-block;
}

.theme-select-container select {
    padding: 8px 24px 8px 10px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 600;
    appearance: none;
    outline: none;
    transition: var(--transition);
    font-family: var(--font-primary);
}

.theme-select-container select:focus {
    border-color: var(--color-primary);
}

.theme-select-container::after {
    content: '▼';
    font-size: 8px;
    color: var(--text-secondary);
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* --- Base & Reset --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 242, 254, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(79, 172, 254, 0.04) 0%, transparent 40%);
    background-attachment: fixed;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-secondary);
}

/* --- Typography --- */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
}

/* --- App Container --- */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-brand {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 2px;
    background: var(--color-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--text-secondary);
    border-left: 1px solid var(--text-muted);
    padding-left: 8px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* --- Buttons & Inputs --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--color-gradient);
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.5);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-outline:hover {
    border-color: var(--color-primary);
    background: rgba(0, 242, 254, 0.05);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-block {
    width: 100%;
}

.hidden {
    display: none !important;
}

.text-danger {
    color: var(--color-danger) !important;
}

.text-cyan {
    color: var(--color-primary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Tab buttons */
.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: var(--color-primary);
    background: rgba(0, 242, 254, 0.08);
    font-weight: 600;
}

/* --- Layout Grid --- */
.grid-layout {
    display: grid;
    grid-template-columns: 1.1fr 1.4fr;
    gap: 24px;
}

.right-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* --- Panels (Glassmorphism) --- */
.panel {
    border-radius: var(--radius-lg);
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: var(--transition);
}

.panel:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.panel-title {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: -15px;
    margin-bottom: 25px;
}

/* --- Form Controls --- */
.control-group {
    margin-bottom: 22px;
}

.control-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.control-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-primary);
    background: rgba(0, 242, 254, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0, 242, 254, 0.15);
}

/* Custom Select Dropdowns */
.select-wrapper {
    position: relative;
    width: 100%;
}

select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    appearance: none;
    cursor: pointer;
    transition: var(--transition);
}

select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(0, 242, 254, 0.1);
}

.select-wrapper::after {
    content: '▼';
    font-size: 10px;
    color: var(--text-secondary);
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Custom Sliders */
.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.slider-icon {
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 2px solid #fff;
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.8);
    transition: transform 0.1s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 2px solid #fff;
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.8);
    transition: transform 0.1s;
}

/* AC Mode Button Group */
.btn-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.btn-ac {
    font-size: 11px;
    padding: 10px 4px;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-ac:hover {
    color: var(--text-primary);
}

.btn-ac.active {
    background: var(--color-gradient);
    color: #000;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 242, 254, 0.25);
}

/* Custom Model Input Row */
.custom-inputs {
    background: rgba(0, 242, 254, 0.03);
    border: 1px dashed rgba(0, 242, 254, 0.2);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-out;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 11px;
    color: var(--text-secondary);
}

.form-group input, .form-group select {
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--color-primary);
}

/* Calibration Badge */
.calibration-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 12px;
    width: 100%;
}
.calibration-badge i {
    color: var(--color-accent);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* --- Dashboard Panel --- */
.dashboard-panel {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(10, 15, 30, 0.8) 100%);
    position: relative;
    overflow: hidden;
}

/* Ambient glow in dashboard */
.dashboard-panel::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--color-primary);
    filter: blur(100px);
    opacity: 0.15;
    pointer-events: none;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.model-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.battery-capacity-display {
    font-size: 12px;
    color: var(--text-secondary);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.3fr;
    align-items: center;
    gap: 20px;
}

/* Circular Gauge */
.gauge-section {
    display: flex;
    justify-content: center;
    align-items: center;
}

.range-gauge {
    position: relative;
    width: 220px;
    height: 220px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.35s;
    filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.5));
}

.gauge-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 80%;
}

.range-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.range-number {
    font-family: var(--font-heading);
    font-size: 52px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin: 6px 0;
    text-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.range-unit {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Stats Section */
.stats-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.stat-value-container {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin: 4px 0;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.stat-unit {
    font-size: 11px;
    color: var(--text-secondary);
}

.stat-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* --- Trip Planner Panel --- */
.trip-input-row {
    margin-bottom: 20px;
}

.flex-grow {
    flex-grow: 1;
}

.input-with-action {
    position: relative;
    display: flex;
}

.input-with-action input {
    width: 100%;
    padding: 14px 18px;
    padding-right: 60px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 600;
    outline: none;
    transition: var(--transition);
}

.input-with-action input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(0, 242, 254, 0.1);
}

.input-suffix {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Trip Result Box & Progress Bar */
.trip-result-box {
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-md);
    padding: 18px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.trip-bar-container {
    margin-bottom: 18px;
}

.trip-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.trip-status-label {
    font-weight: 600;
    color: var(--text-primary);
}

.trip-progress-bar {
    position: relative;
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    overflow: hidden;
}

.trip-bar-fill {
    position: absolute;
    height: 100%;
    background: var(--color-gradient);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.trip-bar-remaining {
    position: absolute;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

/* Trip Warning Alert */
.trip-alert {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    animation: fadeIn 0.3s ease-out;
}

.trip-alert.warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.trip-alert.warning .alert-icon {
    color: var(--color-warning);
}
.trip-alert.warning strong {
    color: var(--color-warning);
}

.trip-alert.danger {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.trip-alert.danger .alert-icon {
    color: var(--color-danger);
}
.trip-alert.danger strong {
    color: var(--color-danger);
}

.trip-alert.safe {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.trip-alert.safe .alert-icon {
    color: var(--color-accent);
}
.trip-alert.safe strong {
    color: var(--color-accent);
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-message strong {
    font-size: 13px;
    display: block;
    margin-bottom: 2px;
}

.alert-message p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* --- Canvas Chart --- */
.chart-container {
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-color);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 12px;
}

.legend-color {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}
.legend-color.real {
    background: var(--color-primary);
    box-shadow: 0 0 6px var(--color-primary);
}
.legend-color.std {
    background: var(--text-muted);
}

canvas {
    width: 100%;
    display: block;
    background: transparent;
}

/* --- Tab 2: Logs styling --- */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

.logs-layout {
    grid-template-columns: 1fr 1.5fr;
}

/* Table Design */
.history-panel {
    display: flex;
    flex-direction: column;
    min-height: 450px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
    flex-grow: 1;
    margin-bottom: 20px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

.history-table th {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
}

.history-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    vertical-align: middle;
}

.history-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
}

.btn-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-delete:hover {
    color: var(--color-danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Calibration Summary Box */
.calibration-summary-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(10, 30, 20, 0.1) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-top: auto;
    animation: fadeIn 0.4s ease-out;
}

.calibration-summary-box h3 {
    font-size: 14px;
    color: var(--color-accent);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.summary-card {
    background: rgba(0, 0, 0, 0.15);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.card-label {
    font-size: 10px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
}

.card-val {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
}

.summary-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

/* --- Footer --- */
.app-footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    color: var(--text-muted);
    font-size: 11px;
}

/* --- Map Routing Panel --- */
.autocomplete-wrapper {
    position: relative;
}

.input-with-gps {
    position: relative;
    width: 100%;
}

.input-with-gps input {
    padding-right: 40px !important;
}

.btn-gps {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: var(--transition);
    z-index: 2;
}

.btn-gps:hover {
    background: rgba(0, 242, 254, 0.15);
    color: #fff;
}

.suggestions-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: rgba(11, 15, 25, 0.95);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: fadeIn 0.15s ease-out;
}

.suggestions-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    transition: var(--transition);
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestions-item:hover {
    background: rgba(0, 242, 254, 0.1);
    color: var(--color-primary);
}

.suggestions-item:last-child {
    border-bottom: none;
}

/* Charging Plan Box */
.charging-plan-box {
    margin-top: 15px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(16, 185, 129, 0.2);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.04) 0%, rgba(10, 30, 20, 0.08) 100%);
    animation: fadeIn 0.3s ease-out;
}

.charging-plan-header {
    background: rgba(16, 185, 129, 0.15);
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(16, 185, 129, 0.15);
}

.charging-plan-header i {
    width: 16px;
    height: 16px;
}

.charging-plan-body {
    padding: 14px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-primary);
}

.charging-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.charging-step-item:last-child {
    margin-bottom: 0;
}

.charging-step-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    margin-top: 1px;
}

.charging-step-text {
    flex-grow: 1;
    text-align: left;
}

.charging-step-text strong {
    color: #10b981;
}

.map-input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
}

.map-buttons-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.map-buttons-row .btn {
    flex: 1;
}

.trip-map-container {
    height: 250px;
    width: 100%;
    border-radius: var(--radius-md);
    margin-top: 5px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
    z-index: 1;
}

/* Make Leaflet dark-theme-friendly */
.leaflet-container {
    background: #0b0f19 !important;
}

.leaflet-bar {
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
}

.leaflet-bar a {
    background-color: rgba(15, 23, 42, 0.9) !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.leaflet-bar a:hover {
    background-color: var(--color-primary) !important;
    color: #000 !important;
}

.leaflet-popup-content-wrapper, .leaflet-popup-tip {
    background: rgba(11, 15, 25, 0.95) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important;
    backdrop-filter: blur(8px);
}

.leaflet-popup-content {
    font-family: var(--font-primary);
    font-size: 12px;
    line-height: 1.4;
    margin: 10px 12px !important;
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Responsive Layout --- */
@media (max-width: 900px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
    .app-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 500px) {
    .app-container {
        padding: 10px;
    }
    .panel {
        padding: 16px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .gauge-section {
        margin-bottom: 10px;
    }
    .header-actions {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
    }
    .btn-ac {
        font-size: 10px;
        padding: 8px 2px;
    }
    .summary-grid {
        grid-template-columns: 1fr;
    }
}
