/**
 * NOTAM Viewer - Main Stylesheet
 * Version: 1.0.0
 * Responsive, modern design with dark mode support
 */

/* CSS Variables */
:root {
    --primary-color: #1976d2;
    --primary-dark: #1565c0;
    --primary-light: #2196F3;
    --secondary-color: #FF9800;
    --success-color: #4CAF50;
    --danger-color: #F44336;
    --warning-color: #FFC107;
    --text-primary: #212121;
    --text-secondary: #757575;
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-card: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-card: #2a2a2a;
    --border-color: #3a3a3a;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: var(--transition);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.app-header {
    background: var(--primary-color);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.logo a {
    color: white;
    text-decoration: none;
}

.tagline {
    font-size: 14px;
    opacity: 0.9;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: var(--transition);
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
}

/* Ads */
.ad-container {
    margin: 20px auto;
    text-align: center;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-top {
    background: var(--bg-card);
    padding: 10px;
    border-radius: 8px;
}

.ad-infeed {
    margin: 30px 0;
}

/* Main Content */
.main-content {
    min-height: 70vh;
    padding: 30px 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 160px 1fr 160px;
    gap: 20px;
    align-items: start;
}

.main-area {
    min-width: 0;
}

/* Sidebars */
.sidebar {
    position: relative;
}

.sticky-sidebar {
    position: sticky;
    top: 100px;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 20px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: 12px;
    margin-bottom: 30px;
}

.hero-section h2 {
    font-size: 36px;
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: 18px;
    opacity: 0.95;
}

/* Search Section */
.search-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.search-card h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    font-size: 20px;
    pointer-events: none;
    z-index: 1;
}

.form-control {
    width: 100%;
    padding: 14px 14px 14px 50px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(25,118,210,0.1);
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-icon {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 18px;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 24px;
    padding: 8px;
    cursor: pointer;
}

/* Location Display */
.location-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(180deg, #FF6B6B, #f94242);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 600;
    margin-bottom: 20px;
}

.location-flag {
    font-size: 24px;
}

.location-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

/* Filter Section */
.filter-card {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.filter-count {
    position: absolute;
    right: 15px;
    background: var(--secondary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 8px;
}

.notam-count {
    margin-left: auto;
    font-weight: 600;
    color: var(--primary-color);
}

/* NOTAMs Container */
.notams-container {
    min-height: 400px;
}

/* NOTAM Card */
.notam-card {
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    border: 2px solid transparent;
}

.notam-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
}

.notam-header {
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
}

.notam-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
}

.notam-active-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 10px;
    padding: 2px 10px;
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    vertical-align: middle;
    white-space: nowrap;
    animation: badge-pulse 2.5s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.65; }
}

/* Dark-mode friendliness */
@media (prefers-color-scheme: dark) {
    .notam-active-badge {
        background: rgba(34, 197, 94, 0.2);
        color: #4ade80;
        border-color: rgba(74, 222, 128, 0.4);
    }
}

/* Format badge (ICAO / FAA) */
.notam-format-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    vertical-align: middle;
    white-space: nowrap;
}

.notam-format-icao {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.notam-format-faa {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.35);
    
     }
    
  .type-fir {
        background: rgba(237, 88, 108, 0.2);
        color: #e61531;
        border-color: rgba(207, 29, 53, 0.4);
   
}

@media (prefers-color-scheme: dark) {
    .notam-format-icao {
        background: rgba(59, 130, 246, 0.2);
        color: #60a5fa;
        border-color: rgba(96, 165, 250, 0.4);
    }
    .notam-format-faa {
        background: rgba(245, 158, 11, 0.2);
        color: #fbbf24;
        border-color: rgba(251, 191, 36, 0.4);
    }
    .type-fir {
        background: rgba(237, 88, 108, 0.2);
        color: #e61531;
        border-color: rgba(207, 29, 53, 0.4);
    }
    .type-airport {
        background: rgba(245, 158, 11, 0.2);
        color: #fbbf24;
        border-color: rgba(37, 133, 936, 0.4);
    }
}




.notam-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.notam-issued {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
    opacity: 0.8;
}

.notam-toggle {
    font-size: 24px;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.notam-card.expanded .notam-toggle {
    transform: rotate(180deg);
}

.notam-body {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.notam-card.expanded .notam-body {
    padding: 20px;
    max-height: 2000px;
}

/* NOTAM Fields */
.notam-fields {
    display: grid;
    gap: 15px;
}

.notam-field {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
}

.field-label {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    min-width: 100px;
    text-align: center;
}

.field-value {
    background: var(--bg-secondary);
    padding: 10px 16px;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    word-break: break-word;
}

/* Field Colors */
.field-start .field-label { background: #FF69B4; }
.field-end .field-label { background: #FF1493; }
.field-schedule .field-label { background: #00BCD4; }
.field-low .field-label { background: #4CAF50; }
.field-up .field-label { background: #2E7D32; }
.field-description .field-label { background: #FF9800; }

/* Features Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.feature-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.feature-card h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* Airport Links */
.airport-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.airport-link {
    background: var(--bg-card);
    padding: 15px 20px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    transition: var(--transition);
    font-weight: 500;
}

.airport-link:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    color: white;
}

/* SEO Content */
.seo-content {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    margin-top: 40px;
    line-height: 1.8;
}

.seo-content h2 {
    color: var(--primary-color);
    margin: 30px 0 15px 0;
}

.seo-content h2:first-child {
    margin-top: 0;
}

.seo-content ul, .seo-content ol {
    margin: 15px 0 15px 30px;
}

/* Loading */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Autocomplete */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 2px solid var(--primary-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    display: none;
    margin-top: -2px;
}

.autocomplete-dropdown.active {
    display: block;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: var(--primary-light);
    color: white;
}

.autocomplete-flag {
    font-size: 20px;
    flex-shrink: 0;
}

.autocomplete-code {
    font-weight: 700;
    font-size: 14px;
    min-width: 50px;
    flex-shrink: 0;
}

.autocomplete-name {
    font-size: 14px;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Footer */
.app-footer {
    background: var(--bg-card);
    padding: 40px 0 20px;
    margin-top: 60px;
    border-top: 3px solid var(--primary-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
}

.disclaimer-text {
    font-size: 12px;
    margin-top: 10px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .main-nav {
        width: 100%;
        justify-content: center;
    }
    
    .hero-section h2 {
        font-size: 28px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .airport-links {
        grid-template-columns: 1fr;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .notam-count {
        margin-left: 0;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .search-card, .seo-content {
        padding: 20px;
    }
    
    .btn-large {
        padding: 14px;
        font-size: 16px;
    }
}

/* Print Styles */
@media print {
    .app-header, .ad-container, .toolbar, .app-footer, .sidebar {
        display: none;
    }
    
    .notam-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* FAQ Page Styles */
.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: 12px;
}

.page-subtitle {
    font-size: 18px;
    margin-top: 10px;
    opacity: 0.95;
}

.faq-container {
    max-width: 900px;
    margin: 0 auto;
}

.faq-section {
    margin-bottom: 50px;
}

.faq-section h2 {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 25px;
}

.faq-item {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.faq-question {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 15px;
}

.faq-answer {
    color: var(--text-secondary);
    line-height: 1.8;
}

.faq-answer ul, .faq-answer ol {
    margin: 15px 0 15px 25px;
}

.faq-answer a {
    color: var(--primary-color);
    text-decoration: none;
}

.faq-answer a:hover {
    text-decoration: underline;
}

.still-have-questions {
    text-align: center;
    background: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    margin-top: 40px;
}

.still-have-questions a {
    color: var(--primary-color);
    font-weight: 600;
}

/* Legal Page Styles */
.legal-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.legal-page h1 {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 15px;
    margin-bottom: 10px;
}

.last-updated {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 30px;
}

.important-notice {
    background: #fff3cd;
    border-left: 5px solid #ffc107;
    padding: 25px;
    margin: 30px 0;
    border-radius: 8px;
}

.important-notice h2 {
    color: #856404;
    margin-top: 0;
}

.important-notice strong {
    color: #856404;
}

.legal-section {
    margin-bottom: 40px;
}

.legal-section h2 {
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 15px;
}

.legal-section h3 {
    color: var(--text-primary);
    font-size: 18px;
    margin-top: 20px;
    margin-bottom: 10px;
}

.legal-section ul {
    margin: 15px 0 15px 30px;
    line-height: 1.8;
}

.warning-text {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    color: #721c24;
}

.final-notice {
    background: #d1ecf1;
    border-color: #0c5460;
    margin-top: 40px;
}

.final-notice strong {
    display: block;
    margin-bottom: 10px;
}

.contact-section {
    text-align: center;
    margin-top: 40px;
    padding: 30px;
    background: var(--bg-card);
    border-radius: 12px;
}

/* Donate Page Styles */
.donate-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.donate-header {
    text-align: center;
    margin-bottom: 50px;
}

.donate-header h1 {
    font-size: 42px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.donate-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
}

.donate-content section {
    margin-bottom: 60px;
}

.donate-content h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 30px;
    font-size: 32px;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.benefit-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.benefit-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.benefit-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.donation-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.donation-card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.donation-card.featured {
    border: 3px solid var(--primary-color);
}

.donation-header {
    background: var(--bg-secondary);
    padding: 25px;
    text-align: center;
}

.donation-header h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.donation-body {
    padding: 30px;
    text-align: center;
}

.paypal-button {
    margin: 20px 0;
}

.bmc-button {
    background: #FFDD00;
    color: #000;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: var(--transition);
}

.bmc-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.donation-note {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 15px;
}

.crypto-options {
    margin: 20px 0;
}

.crypto-item {
    margin-bottom: 20px;
    text-align: left;
}

.crypto-address {
    display: block;
    background: var(--bg-secondary);
    padding: 10px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
    word-break: break-all;
    margin-top: 5px;
}

.help-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.help-item {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
}

.help-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.help-item h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.transparency-list {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 8px;
    margin: 20px 0;
}

.transparency-note {
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 20px;
}

.thank-you-box {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
}

.thank-you-box h2 {
    color: white;
    margin-top: 0;
}

.faq-donate {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
}

.faq-donate .faq-item {
    box-shadow: none;
    border-bottom: 1px solid var(--border-color);
}

.faq-donate .faq-item:last-child {
    border-bottom: none;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
}