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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* Main Content */
main {
    flex: 1;
    padding: 1rem;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* Airport Cards */
.airport-cards {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.airport-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.airport-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    border-color: #667eea;
}

.airport-code {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.airport-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.airport-location {
    color: #666;
    font-size: 0.9rem;
}

/* Back Button */
.back-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: background 0.3s ease;
}

.back-button:hover {
    background: #5568d3;
}

/* Airport Details */
.airport-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.airport-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.airport-info {
    font-size: 0.95rem;
    opacity: 0.95;
}

/* Section Styles */
.section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.section h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Navigation */
.main-nav {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
}

.nav-button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.nav-button:hover, .nav-button.active {
    background: white;
    color: #667eea;
}

.nav-button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
}

.nav-button.disabled:hover {
    background-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
    transform: none;
}

/* Quick Stats */
.quick-stats {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.quick-stats:hover {
    transform: scale(1.02);
}

.quick-stats.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #888 0%, #666 100%);
}

.quick-stats.disabled:hover {
    transform: none;
}

.quick-stat {
    text-align: center;
    color: white;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Runways */
.runway-list {
    display: grid;
    gap: 0.75rem;
}

.runway-item {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.runway-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 0.25rem;
}

.runway-info {
    color: #666;
    font-size: 0.9rem;
}

.runway-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.runway-status.active {
    background: #4caf50;
    color: white;
}

/* Disclaimer Box */
.disclaimer-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-left: 4px solid #ff9800;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #856404;
    line-height: 1.5;
}

.disclaimer-box strong {
    color: #664d03;
}

/* Viewing Spots */
.viewing-spots {
    display: grid;
    gap: 1rem;
}

.spot-card {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    
    /* Weather widget helpers */
    .weather-meta {
        font-size: 0.75rem;
        opacity: 0.9;
        margin-top: 0.25rem;
    }
}

.spot-card.official-spot {
    border-color: #28a745;
    background: linear-gradient(135deg, #f0fff4 0%, #f9f9f9 100%);
}

.official-badge {
    display: inline-block;
    background: #28a745;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-right: 0.3rem;
    vertical-align: middle;
}

.spot-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.spot-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
}

.spot-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s;
}

.icon-button:hover {
    transform: scale(1.2);
}

.icon-button.active {
    color: #ffc107;
}

.spot-rating {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.spot-description {
    color: #555;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.visit-badge {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.personal-note {
    background: #fff3e0;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.note-icon {
    font-size: 1.2rem;
}

.note-text {
    flex: 1;
    color: #e65100;
    font-style: italic;
}

.note-edit {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 0.85rem;
}

.spot-details {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.detail-item {
    display: flex;
    align-items: start;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.detail-icon {
    min-width: 20px;
}

.detail-label {
    font-weight: 600;
    color: #333;
}

.detail-value {
    color: #666;
}

.parking-legal {
    color: #4caf50;
    font-weight: 600;
}

.parking-limited {
    color: #ff9800;
    font-weight: 600;
}

.spot-actions-bar {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Action Buttons */
.action-button {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    border: none;
    transition: all 0.2s;
}

.action-button.primary {
    background: #667eea;
    color: white;
}

.action-button.primary:hover {
    background: #5568d3;
}

.action-button.secondary {
    background: #e0e0e0;
    color: #333;
}

.action-button.secondary:hover {
    background: #d0d0d0;
}

.action-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #ccc;
    color: #888;
}

.action-button:disabled:hover {
    background: #ccc;
    transform: none;
}

.disabled-section {
    opacity: 0.7;
}

.coming-soon-note {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Weather Widget */
.weather-widget {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
}

.weather-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.weather-temp, .weather-condition, .weather-wind {
    font-size: 0.95rem;
}

.spotting-conditions {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.spotting-conditions.good {
    background: #4caf50;
    color: white;
}

.spotting-conditions.fair {
    background: #ff9800;
    color: white;
}

.spotting-conditions.poor {
    background: #f44336;
    color: white;
}

/* Tips List */
.tips-list {
    padding-left: 1.5rem;
    color: #555;
}

.tips-list li {
    margin-bottom: 0.5rem;
}

/* Locked Airports */
.locked-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f5f5f5;
    border-radius: 12px;
    text-align: center;
}

.locked-section h3 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.unlock-description {
    color: #666;
    margin-bottom: 1rem;
}

.locked-airports {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.airport-card.locked {
    position: relative;
    opacity: 0.7;
    cursor: not-allowed;
}

.lock-overlay {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.lock-icon {
    font-size: 1.5rem;
}

.tier-required {
    background: #667eea;
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
}

.tier-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.tier-badge.free {
    background: #4caf50;
    color: white;
}

.airport-meta {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
}

.spot-count {
    color: #666;
    font-size: 0.85rem;
}

/* Patreon */
.patreon-button {
    background: #ff424d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s;
}

.patreon-button:hover {
    background: #e63946;
}

.patreon-button.large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

/* Forms */
.spotting-form, .patreon-content {
    padding: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: #333;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Patreon Modal */
.patreon-intro {
    text-align: center;
    color: #666;
    margin-bottom: 1rem;
}

.tier-cards {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tier-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.tier-card.supporter { border-color: #4caf50; }
.tier-card.enthusiast { border-color: #2196f3; }
.tier-card.pro { border-color: #ff9800; }

.tier-name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.tier-price {
    color: #667eea;
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.tier-airports {
    color: #666;
    margin-bottom: 0.5rem;
}

.tier-features {
    text-align: left;
    font-size: 0.85rem;
    color: #555;
    padding-left: 1.25rem;
}

.patreon-note {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin-top: 1rem;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.stat-card.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.stat-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.8;
}

.activity-summary {
    color: #555;
    line-height: 1.6;
}

/* Achievements */
.achievements {
    display: grid;
    gap: 0.75rem;
}

.achievement {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: #f5f5f5;
}

.achievement.earned {
    background: #e8f5e9;
    border: 2px solid #4caf50;
}

.achievement.locked {
    opacity: 0.6;
}

.achievement-icon {
    font-size: 1.5rem;
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    font-weight: 600;
    color: #333;
}

.achievement-desc {
    font-size: 0.85rem;
    color: #666;
}

.achievement-check {
    color: #4caf50;
    font-size: 1.25rem;
    font-weight: bold;
}

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

/* Spotting Log */
.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.spotting-list {
    display: grid;
    gap: 0.75rem;
}

.spotting-entry {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 1rem;
    position: relative;
    border-left: 4px solid #667eea;
}

.spotting-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.spotting-aircraft {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.aircraft-type {
    font-weight: bold;
    font-size: 1.1rem;
}

.airline {
    color: #666;
    font-size: 0.9rem;
}

.registration {
    background: #e0e0e0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
}

.spotting-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #666;
}

.spotting-notes {
    margin-top: 0.5rem;
    color: #555;
    font-style: italic;
}

.delete-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: #999;
    font-size: 1.25rem;
    cursor: pointer;
}

.delete-button:hover {
    color: #f44336;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Footer */
footer {
    background: #f5f5f5;
    padding: 1.5rem 1rem;
    text-align: left;
    color: #666;
    font-size: 0.85rem;
    border-top: 1px solid #e0e0e0;
}

.footer-disclaimer {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    color: #856404;
}

.footer-disclaimer strong {
    color: #664d03;
}

.footer-sources {
    margin-bottom: 1rem;
}

.footer-sources p {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.footer-sources ul {
    margin: 0;
    padding-left: 1.25rem;
    list-style: disc;
}

.footer-sources li {
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.footer-sources a {
    color: #667eea;
    text-decoration: none;
}

.footer-sources a:hover {
    text-decoration: underline;
}

.footer-copy {
    text-align: center;
    margin: 0;
    padding-top: 0.75rem;
    border-top: 1px solid #e0e0e0;
    color: #999;
    font-size: 0.8rem;
}

.patreon-tiny {
    color: #999;
    text-decoration: none;
}

.patreon-tiny:hover {
    color: #667eea;
    text-decoration: underline;
}

/* Responsive Design */
@media (min-width: 768px) {
    .container {
        margin: 2rem auto;
        border-radius: 16px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    }

    header {
        border-radius: 16px 16px 0 0;
    }

    header h1 {
        font-size: 2.5rem;
    }

    main {
        padding: 2rem;
    }

    .airport-cards {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .locked-airports {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .viewing-spots {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }

    .tier-cards {
        grid-template-columns: repeat(3, 1fr);
    }

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

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .spot-actions-bar {
        flex-direction: column;
    }
    
    .action-button {
        width: 100%;
        text-align: center;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 1rem;
}
