/* ==========================================================================
   FONTS & PREMIUM DESIGN VARIABLES
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700;900&family=Roboto:wght@400;500;700&display=swap');

:root {
    --color-primary: #005A9C;
    --color-primary-dark: #004070;
    --color-text-heading: #1A202C;
    --color-text-body: #4A5568;
    --color-background-light: #F7FAFC;
    --color-background-white: #FFFFFF;
    --color-border: #E2E8F0;
    --color-success: #38A169;
    --color-warning: #D69E2E; 
    --color-error: #E53E3E;
    --font-heading: 'Lato', sans-serif;
    --font-body: 'Roboto', sans-serif;
    --header-height: 80px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 10px, 0, 0.04);
}

/* ==========================================================================
   BASE & RESET STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/* PREVENT HORIZONTAL SCROLL SWAYING */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
    position: relative; /* Helps lock content */
    overscroll-behavior-x: none; /* Disables the "swipe back" browser gesture */
}

body {
    font-family: var(--font-body);
    color: var(--color-text-body);
    background-color: var(--color-background-light);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.no-scroll {
    overflow: hidden;
}

body:not(.auth-page) {
    background-image: url('https://www.transparenttextures.com/patterns/cubes.png');
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-primary-dark);
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   HEADER & FOOTER
   ========================================================================== */
/* ==========================================================================
   FIX: STICKY HEADER
   ========================================================================== */
.main-header {
    position: fixed; /* Use fixed for better support across all pages */
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    height: var(--header-height);
}

/* IMPORTANT: Add padding to the body so the content doesn't hide behind the header */
body {
    padding-top: var(--header-height);
}
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
}
.logo-img {
    height: 35px;
    width: auto;
}
.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    padding: 0;
    margin: 0; /* Ensure no default margin throws off alignment */
    align-items: center; /* <--- This forces App/Profile to center vertically with the Badge */
}
.main-nav a {
    color: var(--color-text-body);
    font-weight: 500;
    text-decoration: none;
}
.main-nav .nav-link {
    padding: 8px 16px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    color: var(--color-text-heading);
}
.main-nav .nav-link:hover {
    background-color: var(--color-background-light);
    color: var(--color-primary);
}

.nav-buttons-wrapper {
    display: contents; 
}


.main-footer {
    background-color: var(--color-text-heading);
    color: #A0AEC0;
    padding: 20px 0;
    margin-top: auto;
}
.main-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer-links a {
    color: #A0AEC0;
    margin-left: 20px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.cta-button {
    display: inline-block;
    background-color: var(--color-primary);
    color: var(--color-background-white) !important;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 700;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: 2px solid var(--color-primary);
    cursor: pointer;
}
.cta-button:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 90, 156, 0.2);
}

.nav-link-secondary {
     padding: 8px 16px;
     border-radius: 5px;
     transition: background-color 0.3s ease;
     color: var(--color-text-heading);
     font-weight: 500;
}
.nav-link-secondary:hover {
     background-color: var(--color-background-light);
     color: var(--color-primary);
}


.analyze-btn {
    width: 100%;
    margin-top: 30px;
    padding: 18px;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    background-color: var(--color-primary);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.analyze-btn:hover {
    background-color: var(--color-primary-dark);
    box-shadow: 0 6px 20px rgba(0, 90, 156, 0.3);
    transform: translateY(-3px);
}
.analyze-btn i {
    margin-right: 10px;
}
/* ==========================================================================
   APP CONTAINER & MAIN CONTENT
   ========================================================================== */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 80px 20px;
}
.home-container {
    width: 100%;
    max-width: 1200px;
}
.app-content-grid {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 60px;
    align-items: center;
}
.app-info-panel {
    text-align: left;
}
.app-title {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 900;
    color: var(--color-text-heading);
    margin-bottom: 15px;
    line-height: 1.1;
}
.app-subtitle {
    font-size: 20px;
    color: var(--color-text-body);
    margin-bottom: 40px;
}
.info-features {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.info-feature-item {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: 500;
}
.info-feature-item i {
    color: var(--color-success);
    font-size: 22px;
    margin-right: 15px;
}
.search-bar {
    background: var(--color-background-white);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

/* ==========================================================================
   FILE UPLOAD STYLES
   ========================================================================== */
.file-upload-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    background-color: var(--color-background-light);
    color: var(--color-text-body);
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}
.file-upload-label:hover, .file-upload-label.dragover {
    border-color: var(--color-primary);
    background-color: #eef5ff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.file-upload-label i {
    font-size: 48px;
    color: var(--color-primary);
    margin-bottom: 20px;
}
.file-upload-label > span {
    font-weight: 700;
    font-size: 1.2em;
    color: var(--color-text-heading);
}
.file-upload-label .tooltip {
    font-size: 0.9em;
    color: var(--color-text-body);
    margin-top: 8px;
}

/* --- UPDATED UPLOAD LIST STYLES (Supports Delete & Long Filenames) --- */
.upload-list {
    margin-top: 25px;
    text-align: left;
    font-size: 1em;
    width: 100%; /* Ensure list stays within container */
}

.upload-item {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--color-border);
    display: grid; /* Use Grid for better control */
    grid-template-columns: 1fr auto auto; /* Name takes available space, status/btn take needed space */
    gap: 15px;
    align-items: center;
    background-color: #fff;
    transition: all 0.2s ease;
    overflow: hidden; /* Prevent spillover */
}

.upload-item.success {
    border-color: #a7f3d0;
    background-color: #f0fff4;
}

.upload-item.error {
    border-color: #fecaca;
    background-color: #fff5f5;
}

.upload-item .file-name {
    font-weight: 500;
    color: var(--color-text-heading);
    white-space: nowrap;      /* Prevent wrapping to new line */
    overflow: hidden;         /* Hide overflow */
    text-overflow: ellipsis;  /* Add "..." at the end */
    min-width: 0;             /* Critical for grid item truncation */
    display: block;
}

.upload-item .file-status {
    font-size: 0.9em;
    color: var(--color-text-body);
    white-space: nowrap; /* Keep status on one line */
    flex-shrink: 0;      /* Prevent status from shrinking */
}

.upload-item.success .file-status {
    color: var(--color-success);
    font-weight: 600;
}

.upload-item.error .file-status {
    color: var(--color-error);
}

/* DELETE BUTTON STYLES */
.delete-file-btn {
    background: none;
    border: none;
    color: #cbd5e0;
    cursor: pointer;
    font-size: 1.1em;
    padding: 5px;
    margin-left: 0; /* Margin handled by grid gap now */
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent button from squishing */
}

.delete-file-btn:hover {
    color: var(--color-error);
}

/* ==========================================================================
   PROGRESS BAR & LOADING SPINNER
   ========================================================================== */
.upload-progress-container {
    margin-top: 20px;
}
.upload-progress {
    width: 100%;
    height: 8px;
    background: var(--color-border);
    border-radius: 5px;
    overflow: hidden;
    margin-top: 8px;
}
.upload-progress .progress-bar {
    height: 100%;
    background: var(--color-primary);
    width: 0;
    transition: width 0.4s ease;
    border-radius: 5px;
}

/* --- LOADING ANIMATION STYLES (GIF CAR) --- */
.loading-spinner {
    font-size: 20px;
    font-weight: 500;
    color: var(--color-text-heading);
    margin-top: 40px;
    display: flex; 
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.animation-container {
    width: 250px; 
    height: 100px;
    position: relative;
    overflow: hidden; 
    display: flex;
    align-items: center;
    justify-content: center;
    /* REDUCED: Was 20px, now 5px to close the gap */
    margin-bottom: 5px; 
}

.loading-gif {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    display: block;
}

/* --- LOADING TEXT (Updated to match Deal Analyzer Header) --- */
.loading-text {
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* REMOVED: Extra top margin removed */
    margin-top: 0; 
    
    /* Font style matches .app-title */
    font-family: var(--font-heading); 
    font-size: 28px;   
    font-weight: 900;  /* Bold weight like the header */
    
    /* Text Color Black */
    color: #000000;    
    
    letter-spacing: -0.02em; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.loading-dots {
    display: flex;
    margin-left: 2px;
}

.loading-dots span {
    animation: blink-dot 1.4s infinite both;
    margin-left: 3px; 
    
    /* Match the new black text color */
    color: #000000; 
    
    font-family: var(--font-heading);
    font-size: 28px; 
    font-weight: 900; 
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink-dot {
    0%, 80%, 100% { opacity: 0.2; }
    40% { opacity: 1; }
}

/* ==========================================================================
   PREMIUM REPORT STYLES
   ========================================================================== */
.results {
    margin-top: 60px;
    background: var(--color-background-white);
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
}

.report-header {
    text-align: center;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 25px;
    margin-bottom: 30px;
}
.report-header h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-body);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}
.report-header .report-logo {
    height: 24px;
}
.report-header h1 {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 900;
    color: var(--color-text-heading);
}

.report-summary {
    display: grid;
    grid-template-columns: 1fr 2.5fr; 
    gap: 30px;
    align-items: center;
    margin-bottom: 40px;
}

/* DYNAMIC SCORE COLORING */
.score-color-success { --dynamic-score-color: var(--color-success); }
.score-color-warning { --dynamic-score-color: var(--color-warning); }
.score-color-error { --dynamic-score-color: var(--color-error); }
.score-color-primary { --dynamic-score-color: var(--color-primary); }

.score-circle-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}


.rating-context {
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.rating-context .deal-status {
    font-family: var(--font-heading);
    font-size: 32px; 
    font-weight: 900;
    margin-bottom: 10px;
    line-height: 1.2;
    color: var(--color-text-heading);
}
.rating-context .deal-description {
    font-size: 16px;
    color: var(--color-text-body);
}

.key-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.metric-card {
    background-color: var(--color-background-light);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
}
.metric-card h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-body);
    margin-bottom: 8px;
}
.metric-card p {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-heading);
    margin-bottom: 15px;
}
.score-bar {
    width: 100%;
    height: 8px;
    background-color: var(--color-border);
    border-radius: 4px;
    overflow: hidden;
}
.score-bar-inner {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.score-bar-inner.high { background-color: var(--color-success); }
.score-bar-inner.medium { background-color: var(--color-warning); }
.score-bar-inner.low { background-color: var(--color-error); }

.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}
.report-card {
    background-color: #fff;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    
    /* FIX FOR GRAPH RESIZING BUG */
    min-width: 0;      /* Allows the grid item to shrink below the chart's size */
    overflow: hidden;  /* Ensures the chart doesn't spill out during resize */
    width: 100%;       /* Ensures it fills the grid cell correctly */
}
.report-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-heading);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.report-card h3 i {
    color: var(--color-primary);
}



/* --- UPDATED SPECIFICATIONS LIST (Desktop: Right Aligned Text) --- */
.details-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.details-list li {
    display: flex;
    align-items: center;
    /* Ensure flex-start so margin-left: auto can push items to the right */
    justify-content: flex-start; 
    padding: 15px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 15px;
}

.details-list li:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 700;
    color: var(--color-text-body);
    flex-shrink: 0; 
}

.detail-value {
    color: var(--color-text-heading);
    font-weight: 500;
    
    /* Keeps the block pushed to the right side of the row */
    margin-left: auto; 
    
    /* Keeps the gap between text and score pill */
    margin-right: 15px; 
    
    /* UPDATED: Aligns the text inside the block to the left */
    text-align: left;
    
    /* Ensures it doesn't span too wide */
    max-width: 60%; 
}

.score-pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0; 
}

/* Color classes for score pills */
.score-pill.high { background-color: var(--color-success); }
.score-pill.medium { background-color: var(--color-warning); }
.score-pill.low { background-color: var(--color-error); }
.score-pill.none { background-color: #a0aec0; }

/* Common Issues List Styles */
.common-issues-list {
    list-style-type: none;
    padding-left: 0;
}
.common-issues-list li {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 5px solid #e74c3c;
}
.common-issues-list .issue-name {
    font-weight: 700;
    color: #333;
    font-size: 1.1rem;
    display: block;
}
.common-issues-list .issue-cost {
    display: block;
    font-size: 0.95rem;
    color: #e74c3c;
    font-weight: 500;
    margin: 4px 0 8px;
}
.common-issues-list .issue-desc {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
    margin: 0;
}
.common-issues-list .no-issues {
    border-left-color: #2ecc71;
    color: #333;
}

/* Collision Repair List Styles */
.collision-repair-list {
    list-style-type: none;
    padding-left: 0;
}
.collision-repair-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}
.collision-repair-list li:last-child {
    border-bottom: none;
}
.collision-repair-list .part-name {
    font-weight: 500;
    color: #333;
    padding-right: 10px;
}
.collision-repair-list .part-cost {
    font-weight: 700;
    color: #c0392b;
    background-color: #fdf2f2;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.95rem;
    text-align: right;
    white-space: nowrap;
}

/* Maintenance Forecast */
.maintenance-forecast {
    margin-bottom: 40px;
}
.maintenance-forecast h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text-heading);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.maintenance-forecast h3 i {
    color: var(--color-primary);
}
.maintenance-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 20px;
}
.maintenance-tab {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text-body);
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
    border-radius: 8px 8px 0 0;
}
.maintenance-tab.active {
    color: var(--color-primary);
    background-color: var(--color-background-light);
}
.maintenance-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-primary);
}
.maintenance-panel {
    display: none;
    background-color: var(--color-background-light);
    border-radius: 12px;
    padding: 20px;
}
.maintenance-panel.active {
    display: block;
}
.maintenance-panel ul {
    list-style: none;
    padding: 0;
}
.maintenance-panel li {
    display: grid;
    grid-template-columns: 120px 100px 1fr;
    gap: 20px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}
.maintenance-panel li:last-child {
    border-bottom: none;
}
.item-name {
    font-weight: 700;
}
.item-cost {
    font-weight: 700;
    font-size: 16px;
    color: var(--color-text-heading);
}
.item-reason {
    font-size: 14px;
    color: var(--color-text-body);
}

.download-button {
    display: block;
    width: fit-content;
    margin: 40px auto 0;
}

/* ==========================================================================
   ALERT POPUP
   ========================================================================== */
.alert-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(24, 32, 44, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.alert-content {
    background: var(--color-background-white);
    padding: 40px;
    border-radius: 12px;
    max-width: 450px;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-lg);
}
.alert-close {
    position: absolute;
    top: 15px;
    right: 20px;
    cursor: pointer;
    font-size: 1.8em;
    color: #a0aec0;
}
.alert-close:hover {
    color: var(--color-text-heading);
}
#alertMessage {
    font-size: 18px;
    font-weight: 500;
    color: var(--color-text-heading);
}

/* ==========================================================================
   MOBILE MENU & NAVIGATION
   ========================================================================== */
.mobile-menu-toggle {
    display: none;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 1002;
    padding: 0;
}
.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--color-text-heading);
    border-radius: 3px;
    position: absolute;
    left: 0;
    transition: all 0.3s ease-in-out;
}
.mobile-menu-toggle span:nth-child(1) { top: 0; }
.mobile-menu-toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.mobile-menu-toggle span:nth-child(3) { bottom: 0; }

.mobile-menu-toggle.is-open span:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}
.mobile-menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.is-open span:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 992px) {
    /* --- NAVIGATION & LAYOUT --- */
    .main-nav {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--color-background-white);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
        z-index: 1001;
    }

    .main-nav.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .main-nav ul {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .main-nav .nav-link,
    .main-nav .nav-link-secondary,
    .main-nav .cta-button {
        font-size: 24px;
        padding: 10px 20px;
    }
    .nav-buttons-wrapper {
        display: flex;
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .app-content-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    /* --- HOME PAGE ALIGNMENT FIX --- */
    .app-info-panel {
        text-align: left !important;
        padding: 0 25px; 
        width: 100%;
        max-width: 100%;
        margin: 0 auto 30px auto;
    }

    .app-title {
        text-align: left;
    }

    .app-subtitle {
        text-align: left;
        margin: 0 0 25px 0;
        padding: 0;
        max-width: 100%;
        line-height: 1.6;
    }

    .info-features {
        display: flex;
        flex-direction: column;
        gap: 15px;
        align-items: flex-start; 
        margin-top: 20px;
    }

    .info-feature-item {
        display: flex;
        align-items: center;      
        justify-content: flex-start; 
        text-align: left;
        width: 100%;
    }

    .info-feature-item i {
        min-width: 26px;        
        text-align: center;
        margin-right: 12px;
    }

    /* --- REPORT LAYOUT ADJUSTMENTS --- */
    .report-summary { 
        grid-template-columns: 1fr; 
        gap: 30px;
    }
    .report-grid { 
        grid-template-columns: 1fr; 
    }
    .rating-context {
        text-align: center;
    }
}

@media (max-width: 768px) {
    /* --- GENERAL ADJUSTMENTS --- */
    .app-title { font-size: 32px; }
    .search-bar, .results { padding: 20px; } /* Reduced padding to save width */
    .file-upload-label { padding: 30px 20px; }
    
    .main-footer .container { flex-direction: column; gap: 15px; text-align: center; }
    .footer-links { margin-top: 15px; }
    .footer-links a { margin: 0 10px; }

    /* --- REPORT CLEANUP FOR MOBILE --- */
    .report-header h1 { font-size: 26px; line-height: 1.2; margin-top: 5px; }
    .report-header h2 { font-size: 14px; }
    
    /* 1. Organize Metrics into a 2-column grid instead of a long list */
    .key-metrics {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    .metric-card {
        padding: 15px;
        text-align: center;
    }
    .metric-card p { font-size: 20px; margin-bottom: 10px; }
    
    /* 2. Score Circle Sizing */
    .score-circle {
        width: 150px;
        height: 150px;
        margin: 0 auto;
    }
    .score-circle .score-number { font-size: 42px; }

    /* 3. Fix Maintenance Panel (Stack nicely instead of table rows) */
    .maintenance-tabs { 
        flex-wrap: wrap; 
        gap: 5px;
    }
    .maintenance-tab {
        flex: 1 1 auto;
        text-align: center;
        font-size: 14px;
        padding: 10px;
    }
    
    .maintenance-panel { padding: 15px; }
    
    /* Transform maintenance rows into clean blocks */
    .maintenance-panel li {
        display: flex;
        flex-direction: column;
        align-items: flex-start; /* Align left */
        text-align: left;
        gap: 4px;
        padding: 15px 0;
        border-bottom: 1px solid #edf2f7;
    }
    
    .maintenance-panel li .item-name {
        font-size: 16px;
        color: var(--color-primary);
        margin-bottom: 2px;
    }
    
    .maintenance-panel li .item-cost {
        font-size: 15px;
        font-weight: 700;
        color: #2d3748;
    }
    
    /* Show the reason again, but style it smaller */
    .maintenance-panel li .item-reason {
        display: block !important;
        font-size: 13px;
        color: #718096;
        line-height: 1.4;
        margin-top: 4px;
    }

  /* 4. PROFESSIONAL ROW LAYOUT (Mobile: Small Text, No Ellipsis) */
    .details-list li {
        display: flex !important;
        flex-direction: row !important; /* Force Single Row */
        flex-wrap: nowrap !important;   /* Keep columns side-by-side */
        justify-content: space-between !important;
        align-items: flex-start !important; /* Align top (in case text wraps) */
        padding: 12px 0 !important;
        gap: 12px !important;
        border-bottom: 1px solid #f1f5f9;
    }

    /* Label: Left aligned, Small text */
    .details-list li .detail-label {
        order: 1;
        flex: 1; /* Takes available space */
        width: auto !important;
        margin: 0 !important;
        text-align: left;
        
        /* UPDATED: Smaller font & allow wrapping */
        font-size: 12px !important; 
        font-weight: 600 !important;
        color: #64748b !important;
        line-height: 1.3 !important;
        white-space: normal !important; /* Allow wrap */
        overflow: visible !important;   /* No ... */
    }

    /* Value: Right aligned, Small text */
    .details-list li .detail-value {
        order: 2;
        width: auto !important;
        flex: 1; /* Takes equal space */
        margin: 0 !important;
        text-align: right !important;
        
        /* UPDATED: Smaller font & allow wrapping */
        font-size: 13px !important;
        font-weight: 700 !important;
        color: #1e293b !important;
        line-height: 1.3 !important;
        white-space: normal !important; /* Allow wrap */
        overflow: visible !important;   /* No ... */
        
        /* Push text towards the badge */
        display: flex;
        justify-content: flex-end;
    }

    /* Score Pill: Stays on the far right */
    .details-list li .score-pill {
        order: 3;
        margin-left: 8px !important;
        margin-top: 0 !important; /* Align with top line of text */
        padding: 2px 8px !important; /* Smaller badge */
        font-size: 11px !important;
        height: auto !important;
        flex-shrink: 0;
    }
}

/* --- REVVARO SCORE LEGEND STYLES --- */
        .score-legend-card {
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            padding: 20px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.05);
            max-width: 400px; /* Keeps it compact and readable */
        }
        
        .score-legend-card h4 {
            margin: 0 0 15px 0;
            color: #2d3748;
            font-size: 15px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 8px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border-bottom: 1px solid #edf2f7;
            padding-bottom: 10px;
        }
        
        .score-legend-card h4 i { color: #005A9C; }

        .legend-entries {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        
        .legend-row {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 14px;
        }
        
        .legend-badge {
            display: inline-block;
            width: 75px;
            text-align: center;
            padding: 5px 0;
            border-radius: 6px;
            font-weight: 800;
            color: #fff;
            font-size: 13px;
            flex-shrink: 0;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        
        .legend-desc {
            color: #4a5568;
            line-height: 1.3;
        }
        
        /* Professional Business Colors */
        .badge-unicorn { background-color: #38A169; } /* Green */
        .badge-great   { background-color: #319795; } /* Teal */
        .badge-fair    { background-color: #D69E2E; } /* Golden/Yellow */
        .badge-risk    { background-color: #DD6B20; } /* Orange */
        .badge-bad     { background-color: #E53E3E; } /* Red */
        
        
/* --- SCORE CIRCLE STYLES --- */
.score-circle {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    /* background is handled by JS inline style */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.score-inner-mask {
    width: 130px; /* Smaller than parent to create the white center */
    height: 130px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
/* --- SCORE TEXT STYLES --- */
.score-circle .score-number {
    font-size: 52px;   /* Makes the number big and bold */
    font-weight: 900;
    line-height: 1;
    margin-top: 10px;  /* Centers it slightly better vertically */
    margin-bottom: 2px;
}

.score-circle .score-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}
/* --- FIX REPORT HEADER SPACING --- */
.report-summary {
    display: flex !important;       /* Use Flexbox for better spacing control */
    justify-content: space-between; /* Pushes the Score (Left) and Metrics (Right) apart */
    align-items: center;            /* Vertically centers everything */
    gap: 60px;                      /* Adds a big, clean gap so it's not smooshed */
    margin-bottom: 50px;
    padding: 10px 20px;             /* Adds breathing room on the sides */
}

.score-circle-wrapper {
    flex: 0 0 auto;                 /* Prevents the circle from shrinking/squishing */
    width: 220px;                   /* Reserves a clean space for the circle */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.key-metrics {
    flex: 1;                        /* Takes up all remaining width on the right */
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Forces 3 equal columns */
    gap: 30px;                      /* More space between the price/mileage/maint cards */
}

.metric-card {
    text-align: center;             /* Centers the text for a professional look */
    padding: 25px 20px;             /* Taller padding feels less cramped */
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03); /* Subtle lift */
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

/* Fix mobile responsiveness so it stacks cleanly on small screens */
@media (max-width: 992px) {
    .report-summary {
        flex-direction: column;     /* Stack top-to-bottom on mobile */
        gap: 40px;
    }
    .score-circle-wrapper {
        width: 100%;
    }
    .key-metrics {
        width: 100%;
        gap: 15px;
    }
}
/* --- SCORE LEGEND STRIP --- */
.score-legend-strip {
    display: flex;
    justify-content: center;
    gap: 15px; /* Spacing between items */
    padding: 15px 20px;
    background-color: #f8fafc; /* Very light gray background */
    border-radius: 8px;
    margin-bottom: 40px; /* Space before the next section */
    border: 1px solid #edf2f7;
    flex-wrap: wrap; /* Allows wrapping on tiny screens */
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4a5568;
    cursor: default; /* Shows it's informational */
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-range {
    font-weight: 700;
    color: #2d3748;
    font-family: var(--font-heading);
}

.legend-label {
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-size: 11px;
    color: #718096;
}

/* Mobile Tweak: Stack them in 2 rows if screen is too small */
@media (max-width: 600px) {
    .score-legend-strip {
        gap: 10px 20px; /* Row gap 10px, Col gap 20px */
        justify-content: center;
    }
}
/* --- FULL SCREEN LOADING OVERLAY --- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* UPDATED: Changed 0.98 to 0.85 for transparency */
    background-color: rgba(255, 255, 255, 0.85); 
    
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
    /* UPDATED: Increased blur to 8px for a nice "Frosted Glass" look */
    backdrop-filter: blur(8px); 
    
    cursor: wait;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Class to show the overlay */
.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Lock scrolling while loading */
body.loading-locked {
    overflow: hidden !important;
}

/* Ensure the GIF container is visible */
.loading-overlay .animation-container {
    width: 250px;
    height: 100px;
    margin-bottom: 20px;
}
/* ==========================================================================
   NEW REPORT LAYOUTS (Issues Grid & Tables)
   ========================================================================== */

/* --- GRID CONTAINER --- */
.issues-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Auto-responsive columns */
    gap: 20px;
    margin-top: 15px;
}

/* --- CARD STYLING (Standard) --- */
.issue-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%; /* Ensures cards in same row are same height */
    display: flex;
    flex-direction: column;
}

.issue-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-color: #cbd5e0;
}

.issue-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 15px;
}

.issue-title-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.issue-title-wrapper i {
    color: #D69E2E; /* Warning Yellow */
    margin-top: 3px;
    flex-shrink: 0;
}

.issue-title {
    font-weight: 700;
    color: #2d3748;
    font-size: 15px;
    line-height: 1.4;
}

.issue-cost-badge {
    background-color: #fff;
    border: 1px solid #e2e8f0;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #e53e3e; /* Red text for cost */
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    align-self: flex-start;
}

.issue-body {
    font-size: 14px;
    color: #718096;
    line-height: 1.6;
    margin: 0;
}

/* --- SEVERE ISSUES (Red Styling) --- */
.report-card.severe-wrapper {
    border-top: 4px solid #e53e3e; /* Red bar on top of the whole section */
}

.text-danger {
    color: #e53e3e !important;
}

.section-subtitle {
    font-size: 14px;
    color: #718096;
    margin-bottom: 25px;
    margin-top: -15px;
}

/* Red Card Variant */
.issue-card.severe {
    background-color: #fff5f5; /* Faint red background */
    border-color: #feb2b2;      /* Light red border */
}

.issue-card.severe:hover {
    border-color: #e53e3e;
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.15);
}

.issue-card.severe .issue-title {
    color: #c53030; /* Darker red title */
}

.issue-cost-badge.severe {
    background-color: #e53e3e;
    color: white;
    border: none;
    box-shadow: 0 2px 4px rgba(229, 62, 62, 0.3);
}

/* --- COLLISION TABLE STYLING --- */
.repair-table-wrapper {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-top: 15px;
}

.repair-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background-color: white;
}

.repair-table th {
    background-color: #f7fafc;
    color: #4a5568;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
    padding: 15px 20px;
    text-align: left;
    border-bottom: 2px solid #edf2f7;
}

.repair-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #edf2f7;
    color: #2d3748;
}

.repair-table tr:last-child td {
    border-bottom: none;
}

.repair-table .col-part {
    font-weight: 600;
    width: 70%;
}

.repair-table .col-cost {
    text-align: right;
    font-weight: 700;
    color: #4a5568;
    white-space: nowrap;
}

/* Mobile Tweak for Table */
@media (max-width: 600px) {
    .repair-table th, .repair-table td {
        padding: 12px 15px;
    }
}
/* ==========================================================================
   MOBILE LAYOUT FIXES (Prevents "Squished" Look)
   ========================================================================== */
@media (max-width: 768px) {
    
    /* 1. Force Report Summary to Stack Vertically */
    .report-summary {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 30px !important;
        padding: 0 !important; /* Remove side padding that pushes content */
    }

    /* 2. Make the Score Circle Centered & Full Width */
    .score-circle-wrapper {
        width: 100% !important;
        display: flex;
        justify-content: center;
        margin-bottom: 10px;
    }

    /* 3. KEY METRICS: Stack them 1-by-1 (Instead of 2 columns) */
    /* This fixes the "unorganized" look by giving each metric its own row */
    .key-metrics {
        display: grid !important;
        grid-template-columns: 1fr !important; /* Force 1 column */
        width: 100% !important;
        gap: 15px !important;
    }
    
    .metric-card {
        width: 100% !important; /* Fill the screen width */
    }

    /* 4. COMMON & SEVERE ISSUES: Force Single Column */
    /* The desktop minmax(300px) was too wide for phones, pushing things sideways */
    .issues-grid-container {
        display: grid !important;
        grid-template-columns: 1fr !important; /* Force 1 column */
        gap: 20px !important;
    }

    /* 5. FIX TABLE SCROLLING (Prevent whole page from sliding) */
    .repair-table-wrapper {
        width: 100%;
        overflow-x: scroll; /* Allows ONLY the table to scroll, not the page */
        -webkit-overflow-scrolling: touch; /* Smooth scroll on iPhone */
        display: block;
    }

    /* 6. GENERAL CONTAINER FIXES */
    .report-card {
        padding: 20px 15px !important; /* Reduce padding slightly */
    }
    
    .report-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 30px !important;
    }
    
    /* Fix Legend Wrapping */
    .score-legend-strip {
        flex-direction: row; /* Keep row */
        flex-wrap: wrap;     /* Allow wrapping */
        justify-content: center;
        gap: 10px;
    }
    
    .legend-item {
        font-size: 11px; /* Make text slightly smaller to fit */
    }
}
/* ==========================================================================
   MOBILE LOADING SCREEN FIXES
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. Shrink the Loading Text */
    .loading-text {
        font-size: 18px !important; /* Reduced from 28px */
        white-space: nowrap;        /* Prevent wrapping */
    }

    /* 2. Shrink the Dots to match */
    .loading-dots span {
        font-size: 18px !important;
        margin-left: 2px !important;
    }

    /* 3. Optional: Make the Car GIF slightly smaller on phone */
    .loading-overlay .animation-container {
        width: 200px !important; /* Reduced from 250px */
        height: auto !important;
    }
    /* 7. SHRINK LOGO ON MOBILE */
    .logo-img {
        height: 24px !important; /* Reduced from 35px */
        width: auto !important;
    }
    
}
/* ==========================================================================
   MOBILE HERO FIX (Clean, Left-Aligned, Professional)
   ========================================================================== */
@media (max-width: 768px) {
    
    /* 1. Container: Clean Left Align with Breathing Room */
    .app-info-panel {
        text-align: left !important;
        padding: 0 10px !important; /* Prevents text hitting screen edge */
        margin-bottom: 30px !important;
        width: 100% !important;
    }

    /* 2. Title: Slightly smaller, tighter line-height */
    .app-title {
        text-align: left !important;
        font-size: 32px !important; /* Reduced from 48px to fit phone */
        line-height: 1.15 !important;
        margin-bottom: 15px !important;
        letter-spacing: -0.5px !important; /* Modern tight spacing */
    }

    /* 3. Subtitle: More readable size */
    .app-subtitle {
        text-align: left !important;
        font-size: 16px !important;
        color: #4a5568 !important; /* Soft professional gray */
        margin-bottom: 25px !important;
        line-height: 1.5 !important;
        max-width: 100% !important;
    }

    /* 4. Features List: Clean Alignment */
    .info-features {
        align-items: flex-start !important; /* Keep aligned to left */
        gap: 12px !important;
    }

    /* 5. List Items: Fix "Floating Icon" issue */
    .info-feature-item {
        display: flex !important;
        align-items: flex-start !important; /* Top-align icon with text */
        justify-content: flex-start !important;
        text-align: left !important;
        font-size: 15px !important;
        line-height: 1.4 !important;
        width: 100% !important;
    }

    /* 6. Fix the Checkmark Icon */
    .info-feature-item i {
        margin-top: 3px !important; /* Push icon down slightly to match text */
        margin-right: 12px !important;
        font-size: 18px !important; /* Scale icon down slightly */
        flex-shrink: 0 !important; /* Prevent icon from squishing */
    }

    /* 7. Upload Box Spacing */
    .search-bar {
        padding: 25px 20px !important;
        margin-top: 10px !important;
    }
}
/* ==========================================================================
   FIX: REPORT VIEWING ALIGNMENT (Centers Everything)
   ========================================================================== */

/* 1. Reset the Report Modal to be Perfectly Centered */
.alert-content.report-view {
    width: 95% !important;
    max-width: 800px !important;
    max-height: 90vh !important;
    overflow-y: auto !important; /* Scroll inside modal */
    
    /* FORCE CENTER ALIGNMENT */
    margin: 0 auto !important; 
    left: auto !important;
    right: auto !important;
    position: relative !important;
    
    /* Reset text alignment */
    text-align: left !important;
    padding: 20px !important;
}

/* 2. Mobile Specific Fixes for the Report View */
@media (max-width: 768px) {
    
    /* Make the Modal Full Screen & Centered on Phone */
    .alert-content.report-view {
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        padding: 15px !important;
        margin: 0 !important;
    }

    /* Fix the "Results" container (Standard Page View) */
    .results {
        width: 100% !important;
        margin: 0 auto !important;
        padding: 20px 15px !important; /* Balanced Padding (15px Left/Right) */
        box-shadow: none !important;   /* Cleaner look on mobile */
        border: none !important;
    }

    /* Ensure the Report Summary (Score + Metrics) is Centered */
    .report-summary {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        padding: 0 !important;
    }
}
/* --- PROFILE SEARCH BAR STYLES --- */
#reportSearch:focus {
    border-color: #005A9C !important; /* Primary Blue */
    box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.1);
}

#noResultsMsg {
    grid-column: 1 / -1; /* Ensures the message spans the full width of the grid */
    font-size: 16px;
    padding: 20px;
}
/* FORCE HIDE FOR SEARCH FILTER */
.search-hidden {
    display: none !important;
}
/* --- SEARCH BAR LAYOUT FIXES --- */

/* 1. Ensure the Grid Container stays stable */
#reportsGrid {
    min-height: 100px; /* Prevents page from collapsing when empty */
    position: relative;
}

/* 2. Style the "No Results" Box to sit perfectly inside */
.no-results-box {
    grid-column: 1 / -1; /* Forces it to span the whole row */
    width: 100%;
    text-align: center;
    padding: 40px;
    background: #f8fafc;
    border: 1px dashed #cbd5e0;
    border-radius: 12px;
    color: #718096;
    font-size: 16px;
    font-weight: 500;
    margin-top: 10px;
}

/* 3. Force Hide Class (Ensure this exists!) */
.search-hidden {
    display: none !important;
}
/* REMOVE TOP GAP FROM REPORTS GRID */
#reportsGrid {
    margin-top: 0 !important;
    padding-top: 0 !important;
    gap: 20px; /* Ensures consistent spacing between rows, but not top */
}

/* Optional: If the profile header above search is also huge */
.profile-header {
    margin-bottom: 15px !important;
}
/* ==========================================================================
   FIX: CLOSE GAP BETWEEN SEARCH AND REPORTS
   ========================================================================== */

/* 1. Force the Search Container to touch the bottom */
.search-container {
    margin-bottom: 0 !important;
    padding-bottom: 15px !important; /* Small breathing room only */
}

/* 2. Pull the Grid Upwards */
#reportsGrid {
    margin-top: 0 !important;
    padding-top: 0 !important;
    
    /* FIX: Sometimes Grids have a default gap that pushes content down */
    align-content: start !important; 
}

/* 3. Mobile Specific Pull (If it's worse on phone) */
@media (max-width: 768px) {
    #reportsGrid {
        /* Forcefully pull the grid up if the gap persists */
        margin-top: -10px !important; 
    }
    
    .search-container {
        margin-bottom: 5px !important;
    }
}
/* ==========================================================================
   MOBILE AUTH BUTTONS REMOVAL
   ========================================================================== */
@media (max-width: 768px) {
    /* Hide the 'OR' divider and the social login button container */
    .social-login-divider,
    .social-login-buttons {
        display: none !important;
    }

    /* Optional: Adjust spacing if the footer feels too far down after removal */
    .auth-form-container .form-footer {
        margin-top: 20px;
    }
}
/* ==========================================================================
   MOBILE NAVIGATION FIX
   ========================================================================== */
@media (max-width: 992px) {
    /* 1. Fix the main container alignment */
    .main-nav {
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important; /* Start from top, not center */
        align-items: center !important;
        padding-top: 100px !important; /* Give space for the header/logo area */
        gap: 0 !important; /* Control spacing via margins instead */
    }

    /* 2. Force the list items to be organized */
    .main-nav ul {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important; /* Tighten the gap between links */
        margin-bottom: 30px !important; /* Space before the buttons */
    }

    /* 3. Style the links for a cleaner "List" look */
    .main-nav .nav-link {
        width: 100%;
        text-align: center;
        padding: 15px 0 !important;
        font-size: 20px !important; /* Slightly smaller than your current 24px */
        border-bottom: 1px solid var(--color-background-light);
    }

    /* 4. Fix the Action Buttons (State Select, Credit Badge, etc.) */
    .nav-actions {
        flex-direction: column !important; /* Stack them vertically */
        width: 80% !important;
        margin-left: 0 !important; /* Remove the 'auto' margin from desktop */
        gap: 20px !important;
    }

    /* 5. Ensure the "Buy" button is full-width or prominent */
    .nav-actions .cta-button {
        width: 100% !important;
        justify-content: center !important;
        height: 50px !important; /* Taller touch target for mobile */
        font-size: 16px !important;
    }

    /* 6. State Select styling for mobile */
    #userStateSelect {
        width: 100% !important;
        height: 45px !important;
        font-size: 16px !important;
        text-align: center;
    }
}
/* ==========================================================================
   MOBILE STATE SELECT FIX
   ========================================================================== */
@media (max-width: 992px) {
    #userStateSelect {
        height: 48px !important;       /* Slightly increased height */
        line-height: 1.2 !important;   /* Centers text vertically */
        padding: 10px 12px !important; /* Balanced internal padding */
        appearance: none;              /* Removes default OS styling that can cause clipping */
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%234A5568' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: calc(100% - 15px) center; /* Positions a custom arrow */
        text-align: center;
        text-indent: 10px;             /* Better centering of the "ST" text */
    }
}
/* Better Scroll Lock for Mobile */
body.no-scroll {
    overflow: hidden !important;
    position: fixed; /* Prevents "bounce" scrolling on iOS */
    width: 100%;
    height: 100%;
}
