/* Horizontal scroll for charts on mobile/tablet to match C70 (override stacking) */

/* ...existing code... */

@media (max-width: 900px) {
    .charts-grid {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 20px;
        padding: 10px 0 10px 0;
    }
    .chart-container {
        min-width: 90vw;
        max-width: 95vw;
        flex: 0 0 90vw;
        padding: 8px;
        box-sizing: border-box;
        height: 45vh;
        min-height: 260px;
    }
}
/* Base Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container and Typography */
.container {
    width: 90%;
    max-width: 1400px;
    margin: 20px auto;
    padding: 10px;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-radius: 8px;
}

h1, h2 {
    text-align: center;
    color: #003057;
    font-weight: 500;
    width: 100%;
    margin: 20px 0;
}

h1 {
    font-size: 2.5em;
    font-weight: normal;
}

/* Stats Table */
.stats-table {
    width: 80%;
    max-width: 800px;
    border-collapse: collapse;
    margin: 20px auto;
    table-layout: fixed;
}

.stats-table th, 
.stats-table td {
    border: 1px solid #ddd;
    padding: 8px 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-table th {
    background: #003057;
    color: white;
    font-size: 0.95em;
}

/* Registration Form */
.registration_form {
    width: 50%;
    margin: 20px auto 40px;
    padding: 20px;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 8px;
    margin-top: 8px;
}

.registration_form form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0;
}

.registration_form input[type="text"],
.registration_form select {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    margin-bottom: 3px;
    padding: 2px;
    display: inline-block;
    max-width: 12ch;
}

.registration_form input[type="submit"] {
    width: 100%;
    padding: 12px;
    background-color: #003057;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 20px;
}

.registration_form label {
    margin-bottom: 1px;
    display: block;
    display: inline-block;
    margin-right: 5px;
}

.registration_form select {
    max-width: 20ch;
}

.registration_form h2 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
}

.stats-link {
    color: inherit;
    text-decoration: none;
}

.stats-link:hover {
    text-decoration: underline;
    cursor: pointer;
}

/* Checkbox Groups */
.checkbox-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: 10px 0;
    padding: 5px 0;
    margin: 2px 0;
    line-height: 1.2;
}

.checkbox-group input[type="checkbox"] {
    order: 2;
    margin: 0 0 0 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-group label {
    order: 1;
    margin: 0;
    white-space: nowrap;
    display: inline;
    margin-left: 3px;
}

/* Body Type Container and Model Sections */
.body-type-container {
    width: auto;
    max-width: 600px;
    min-width: 200px;
    margin: 20px auto;
    padding: 15px;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    text-align: center;
    margin-top: 0;
    padding-top: 0;
}

.model-section {
    text-align: center;
    margin: 30px auto;
    padding: 20px;
    border: 2px solid #003057;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 1em;
}

h2.model-title,
.model-title {
    font-size: 52px !important;
    font-weight: 800 !important;
    color: #003057 !important;
    margin: 0 0 30px 0 !important;
    padding: 15px 0 !important;
    text-align: center !important;
    border-bottom: 3px solid #003057 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1) !important;
    display: block !important;
}

.model-section h3 {
    font-size: 0.65em;
    margin: 0;
    font-weight: normal;
}

/* Engine Table */
.engine-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    margin-bottom: 1.5em;
}

.engine-table th,
.engine-table td {
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
}

.engine-table th {
    background: #003057;
    color: white;
}

.engine-table td:nth-child(2) { color: #008000; font-weight: bold; }
.engine-table td:nth-child(3) { color: #ffa500; font-weight: bold; }
.engine-table td:nth-child(4) { color: #ff0000; font-weight: bold; }

/* Overlay */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: none;
    z-index: 1000;
}

.overlay-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    text-align: center;
}

.overlay-content button {
    padding: 10px 20px;
    background-color: #003057;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Blocked Message */
.blocked-message {
    background-color: #ffebee;
    border: 1px solid #ef5350;
    color: #c62828;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
    text-align: center;
}

.blocked-message .error {
    color: #d63031;
    font-weight: bold;
    margin: 0;
}

.blocked-message p {
    margin: 5px 0;
    font-size: 16px;
}

/* Footer */
.copyright {
    width: 100%;
    text-align: center;
    padding: 20px 0;
    background: white;
    border-top: 1px solid #ddd;
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container { width: 95%; padding: 15px; }
    .registration_form,
    .body-type-container { width: 90%; }
    .model-title { 
        font-size: 36px !important;
        letter-spacing: 1px !important;
    }
}

/* New styles for inline form rows */
.registration_form .form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 3px;
}
.registration_form .form-row label {
    margin-right: 5px;
}
.registration_form .form-row input[type="text"],
.registration_form .form-row select {
    max-width: 12ch;
}
.registration_form .form-row select {
    max-width: 20ch; /* updated from 12ch to 20ch */
}

/* Additional styles for the statistics page, previously inline in V70_statistics.php */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.filters {
    margin: 5px 0;
    padding: 5px;
    background: white;
    border-radius: 4px;
    display: inline-flex;
    gap: 5px;
}
.stats-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}
.stat-card {
    background: white;
    border-radius: 4px;
    padding: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.stat-card h3 {
    margin: 0 0 5px 0;
    font-size: 0.9em;
}
.stat-card p {
    margin: 0;
    font-size: 0.8em;
}
.charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.chart-container {
    background: white;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    height: 300px;
    cursor: pointer;
    transition: transform 0.2s;
}
.chart-container:hover {
    transform: scale(1.02);
}
.quick-stats {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.8em;
}
.quick-stat {
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 4px;
    white-space: nowrap;
}
/* Modal styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    overflow: hidden;
}
.modal-content {
    background-color: #fff;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 90vh;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 8px;
}
#modalChartContainer {
    width: 100%;
    height: calc(100% - 40px);
    position: relative;
}
#modalChart {
    width: 100% !important;
    height: 100% !important;
}
.close-modal {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
    z-index: 10000;
}

/* Responsive Styles for Tablet (max-width: 768px) */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 15px;
    }
    /* Remove grid styles from charts-grid to allow flex scroll on mobile */
    .charts-grid {
        grid-template-columns: unset !important;
        gap: 0 !important;
    }
    .chart-container {
        height: 250px; /* Adjust container height */
    }
    h1, h2 {
        font-size: 2em;
    }
    .quick-stats {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    /* Responsive table wrapper for stats tables */
    .stats-table-wrapper {
        width: 100%;
        overflow-x: auto;
        display: flex;
        justify-content: center;
    }
    .stats-table {
        min-width: 350px;
        width: auto;
        margin: 0 auto;
    }
}

/* Responsive Styles for Smartphone (max-width: 480px) */
@media (max-width: 480px) {
    .container {
        width: 98%;
        padding: 10px;
    }
    h1 {
        font-size: 1.8em;
    }
    h2 {
        font-size: 1.6em;
    }
    .quick-stats {
        flex-direction: column;
    }
    /* Adjust any other font sizes or spacing as needed */
}
