:root {
    --primary-blue: #0066CC;
    --secondary-blue: #004C99;
    --light-blue: #E6F2FF;
    --success-green: #28A745;
    --warning-yellow: #FFC107;
    --danger-red: #DC3545;
    --text-dark: #1A1A1A;
    --text-light: #666666;
    --bg-gray: #F5F7FA;
    --border-gray: #DDE2E8;
    --white: #FFFFFF;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --gradient-start: #667eea;
    --gradient-end: #764ba2;
}

[data-theme="dark"] {
    --primary-blue: #4A90E2;
    --secondary-blue: #357ABD;
    --light-blue: #1E3A5F;
    --success-green: #4CAF50;
    --warning-yellow: #FFB300;
    --danger-red: #EF5350;
    --text-dark: #E8E8E8;
    --text-light: #B0B0B0;
    --bg-gray: #1E1E1E;
    --border-gray: #3A3A3A;
    --white: #2A2A2A;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.4);
    --gradient-start: #2C3E50;
    --gradient-end: #34495E;
}


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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    transition: background 0.3s ease;
}

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

/* Header */
header {
    color: var(--white);
    margin-bottom: 40px;
}

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

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    color: var(--white);
    font-weight: 600;
    font-size: 1rem;
}

.btn-secondary {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    color: var(--white);
    border-color: var(--white);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Toggle Minimums Buttons */
.toggle-minimums-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.toggle-minimums-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 30px;
}

.mode-btn {
    padding: 12px 32px;
    background: var(--white);
    color: var(--text-dark);
    border: 2px solid var(--white);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.mode-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.mode-btn.active {
    opacity: 1;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: var(--white);
    border-color: var(--primary-blue);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card h2 {
    color: var(--primary-blue);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.card h3 {
    color: var(--text-dark);
    margin-bottom: 12px;
    font-size: 1.2rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

#icao {
    text-transform: uppercase;
    font-weight: 600;
    font-size: 1.2rem;
}

.icao-input {
    text-transform: uppercase;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: var(--text-light);
    font-size: 0.85rem;
}

.route-inputs {
    margin-bottom: 24px;
}

.minimums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error Card */
.error-card {
    background: #FFF3F3;
    border-left: 4px solid var(--danger-red);
}

.error-card h3 {
    color: var(--danger-red);
}

/* METAR Card */
.metar-card code {
    display: block;
    background: var(--bg-gray);
    padding: 16px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    overflow-x: auto;
}

/* Decision Card */
.decision-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
}

.decision-card h2,
.decision-card h3 {
    color: var(--white);
}

.decision-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.decision-badge {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.decision-badge.pass,
.decision-badge.go {
    background: var(--success-green);
}

.decision-badge.warn,
.decision-badge.caution {
    background: var(--warning-yellow);
    color: var(--text-dark);
}

.decision-badge.fail,
.decision-badge.no-go {
    background: var(--danger-red);
}

.airport-info h3 {
    font-size: 2rem;
}

/* Conditions Grid */
.conditions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.condition-card {
    text-align: center;
    padding: 20px;
}

.condition-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.condition-card h4 {
    color: var(--text-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.condition-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.ok {
    background: #D4EDDA;
    color: var(--success-green);
}

.status-badge.warn {
    background: #FFF3CD;
    color: #856404;
}

.status-badge.fail {
    background: #F8D7DA;
    color: var(--danger-red);
}

/* Summary Card */
.summary-card {
    background: var(--light-blue);
    border-left: 4px solid var(--primary-blue);
}

.summary-card p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Route Results */
.route-summary-text {
    margin-top: 16px;
}

.route-summary-text p {
    color: var(--white);
    font-size: 1.1rem;
    line-height: 1.6;
}

.recommendations-card {
    background: var(--light-blue);
    border-left: 4px solid var(--primary-blue);
}

.recommendations-card ul {
    list-style: none;
    padding: 0;
}

.recommendations-card li {
    padding: 12px;
    margin-bottom: 8px;
    background: var(--white);
    border-radius: 6px;
    font-weight: 500;
}

/* Map Card */
.map-card {
    background: var(--white);
}

.map-card h3 {
    color: var(--text-dark);
    margin: 0;
}

#routeMap {
    width: 100%;
    height: 500px;
    min-height: 500px;
    border: 2px solid var(--border-gray);
    position: relative;
    z-index: 1;
}

.btn-small {
    padding: 6px 12px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-small:hover {
    background: var(--secondary-blue);
    transform: translateY(-1px);
}

.custom-marker {
    background: transparent;
    border: none;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 12px;
    line-height: 1.6;
}

.route-point-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.route-point-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-gray);
}

.route-point-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.route-point-title h3 {
    margin: 0;
    font-size: 1.5rem;
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.departure {
    background: #D4EDDA;
    color: var(--success-green);
}

.role-badge.destination {
    background: #D1ECF1;
    color: #0C5460;
}

.role-badge.alternate {
    background: #FFF3CD;
    color: #856404;
}

.role-badge.waypoint {
    background: #E2E3E5;
    color: #383D41;
}

.route-point-metar {
    background: var(--bg-gray);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.route-point-metar code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    display: block;
}

.route-point-conditions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.route-point-error {
    background: #F8D7DA;
    color: var(--danger-red);
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
}

/* Disclaimer */
.disclaimer {
    background: #FFF3CD;
    border-left: 4px solid var(--warning-yellow);
    padding: 16px 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.disclaimer p {
    color: #856404;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: var(--white);
    opacity: 0.8;
    margin-top: 40px;
}

/* Utilities */
.hidden {
    display: none;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    margin: 0;
    color: white;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.tab-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: white;
}

.tab-btn.active {
    color: white;
    border-bottom-color: #4CAF50;
}

.tab-content {
    display: none;
}

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

/* Aircraft Management */
.aircraft-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.aircraft-header h3 {
    margin: 0;
    color: white;
}

#aircraftFormSection {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.aircraft-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.aircraft-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: border-color 0.2s;
}

.aircraft-card.default {
    border-color: #4CAF50;
}

.aircraft-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.aircraft-name {
    font-weight: 600;
    color: white;
    font-size: 1.1rem;
}

.aircraft-type {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.aircraft-badge {
    background-color: #4CAF50;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.aircraft-limits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.aircraft-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-danger {
    background-color: #f44336;
}

.btn-danger:hover {
    background-color: #d32f2f;
}

/* Form Enhancements */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-actions button {
    flex: 1;
}

.error-message {
    background-color: rgba(244, 67, 54, 0.2);
    border-left: 4px solid #f44336;
    color: white;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.success-message {
    background-color: rgba(76, 175, 80, 0.2);
    border-left: 4px solid #4CAF50;
    color: white;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.help-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Aircraft Warnings */
.aircraft-warnings {
    background: linear-gradient(135deg, #d32f2f 0%, #f44336 100%);
    border: 2px solid #ff5252;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    box-shadow: 0 4px 16px rgba(211, 47, 47, 0.4);
}

.aircraft-warnings h3 {
    color: white;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.aircraft-warnings h3::before {
    content: '⚠️';
    font-size: 1.3rem;
}

.warning-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.warning-list li {
    color: white;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.warning-list li:last-child {
    margin-bottom: 0;
}

.crosswind-info {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    border-left: 4px solid #4CAF50;
}

.crosswind-info h4 {
    margin: 0 0 0.5rem 0;
    color: white;
    font-size: 1rem;
}

.crosswind-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

/* NOTAM Information */
.notam-info {
    background: rgba(255, 193, 7, 0.15);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    border-left: 4px solid #FFC107;
}

.notam-info h4 {
    margin: 0 0 1rem 0;
    color: white;
    font-size: 1rem;
}

.notam-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notam-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 0.75rem;
}

.notam-header {
    font-weight: 600;
    color: #FFC107;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.notam-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.notam-dates {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    font-style: italic;
}

/* Flight Monitor Section */
.flight-monitor-section {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.flight-monitor-section h3 {
    margin: 0 0 1rem 0;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.monitored-flights {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.flight-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
}

.flight-card.deteriorating {
    border-color: #ff5252;
    background: rgba(211, 47, 47, 0.2);
}

.flight-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.flight-route {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.flight-status {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.flight-status.active {
    background-color: #4CAF50;
    color: white;
}

.flight-status.warning {
    background-color: #ff9800;
    color: white;
}

.flight-status.alert {
    background-color: #f44336;
    color: white;
}

.flight-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.flight-actions {
    display: flex;
    gap: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-section {
        width: 100%;
        justify-content: flex-end;
    }

    .mode-toggle {
        flex-direction: column;
        width: 100%;
    }

    .mode-toggle button {
        width: 100%;
    }
    
    .minimums-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .conditions-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 1.5rem;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .aircraft-limits {
        grid-template-columns: 1fr;
    }

    .profile-tabs {
        gap: 0.5rem;
        overflow-x: auto;
    }

    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .route-point-card {
        padding: 1rem;
    }

    .flight-details {
        grid-template-columns: 1fr;
    }

    .btn-primary, .btn-secondary {
        padding: 10px 16px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .auth-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .minimums-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 1rem;
    }

    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .decision-badge {
        font-size: 1.2rem;
        padding: 0.5rem 1rem;
    }

    .modal-content {
        width: 98%;
        padding: 1rem;
    }

    /* Stack buttons on very small screens */
    .input-section > div[style*="display: flex"] {
        flex-direction: column !important;
    }

    .input-section button {
        width: 100%;
    }
}

/* Analysis Button and Modal */
.btn-analysis {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

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

.btn-analysis:active {
    transform: translateY(0);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-gray);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-gray);
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-gray);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.analysis-text {
    line-height: 1.8;
    color: var(--text-dark);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.analysis-text strong {
    color: var(--primary-blue);
    font-weight: 700;
}

.alternatives-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-gray);
}

.alternatives-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-blue);
}

.alternatives-list {
    list-style: none;
    padding: 0;
}

.alternatives-list li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-gray);
}

.alternatives-list li:last-child {
    border-bottom: none;
}

.alternatives-list li::before {
    content: '✈️';
    position: absolute;
    left: 0;
}

.hidden {
    display: none !important;
}

.error-message {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid var(--danger-red);
    padding: 1rem;
    border-radius: 4px;
    color: var(--danger-red);
}

/* Welcome Modal for First-Time Visitors */
.welcome-modal-content {
    max-width: 800px;
    background: var(--white);
}

.welcome-content {
    text-align: center;
}

.welcome-content h3 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.welcome-content > p {
    color: var(--text-dark);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    background: var(--bg-gray);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.feature-card h4 {
    color: var(--text-dark);
    margin: 0.5rem 0;
    font-size: 1rem;
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.feature-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.feature-badge.free {
    background: var(--success-green);
    color: white;
}

.feature-badge.premium {
    background: var(--primary-blue);
    color: white;
}

.welcome-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0 1rem 0;
    flex-wrap: wrap;
}

.btn-cta {
    padding: 0.875rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.welcome-disclaimer {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .welcome-actions {
        flex-direction: column;
    }
    
    .welcome-actions button {
        width: 100%;
    }
}

/* Auth Notice for Route Planning */
.auth-notice {
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--white);
    border: 2px solid var(--primary-blue);
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
}

.auth-notice-content h3 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-blue);
    font-size: 1.5rem;
}

.auth-notice-content p {
    margin: 0 0 1rem 0;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.auth-notice .btn-primary {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
    transition: all 0.3s ease;
}

.auth-notice .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

