/* Base styles for the My Mobility Dashboard */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    /* Light background evokes the white fields of Jalur Gemilang */
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

header {
    /* Dark blue header reflecting Malaysia's national flag */
    background-color: #012169;
    color: white;
    padding: 1rem;
    text-align: left;
}

header h1 {
    margin: 0 0 0.5rem 0;
}

/* Government banner layout */
.gov-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.gov-banner .brand {
    max-width: 70%;
}
.gov-banner .lang-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.gov-banner select {
    padding: 0.3rem;
    border-radius: 4px;
    border: none;
    font-size: 0.9rem;
}

/* Screen reader only (hide visually but keep accessible) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

section {
    background-color: white;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

section h2 {
    margin-top: 0;
    /* Use dark blue for headings to maintain visual consistency */
    color: #012169;
}

controls, .results {
    margin-top: 1rem;
}

label {
    margin-right: 0.5rem;
}

select, button {
    margin: 0.5rem 0;
    padding: 0.4rem;
}

button {
    /* Primary action buttons use national red colour */
    background-color: #D8232A;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

button:hover {
    background-color: #B51B21;
}

.hidden {
    display: none;
}

/* Summary cards */
#summary .summary-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

#summary .summary-cards .card {
    flex: 1 1 calc(33.333% - 1rem);
    /* Card backgrounds follow dark blue palette */
    background-color: #012169;
    color: white;
    border-radius: 8px;
    padding: 1rem;
    min-width: 180px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#summary .summary-cards .card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Icon within summary cards */
.card-icon {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
    /* Yellow icons echo the Malaysian flag's moon and star */
    color: #FEDC00;
}

/* Service filter */
#serviceFilter select {
    margin-top: 0.5rem;
    padding: 0.4rem;
    border-radius: 4px;
    border: 1px solid #ccc;
}

/* E‑hailing section */
#eHailing button {
    margin-top: 0.5rem;
}
#rideResults p {
    margin-bottom: 0.3rem;
}

/* Weather & Traffic */
#weatherTraffic p {
    margin: 0.5rem 0;
}

/* News list styling */
#news ul {
    list-style: none;
    padding-left: 0;
}
#news li {
    margin-bottom: 0.6rem;
}
#news a {
    color: #012169;
    text-decoration: none;
}
#news a:hover {
    text-decoration: underline;
}

/* Traffic severity colours */
.traffic-low {
    color: #155724;
    font-weight: bold;
}
.traffic-medium {
    color: #856404;
    font-weight: bold;
}
.traffic-high {
    color: #721c24;
    font-weight: bold;
}

/* Copy summary button */
.copy-button {
    margin-top: 0.5rem;
    padding: 0.4rem 0.8rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.copy-button:hover {
    background-color: #218838;
}

/* Alerts */
#alerts ul {
    list-style: none;
    padding-left: 0;
}

#alerts li {
    padding: 0.6rem;
    margin-bottom: 0.6rem;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
}

.alert-high {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.alert-medium {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}
.alert-low {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.map-container {
    width: 100%;
    height: 400px;
    margin-top: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

footer {
    background-color: #f1f3f5;
    padding: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

footer .contact {
    margin-top: 0.5rem;
}
footer .contact a {
    color: #004a80;
    text-decoration: none;
}
footer .contact a:hover {
    text-decoration: underline;
}