:root {
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --primary-color: #3b82f6;
    --secondary-bg: #ffffff;
    --score-good: #22c55e;
    --score-medium: #eab308;
    --score-bad: #ef4444;
}

/* Accessibility: High Contrast Mode */
body.high-contrast {
    --bg-color: #000000;
    --text-color: #ffffff;
    --primary-color: #ffff00;
    --secondary-bg: #1a1a1a;
}

body.high-contrast * {
    border-color: #ffffff !important;
}

body.high-contrast .text-slate-500,
body.high-contrast .text-slate-600,
body.high-contrast .text-slate-300 {
    color: #e2e2e2 !important;
}

body.high-contrast .bg-white,
body.high-contrast .bg-slate-50 {
    background-color: #000 !important;
    color: #fff !important;
}

/* Font Sizing Classes */
body.font-large { font-size: 110%; }
body.font-xlarge { font-size: 125%; }

body {
    font-family: 'Heebo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

.license-plate {
    background-color: #ffcc00;
    color: #000;
    border: 2px solid #000;
    border-radius: 4px;
    font-weight: bold;
    letter-spacing: 2px;
    font-family: monospace;
    position: relative;
    direction: ltr;
    padding-left: 50px !important;
}

.license-plate::before {
    content: '🇮🇱';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9em;
}

/* Accessibility Button */
.a11y-btn {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: 50px;
    height: 50px;
    background-color: #1e293b;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 9999;
    transition: transform 0.2s;
}

.a11y-btn:hover {
    transform: scale(1.1);
}

.a11y-menu {
    position: fixed;
    left: 20px;
    bottom: 80px;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    display: none;
    width: 250px;
    border: 1px solid #e2e8f0;
}

.a11y-menu.open {
    display: block;
    animation: fadeIn 0.3s;
}

/* Loader */
.loader {
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid #3b82f6;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Toggle Button */
.toggle-checkbox:checked {
    right: 0;
    border-color: #4f46e5;
}

.toggle-checkbox:checked + .toggle-label {
    background-color: #4f46e5;
}

.toggle-checkbox {
    right: 0;
    transition: all 0.3s;
}

.toggle-checkbox:checked {
    right: -1.25rem;
    border-color: #4f46e5;
}

/* --- New Styles for Score & Analytics --- */

/* Circular Score Gauge */
.score-circle {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(var(--score-color, #ccc) var(--score-deg, 0deg), #f1f5f9 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: --score-deg 1s ease-out;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
}

.score-value {
    position: relative;
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-color);
    z-index: 10;
}

/* Score Card Gradients */
.bg-gradient-score {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

/* Insight Cards */
.insight-card {
    transition: transform 0.2s, box-shadow 0.2s;
}
.insight-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Print Styles */
@media print {
    body { background: white; }
    #search, #recentSearchesSection, #faq, footer, .no-print { display: none !important; }
    #resultsSection { display: block !important; opacity: 1 !important; max-width: 100%; box-shadow: none; border: none; }
    .shadow-xl, .shadow-2xl, .shadow-lg { box-shadow: none !important; }
    .bg-slate-50, .bg-slate-900 { background: white !important; color: black !important; }
    .text-white { color: black !important; }
    canvas { max-height: 300px !important; }
    .break-inside-avoid { break-inside: avoid; }
}

/* NEW: Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-border {
    0%, 100% {
        border-color: rgba(79, 70, 229, 0.5);
    }
    50% {
        border-color: rgba(79, 70, 229, 1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.fade-in {
    animation: slideInUp 0.6s ease-out;
}

.pulse-border {
    animation: pulse-border 2s ease-in-out infinite;
}

.loading-shimmer {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 50%,
        #f0f0f0 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Card hover effects */
.insight-card, .advice-card, .metric-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.insight-card:hover, .advice-card:hover, .metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Badge animations */
.badge-enter {
    animation: slideInUp 0.4s ease-out;
}

/* Chart container animations */
.chart-container {
    position: relative;
    animation: slideInUp 0.5s ease-out;
}

/* Market insights specific */
#marketInsightsCard {
    animation: slideInUp 0.7s ease-out 0.2s both;
}

#fleetStatsCard {
    animation: slideInUp 0.7s ease-out 0.3s both;
}

#priceComparisonCard {
    animation: slideInUp 0.7s ease-out 0.4s both;
}