/* ==========================================================================
   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;
}

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
   ========================================================================== */
.main-header {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}
.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;
    margin-bottom: 20px;
}

.loading-gif {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    display: block;
}

.road-line { display: none; }
.road-line::before { content: none; }
.car { display: none; }
.car-body { animation: none; transform-origin: initial; }
.car .wheel { animation: none; transform-origin: initial; }

/* --- LOADING TEXT (Premium Sans-Serif - Faded Steel Blue) --- */
.loading-text {
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* Close to animation */
    margin-top: 8px; 
    
    /* Premium UI Font Stack: Uses "Inter" if available, falls back to high-end system fonts */
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Large, readable size */
    font-size: 24px;   
    
    /* Semi-bold for presence */
    font-weight: 600;  
    
    /* Subtle tight tracking for a modern look */
    letter-spacing: -0.02em; 
    
    /* Faded Steel Blue */
    color: #5C80A5;    
    
    /* Crisp text rendering */
    -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; 
    
    /* Dots match the text color */
    color: #5C80A5; 
    
    /* Ensure dots match the font */
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 24px; 
    font-weight: 600; 
}

.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;
}
.score-circle {
    width: 170px; 
    height: 170px;
    border-radius: 50%;
    background: conic-gradient(var(--dynamic-score-color, var(--color-primary)) var(--score, 0deg), var(--color-background-light) 0);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: var(--font-heading);
    position: relative; 
    border: 10px solid var(--color-background-white); 
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1), var(--shadow-lg);
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background-color: var(--color-background-white);
    z-index: 1;
}

.score-circle .score-number {
    font-size: 48px;
    font-weight: 900;
    line-height: 1;
    color: var(--color-text-heading); 
    z-index: 2;
}
.score-circle .score-label {
    font-size: 12px; 
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-body);
    opacity: 1;
    z-index: 2;
}

.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);
}
.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. FIX: Organize Specifications (Clean Stacking) */
    .details-list li {
        display: flex;
        flex-wrap: wrap; /* Allows items to break onto new lines */
        align-items: center;
        justify-content: space-between;
        padding: 15px 0; /* More breathing room */
        gap: 5px; 
    }

    /* Label goes Top-Left */
    .details-list li .detail-label {
        font-size: 13px;
        font-weight: 700;
        color: #718096; /* Muted gray for label */
        text-transform: uppercase;
        letter-spacing: 0.5px;
        order: 1; 
    }

    /* Score goes Top-Right */
    .details-list li .score-pill {
        order: 2; 
    }

    /* Value goes on a NEW LINE (Full Width) */
    .details-list li .detail-value {
        order: 3; 
        width: 100%; /* Force it to take the full next line */
        text-align: left; /* Align text to the left */
        font-size: 17px;
        font-weight: 500;
        color: #2d3748; /* Darker color for readability */
        margin-top: 6px; /* Space between label and value */
    }
}