/* M9 Metro - Ana Stiller */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.7;
    color: #333;
    background-color: #f8f9fa;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header & Navigation */
header {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    padding: 0.7rem 0;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: 56px;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: 0;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.3rem;
    z-index: 1001;
}

/* Main Content */
main {
    padding: 1.5rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    padding: 3rem 2rem;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    min-height: 180px;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.hero-section p {
    font-size: 1.15rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    line-height: 1.7;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Calculator */
.calculator-container {
    background: #fff;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
    min-height: 420px;
    contain: layout;
    position: relative;
}

.calculator-title {
    text-align: center;
    color: #1e3c72;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 1.5rem;
    min-height: 70px;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #1e3c72;
}

select, button {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    min-height: 48px;
}

select {
    height: 48px;
    background: #fff;
    cursor: pointer;
}

select:focus {
    outline: 0;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

button {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    border: 0;
    cursor: pointer;
    font-weight: 700;
    margin-top: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Search */
.search-container {
    margin-bottom: 2rem;
}

#stationSearch {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
}

/* Results */
.results-container {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    margin-top: 2rem;
    border-left: 5px solid #1e3c72;
    min-height: 200px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #dee2e6;
}

.result-item:last-child {
    border-bottom: 0;
}

.result-label {
    font-weight: 600;
    color: #1e3c72;
    font-size: 1rem;
}

.result-value {
    font-weight: 700;
    color: #2a5298;
    font-size: 1.15rem;
}

/* FAQ Section */
.faq-section {
    background: #fff;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
}

.faq-item {
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5rem;
}

.faq-question {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.faq-answer {
    color: #555;
    line-height: 1.8;
    font-size: 1rem;
}

/* Info Section */
.info-section {
    background: #fff;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
}

.info-section p {
    line-height: 1.8;
    margin-bottom: 1rem;
    color: #444;
}

.info-section ul, .info-section ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.info-section li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.section-title {
    color: #1e3c72;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 3px solid #2a5298;
    padding-bottom: 0.5rem;
    line-height: 1.4;
}

/* Map Container */
.map-container {
    text-align: center;
    margin: 2rem 0;
    padding: 1rem;
}

.map-container img {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    display: block;
    margin: 0 auto;
}

.map-container picture {
    display: block;
    width: 100%;
}

/* Station Times */
.station-times {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.time-item {
    background: #f8f9fa;
    padding: 1.25rem;
    border-radius: 8px;
    border-left: 4px solid #1e3c72;
    line-height: 1.6;
}

/* Popular Routes */
.popular-routes {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    padding: 2rem;
    border-radius: 15px;
    margin: 2rem 0;
}

.route-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.route-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    border: 0;
    color: #fff;
    text-align: left;
    width: 100%;
}

.route-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.2);
}

.route-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.route-card p {
    opacity: 0.9;
    font-size: 0.95rem;
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 1rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    z-index: 10;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.loading.show {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1e3c72;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* News Preview */
.news-preview {
    background: #fff;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.news-card {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(30, 60, 114, 0.1);
    border-color: #1e3c72;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.news-date {
    font-size: 0.85rem;
    color: #495057;
    font-weight: 500;
}

.news-category {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-card h3 {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    line-height: 1.4;
}

.news-card h3 a {
    color: #1e3c72;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-card h3 a:hover {
    color: #2a5298;
}

.news-card p {
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    color: #1e3c72 !important;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.read-more:hover {
    color: #2a5298 !important;
    transform: translateX(3px);
}

.news-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e1e5e9;
}

.see-all-news {
    display: inline-block;
}

/* Content Map */
.content-map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.content-map-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(30, 60, 114, 0.08);
    padding: 1.5rem 1rem;
    transition: box-shadow 0.2s;
}

.content-map-card:hover {
    box-shadow: 0 8px 32px rgba(30, 60, 114, 0.15);
}

.content-map-card h3 {
    font-size: 1.1rem;
    color: #1e3c72;
    margin-bottom: 1rem;
    text-align: center;
}

.content-map-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.content-map-card li {
    margin-bottom: 0.5rem;
    text-align: center;
}

.content-map-card a {
    color: #1e3c72;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.content-map-card a:hover {
    color: #2a5298;
    text-decoration: underline;
}

/* Accessibility */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: #1e3c72;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-main:focus {
    top: 0;
}

button:focus, select:focus, a:focus {
    outline: 3px solid #1e3c72;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    header, footer, .news-preview, button {
        display: none;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    header {
        padding: 0.5rem 0;
        min-height: 90px;
    }
    
    nav {
        padding: 0 0.8rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .nav-links {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        gap: 0.5rem;
        margin: 0;
        padding: 0;
    }
    
    .nav-links li {
        flex: 1;
        text-align: center;
    }
    
    .nav-links a {
        display: block;
        padding: 0.5rem;
        text-align: center;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .nav-links a:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .hero-section h1 {
        font-size: 1.6rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .calculator-container, .info-section, .faq-section {
        padding: 1.2rem;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .map-container img {
        border-radius: 8px;
    }
}

/* Dropdown Menu */
.nav-links .dropdown {
    position: relative;
}

.nav-links .dropbtn {
    cursor: pointer;
    display: block;
}

.nav-links .dropdown-content {
    display: none;
    position: absolute;
    background: #fff;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    border-radius: 8px;
    margin-top: 0.5rem;
    top: 100%;
    left: 0;
}

.nav-links .dropdown-content a {
    color: #1e3c72;
    padding: 0.8rem 1.2rem;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.nav-links .dropdown-content a:last-child {
    border-bottom: 0;
}

.nav-links .dropdown-content a:hover {
    background: #f0f4ff;
}
