/* ========================================= */
/* Global Styles (From Initial <style> block) */
/* ========================================= */

body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; 
    background: #faf9f6; 
    margin: 0; 
    padding: 0; 
}

/* --- Links --- */
a {
    color: #2d5a3f;
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: #4a7c59;
    text-decoration: underline;
}

/* --- NEW: Navigation Bar Styles --- */
/* This styles the <nav class="navbar"> element */
.navbar {
    background-color: #2d5a3f;
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.navbar .container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}
.navbar h1 a {
    color: white;
    text-decoration: none;
    padding: 0;
    display: inline;
    transition: opacity 0.3s;
}
.navbar h1 a:hover {
    opacity: 0.8;
}
.navbar h1 {
    color: white;
    margin: 0;
    font-size: 1.8rem;
}
.navbar a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    display: inline-block;
    transition: background-color 0.3s;
}
.navbar a:hover {
    background-color: #3d6b52;
}
.navbar .nav-primary {
    color: #8fd4a8;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.navbar .nav-primary:hover {
    color: #b5ecd5;
    background-color: #3d6b52;
}

/* --------------------------------------- */
/* --------------------------------------- */

/* --- General Layout Structure --- */
header { 
    padding: 25px 20px; 
    text-align: center; 
    background: white; 
    border-bottom: 1px solid #ddd; 
}
.container { 
    /* The base container width remains 1000px for main content */
    max-width: 1000px; 
    margin: 15px auto; 
    padding: 15px; 
}
.gallery { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); 
    gap: 20px; 
}
.video-card { 
    background: white; 
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
    cursor: pointer; 
    transition: 0.2s; 
}
.video-card:hover { 
    transform: translateY(-5px); 
}
.video-card img { 
    width: 100%; 
    height: 150px; 
    object-fit: cover; 
    object-position: top; 
    display: block; 
}
.video-info { 
    padding: 15px; 
}
.video-info strong { 
    display: block; 
    color: #4a7c59; 
    font-size: 1.2rem; 
}

/* --- Pagination Styles --- */
.pagination-controls {
    margin: 25px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}
.pagination-controls button {
    padding: 10px 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    background-color: #4a7c59;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background 0.3s, opacity 0.3s;
}
.pagination-controls button:hover:not(:disabled) {
    background-color: #3a6347;
}
.pagination-controls button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}
#pageIndicator {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
}
/* ------------------------ */

/* Gallery intro */
.gallery-intro {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 20px;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}
.gallery-intro a {
    color: #4a7c59;
    font-weight: bold;
}

/* Modal Styles */
.modal { 
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.9); 
    justify-content: center; 
    align-items: center; 
}
.modal-content { 
    width: 80%; 
    max-width: 800px; 
    position: relative; 
}
video { 
    width: 100%; 
    border-radius: 5px; 
}
.close-btn { 
    /* Adjusted top value for better placement */
    position: absolute; 
    top: -20px; 
    right: 0; 
    color: white; 
    font-size: 30px; 
    cursor: pointer; 
}
.modal-help-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 28px;
    text-align: center;
    z-index: 10;
    transition: background 0.2s;
}
.modal-help-btn:hover {
    background: rgba(0,0,0,0.8);
}
.modal-help-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    cursor: pointer;
}
.modal-help-content {
    background: #222;
    border-radius: 8px;
    padding: 20px 28px;
    min-width: 260px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.modal-help-content h4 {
    margin: 0 0 14px;
    color: white;
    font-size: 1rem;
    text-align: center;
}
.modal-help-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ccc;
    font-size: 0.85rem;
    margin-bottom: 8px;
}
.modal-help-item kbd {
    display: inline-block;
    background: #444;
    border: 1px solid #666;
    border-radius: 4px;
    padding: 2px 8px;
    font-family: inherit;
    font-size: 0.8rem;
    color: white;
    min-width: 55px;
    text-align: center;
}
#modal-caption { 
    color: white; 
    text-align: center; 
    margin-top: 10px; 
}

/* Report Styles (From the initial <style> block) */
.vehicle-count-report {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
h2 {
    text-align: center;
    color: #333;
    border-bottom: 2px solid #4a7c59; 
    padding-bottom: 10px;
    margin-bottom: 20px;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
thead tr {
    background-color: #4a7c59;
    color: white;
}
th, td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: center;
}
th:first-child, td:first-child {
    text-align: left;
}
tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}
tbody tr:hover {
    background-color: #f0f7f3;
}
.report-footer {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid #ccc;
    text-align: center;
    font-size: 0.9em;
    color: #666;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 10px;
    }
    
    .navbar h1 {
        font-size: 1.3rem;
    }
    
    .navbar a {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    header h2 {
        font-size: 1rem;
    }
    
    .gallery {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .vehicle-count-report {
        padding: 20px;
    }
    
    table {
        font-size: 0.75rem;
        width: 100%;
        table-layout: auto;
    }
    
    th, td {
        padding: 6px 4px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    th:first-child, td:first-child {
        text-align: left;
        min-width: 80px;
    }
    
    .pagination-controls {
        flex-direction: column;
    }
    
    /* Mobile-friendly form */
    .mobile-friendly-form .form-group {
        margin-bottom: 15px;
    }
    
   .mobile-friendly-form input {
        width: 100%;
        padding: 10px;
        font-size: 16px;
        box-sizing: border-box;
    }
    
    .mobile-friendly-form button {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }
    
    .mobile-friendly-form .form-group label {
        font-size: 0.85rem;
    }
}

/* History Page Form Fields */
.report-form-container select,
.report-form-container input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
    color: #333;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.report-form-container select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234a7c59' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.report-form-container select:focus,
.report-form-container input[type="number"]:focus {
    border-color: #4a7c59;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.15);
}
    
    /* Horizontal scroll for tables */
    .report-display {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .report-display table {
        min-width: 300px;
    }
    
    .chart-scroll-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .chart-display {
        overflow: visible;
        margin: 20px 10px;
        padding: 10px;
    }
    
    .chart-display canvas {
        min-width: 320px;
    }
}

@media (max-width: 480px) {
    .navbar a {
        font-size: 0.75rem;
        padding: 5px 6px;
    }
    
    table {
        font-size: 0.7rem;
    }
    
    th, td {
        padding: 4px 3px;
    }
    
    .report-display table {
        min-width: 280px;
    }
    
    .chart-display canvas {
        min-width: 280px;
    }
    
    header {
        padding: 20px 10px;
    }
    
    .container {
        margin: 10px auto;
        padding: 10px 5px;
    }
    
    .report-form-container {
        padding: 10px;
    }
    
    .report-form-container .button-group {
        flex-direction: column;
    }
}

@media (max-width: 600px) and (orientation: portrait) {
    .chart-scroll-wrapper {
        width: 100%;
        min-width: 900px;
    }
    
    .chart-display {
        overflow: visible;
    }
    
    .chart-display canvas {
        width: 900px !important;
        height: 450px !important;
    }
    
    .chart-display h2 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .report-display {
        font-size: 0.75rem;
    }
    
    .report-display table {
        font-size: 0.7rem;
    }
    
    .report-display th,
    .report-display td {
        padding: 3px 2px !important;
    }
}

/* Chart Display Styles */
.chart-display {
    max-width: 1200px;
    margin: 30px auto;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.chart-display h2 {
    text-align: center;
    color: #333;
    border-bottom: 2px solid #4a7c59;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.chart-display canvas {
    max-width: 100%;
}

.chart-display .chartjs-render-monitor {
    max-width: 100%;
}

/* Report Form Button Styles */
.report-form-container button {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    background-color: #4a7c59;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background 0.3s;
    margin-top: 15px;
}

.report-form-container button:hover {
    background-color: #3a6347;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.button-group button {
    flex: 1;
    margin-top: 0;
}

/* Stats Cards (Homepage) */
.section-title {
    text-align: center;
    color: #333;
    border-bottom: 2px solid #4a7c59;
    padding-bottom: 10px;
    margin-bottom: 8px;
    font-size: 1.3rem;
}

.section-subtitle {
    text-align: center;
    color: #777;
    font-size: 0.8rem;
    margin: 0 auto 20px;
    max-width: 600px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #4a7c59;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
    margin-top: 6px;
}

.mini-chart-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    max-height: 220px;
}

.pain-points-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.pain-points-container h3 {
    text-align: center;
    color: #333;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1rem;
}

.pain-points-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 700px;
    margin: 0 auto;
}

.pain-point-item {
    display: grid;
    grid-template-columns: 120px 1fr 40px;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.pain-label {
    text-align: right;
    color: #333;
    font-weight: 500;
}

.pain-bar-bg {
    background: #e9ecef;
    border-radius: 4px;
    height: 20px;
    overflow: hidden;
}

.pain-bar-fill {
    background: linear-gradient(90deg, #4a7c59, #e74c3c);
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.pain-count {
    text-align: right;
    font-weight: bold;
    color: #333;
}

/* Meetings Page */
.meeting-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.meeting-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-left: 4px solid #4a7c59;
}

.meeting-item.past {
    border-left-color: #999;
}

.meeting-date {
    display: inline-block;
    background: #e8f5e9;
    color: #4a7c59;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.meeting-item h3 {
    margin: 5px 0;
    color: #333;
}

.meeting-item p {
    margin: 4px 0;
    color: #555;
    line-height: 1.5;
}

/* Subscribe Card */
.subscribe-card {
    background: white;
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-left: 4px solid #4a7c59;
    margin-bottom: 20px;
    max-width: 600px;
}

.subscribe-card h3 {
    margin: 0 0 8px;
    color: #333;
    font-size: 1.1rem;
}

.subscribe-card p {
    margin: 0 0 15px;
    color: #666;
    font-size: 0.9rem;
}

.subscribe-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.subscribe-fields input[type="email"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    flex: 1;
    min-width: 180px;
}

.subscribe-fields input[type="text"]:not(.subscribe-honeypot) {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    flex: 1;
    min-width: 220px;
}

.subscribe-fields button {
    padding: 8px 20px;
    background-color: #4a7c59;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
}

.subscribe-fields button:hover {
    background-color: #3a6347;
}

.subscribe-fields button:disabled {
    background-color: #999;
    cursor: not-allowed;
}

.subscribe-honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

.subscribe-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.subscribe-message.success {
    background-color: #e8f5e9;
    color: #2d5a3f;
    border: 1px solid #a5d6a7;
}

.subscribe-message.error {
    background-color: #fce4ec;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* Mobile Responsive for Stats */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .stat-card {
        padding: 15px 10px;
    }

    .pain-point-item {
        grid-template-columns: 90px 1fr 30px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .stat-card {
        padding: 12px 8px;
    }

    .pain-point-item {
        grid-template-columns: 70px 1fr 25px;
        font-size: 0.7rem;
        gap: 6px;
    }

    .mini-chart-container {
        padding: 12px;
    }

    .subscribe-fields {
        flex-direction: column;
    }

    .subscribe-fields input[type="email"],
    .subscribe-fields input[type="text"]:not(.subscribe-honeypot) {
        width: 100%;
        min-width: auto;
    }

    .subscribe-fields button {
        width: 100%;
        padding: 12px;
    }
}

/* Dashboard Tabs */
.dash-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    justify-content: center;
}

.dash-tab {
    padding: 8px 20px;
    background: white;
    border: 2px solid #4a7c59;
    border-radius: 5px 5px 0 0;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    color: #4a7c59;
    transition: background 0.2s, color 0.2s;
}

.dash-tab:hover {
    background: #f0f7f3;
}

.dash-tab.active {
    background: #4a7c59;
    color: white;
}

.dash-tab-content {
    display: none;
}

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

.dash-subtitle {
    text-align: center;
    color: #333;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1rem;
}

/* Today Stats Row */
.today-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.today-stat {
    background: white;
    border-radius: 8px;
    padding: 15px 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.today-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4a7c59;
    display: block;
    line-height: 1.2;
}

.today-stat-label {
    font-size: 0.75rem;
    color: #666;
    margin-top: 4px;
    display: block;
}

/* Today Speed Distribution */
.today-dist-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.today-dist-container h3 {
    text-align: center;
    color: #333;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1rem;
}

.today-dist-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 600px;
    margin: 0 auto;
}

.today-dist-bar {
    display: grid;
    grid-template-columns: 80px 1fr 100px;
    align-items: center;
    gap: 8px;
}

.today-bar-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    text-align: right;
}

.today-bar-bg {
    background: #e9ecef;
    border-radius: 4px;
    height: 18px;
    overflow: hidden;
}

.today-bar-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.today-bar-count {
    font-size: 0.75rem;
    color: #555;
    text-align: right;
}

/* Today Hourly Violations */
.today-hourly-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.today-hourly-container h3 {
    text-align: center;
    color: #333;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1rem;
}

.today-hourly-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 600px;
    margin: 0 auto;
}

.today-hourly-item {
    display: grid;
    grid-template-columns: 70px 1fr 35px;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.today-hourly-label {
    text-align: right;
    font-weight: 500;
    color: #333;
}

.today-hourly-bg {
    background: #e9ecef;
    border-radius: 4px;
    height: 16px;
    overflow: hidden;
}

.today-hourly-fill {
    display: block;
    height: 100%;
    background: #4a7c59;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.today-hourly-count {
    text-align: right;
    font-weight: bold;
    color: #333;
}

/* Dashboard Loading & Last Updated */
.dashboard-loading {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    padding: 40px 0;
}

.dashboard-last-updated {
    text-align: center;
    color: #999;
    font-size: 0.75rem;
    margin-top: 0;
    margin-bottom: 15px;
    font-style: italic;
}

.today-empty {
    text-align: center;
    color: #888;
    padding: 30px 0;
    font-size: 0.9rem;
}

/* Mobile Responsive for Dashboard Tabs */
@media (max-width: 768px) {
    .today-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .today-stat-value {
        font-size: 1.2rem;
    }

    .today-stat {
        padding: 12px 8px;
    }

    .today-dist-bar {
        grid-template-columns: 60px 1fr auto;
        gap: 6px;
    }

    .today-bar-label {
        font-size: 0.75rem;
    }

    .today-bar-count {
        font-size: 0.7rem;
    }

    .today-hourly-item {
        grid-template-columns: 55px 1fr 25px;
        gap: 4px;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .dash-tab {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .today-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .today-stat-value {
        font-size: 1.1rem;
    }

    .today-stat-label {
        font-size: 0.65rem;
    }

    .today-dist-bar {
        grid-template-columns: 50px 1fr auto;
        gap: 4px;
    }

    .today-bar-label {
        font-size: 0.7rem;
    }

    .today-bar-count {
        font-size: 0.65rem;
    }

    .today-hourly-item {
        grid-template-columns: 45px 1fr 20px;
        font-size: 0.65rem;
    }
}

/* Community Voice Page */
.community-voice-page {
    max-width: 700px;
    margin: 0 auto;
}

.feedback-form label {
    display: block;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.road-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    justify-content: center;
}

.road-chip {
    padding: 6px 14px;
    border: 2px solid #4a7c59;
    border-radius: 20px;
    background: white;
    color: #4a7c59;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.road-chip:hover {
    background: #f0f7f3;
}

.road-chip.selected {
    background: #4a7c59;
    color: white;
}

.feedback-form input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.feedback-name-group {
    margin-top: 12px;
}

.feedback-name-group label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 6px;
}

.feedback-name-group input[type="text"] {
    font-size: 0.9rem;
}

.feedback-helper {
    font-size: 0.8rem;
    color: #888;
    margin: 8px 0 0;
    font-style: italic;
}

.feedback-form button[type="submit"] {
    margin-top: 15px;
    padding: 10px 24px;
    background: #4a7c59;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.feedback-form button[type="submit"]:hover {
    background: #3a6347;
}

.feedback-form button[type="submit"]:disabled {
    background: #999;
    cursor: not-allowed;
}

.feedback-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.feedback-message.success {
    background-color: #e8f5e9;
    color: #2d5a3f;
    border: 1px solid #a5d6a7;
}

.feedback-message.error {
    background-color: #fce4ec;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.community-results {
    margin-top: 30px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.community-results h3 {
    text-align: center;
    color: #333;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1rem;
}

.feedback-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 600px;
    margin: 0 auto;
}

.feedback-bar-item {
    display: grid;
    grid-template-columns: 140px 1fr 30px;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.feedback-bar-label {
    text-align: right;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feedback-bar-bg {
    background: #e9ecef;
    border-radius: 4px;
    height: 18px;
    overflow: hidden;
}

.feedback-bar-fill {
    display: block;
    height: 100%;
    background: #4a7c59;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.feedback-bar-count {
    text-align: right;
    font-weight: bold;
    color: #333;
}

/* Report Card Page */
.report-card-page {
    background: #e8e8e8;
    font-family: sans-serif;
    padding: 0;
    margin: 0;
}

.rc-controls {
    background: white;
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.rc-controls-inner {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: center;
}

.rc-controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rc-controls-row label {
    font-size: 0.9rem;
    font-weight: bold;
    color: #333;
}

.rc-controls-row input[type="date"] {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.9rem;
}

.rc-controls-row button {
    padding: 7px 18px;
    background: #4a7c59;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
}

.rc-controls-row button:hover {
    background: #3a6347;
}

.rc-print-btn {
    padding: 8px 24px;
    background: #2d5a3f;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
}

.rc-print-btn:hover {
    background: #1e3d2a;
}

.rc-page {
    max-width: 800px;
    margin: 0 auto 40px;
    padding: 0 15px;
}

.rc-page > div {
    background: white;
    border-radius: 4px;
    padding: 30px 35px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.rc-header {
    text-align: center;
    border-bottom: 3px solid #4a7c59;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.rc-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #2d5a3f;
}

.rc-header h2 {
    margin: 4px 0 2px;
    font-size: 1.2rem;
    color: #333;
    border: none;
    padding: 0;
}

.rc-date-range {
    margin: 4px 0 0;
    font-size: 0.95rem;
    color: #555;
    font-weight: 500;
}

.rc-location {
    margin: 2px 0 0;
    font-size: 0.85rem;
    color: #777;
}

.rc-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.rc-stat {
    background: #f8faf8;
    border-radius: 6px;
    padding: 12px 8px;
    text-align: center;
    border-left: 3px solid #4a7c59;
}

.rc-stat-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: #2d5a3f;
    line-height: 1.2;
}

.rc-stat-label {
    font-size: 0.7rem;
    color: #666;
    line-height: 1.3;
    margin-top: 4px;
}

.rc-section {
    margin-bottom: 18px;
}

.rc-section h3 {
    font-size: 0.95rem;
    color: #333;
    border-bottom: 2px solid #4a7c59;
    padding-bottom: 5px;
    margin: 0 0 10px;
}

.rc-section-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.rc-half h3 {
    font-size: 0.95rem;
    color: #333;
    border-bottom: 2px solid #4a7c59;
    padding-bottom: 5px;
    margin: 0 0 10px;
}

.rc-dist-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rc-dist-bar {
    display: grid;
    grid-template-columns: 80px 1fr 100px;
    align-items: center;
    gap: 8px;
}

.rc-bar-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    text-align: right;
}

.rc-bar-fill {
    display: block;
    height: 16px;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.rc-bar-count {
    font-size: 0.75rem;
    color: #555;
    text-align: right;
}

.rc-callout {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fce4ec;
    border-radius: 4px;
    border-left: 3px solid #c0392b;
    font-size: 0.85rem;
    color: #8b0000;
}

.rc-pain-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rc-pain-item {
    display: grid;
    grid-template-columns: 90px 1fr 35px;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
}

.rc-pain-label {
    text-align: right;
    font-weight: 500;
    color: #333;
}

.rc-pain-bar-bg {
    background: #e9ecef;
    border-radius: 3px;
    height: 14px;
    overflow: hidden;
}

.rc-pain-bar-fill {
    display: block;
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}
.heat-1 .rc-pain-bar-fill { background: #8b0000; }
.heat-2 .rc-pain-bar-fill { background: #c0392b; }
.heat-3 .rc-pain-bar-fill { background: #d4563a; }
.heat-4 .rc-pain-bar-fill { background: #e07a4a; }
.heat-5 .rc-pain-bar-fill { background: #e8a05a; }

.rc-pain-share {
    display: block;
    font-size: 0.65rem;
    font-weight: normal;
    color: #888;
}

.rc-pain-count {
    font-weight: bold;
    color: #333;
    text-align: right;
}

.rc-dir-note {
    font-size: 0.7rem;
    color: #999;
    margin: -5px 0 8px;
    font-style: italic;
}

.rc-dir-table {
    display: flex;
    gap: 15px;
}

.rc-dir-row {
    flex: 1;
    background: #f8faf8;
    border-radius: 6px;
    padding: 12px;
    border-left: 3px solid #4a7c59;
}

.rc-dir-row strong {
    display: block;
    font-size: 0.9rem;
    color: #2d5a3f;
    margin-bottom: 6px;
}

.rc-dir-row p {
    margin: 3px 0;
    font-size: 0.8rem;
    color: #555;
}

.rc-trend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.rc-trend-periods {
    display: flex;
    gap: 20px;
}

.rc-trend-per {
    text-align: center;
}

.rc-trend-val {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2d5a3f;
}

.rc-trend-sub {
    font-size: 0.75rem;
    color: #777;
}

.rc-trend-arrow {
    font-size: 1.1rem;
    color: #c0392b;
    font-weight: bold;
}

.rc-trend-arrow.down {
    color: #4a7c59;
}

.rc-trend-diff {
    font-size: 0.85rem;
    color: #333;
}

.rc-bottom-line {
    margin-top: 20px;
    padding: 15px 18px;
    background: #f8faf8;
    border-radius: 6px;
    border-left: 4px solid #4a7c59;
}

.rc-bottom-line p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
}

.rc-bottom-line strong {
    color: #2d5a3f;
}

.rc-footer {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #ddd;
    text-align: center;
    font-size: 0.7rem;
    color: #888;
    line-height: 1.5;
}

.rc-footer p {
    margin: 2px 0;
}

.rc-empty {
    font-size: 0.85rem;
    color: #999;
    font-style: italic;
}

.no-print {
    /* screen only */
}

@media (max-width: 600px) {
    .rc-controls-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .rc-controls-row {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .rc-controls-row input[type="date"] {
        width: 100%;
        box-sizing: border-box;
    }

    .rc-controls-row button {
        width: 100%;
    }

    .rc-print-btn {
        width: 100%;
    }

    .rc-page > div {
        padding: 15px 12px;
    }

    .rc-header h1 {
        font-size: 1.2rem;
    }

    .rc-header h2 {
        font-size: 1rem;
    }

    .rc-date-range {
        font-size: 0.8rem;
    }

    .rc-location {
        font-size: 0.75rem;
    }

    .rc-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .rc-stat-value {
        font-size: 1.2rem;
    }

    .rc-stat {
        padding: 10px 6px;
    }

    .rc-section-half {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .rc-dist-bar {
        grid-template-columns: 60px 1fr auto;
        gap: 6px;
    }

    .rc-bar-label {
        font-size: 0.75rem;
    }

    .rc-bar-fill {
        height: 14px;
    }

    .rc-bar-count {
        font-size: 0.7rem;
    }

    .rc-pain-item {
        grid-template-columns: 70px 1fr 30px;
        gap: 4px;
        font-size: 0.75rem;
    }

    .rc-dir-table {
        flex-direction: column;
        gap: 10px;
    }

    .rc-trend {
        flex-direction: column;
        gap: 15px;
    }

    .rc-trend-periods {
        gap: 15px;
    }

    .rc-trend-val {
        font-size: 1.2rem;
    }

    .rc-callout {
        font-size: 0.8rem;
    }

    .rc-bottom-line p {
        font-size: 0.85rem;
    }

    .rc-section h3,
    .rc-half h3 {
        font-size: 0.85rem;
    }
}

/* Community Voice Mobile */
@media (max-width: 480px) {
    .road-chips {
        gap: 6px;
    }

    .road-chip {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .feedback-bar-item {
        grid-template-columns: 90px 1fr 25px;
        gap: 6px;
        font-size: 0.75rem;
    }

    .feedback-bar-label {
        font-size: 0.75rem;
    }
}

@media print {
    .no-print {
        display: none !important;
    }

    .report-card-page {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .rc-page {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .rc-page > div {
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 15px 25px !important;
    }

    .rc-stats {
        gap: 8px;
    }

    .rc-stat {
        padding: 8px 5px;
    }

    .rc-stat-value {
        font-size: 1.2rem;
    }

    .rc-section {
        margin-bottom: 12px;
    }

    .rc-section-half {
        gap: 12px;
    }

    .rc-bar-fill {
        height: 12px;
    }

    .rc-pain-item {
        grid-template-columns: 70px 1fr auto;
        gap: 4px;
        font-size: 0.75rem;
    }

    .rc-pain-share {
        display: none;
    }

    .rc-bar-fill, .rc-pain-bar-fill {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .rc-stat, .rc-dir-row, .rc-callout, .rc-bottom-line {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    @page {
        margin: 0.5in;
        size: letter;
    }
}

