/* BEFF Tracker Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    min-height: 100vh;
    line-height: 1.6;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.header:hover {
    transform: scale(1.02);
}

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

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 15px;
}

.status {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.status.connected {
    background: rgba(76, 175, 80, 0.3);
    border: 2px solid #4CAF50;
    color: #4CAF50;
}

.status.loading {
    background: rgba(255, 193, 7, 0.3);
    border: 2px solid #FFC107;
    color: #FFC107;
    animation: pulse 2s infinite;
}

.status.error {
    background: rgba(244, 67, 54, 0.3);
    border: 2px solid #f44336;
    color: #f44336;
}

.status.warning {
    background: rgba(255, 152, 0, 0.3);
    border: 2px solid #FF9800;
    color: #FF9800;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Dashboard */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.stat-card.primary {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
}

.stat-card.secondary {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
}

.stat-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.stat-unit {
    font-size: 0.8rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Map */
.map-container {
    margin-bottom: 30px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#map {
    height: 400px;
    width: 100%;
}

/* Map markers */
.home-icon, .ship-icon, .airport-icon {
    background: none !important;
    border: none !important;
}

.distance-marker {
    background: rgba(255, 87, 34, 0.9) !important;
    color: white !important;
    border: none !important;
    border-radius: 15px !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-align: center !important;
    line-height: 20px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

.ship-popup {
    text-align: center;
}

/* Details */
.details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.detail-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
}

.detail-section h3 {
    color: #FFC107;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-section p {
    margin-bottom: 8px;
    opacity: 0.9;
}

.flight-route {
    background: rgba(33, 150, 243, 0.2);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid #2196F3;
}

.flight-link {
    color: #FFC107;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    display: inline-block;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.flight-link:hover {
    color: #FFEB3B;
    text-decoration: underline;
}

.flight-options {
    margin-top: 5px;
    font-size: 0.8em;
    opacity: 0.8;
}

.flight-options a {
    color: #81C784;
    text-decoration: none;
    margin: 0 2px;
    transition: color 0.3s ease;
}

.flight-options a:hover {
    color: #A5D6A7;
    text-decoration: underline;
}

/* Fun Distance Section */
.fun-distance-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
}

.fun-distance-section h3 {
    color: #FFC107;
    margin-bottom: 25px;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.fun-distances {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 12px;
}

.fun-distance-item {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 60px;
}

.fun-distance-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.fun-distance-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #FF6B6B, #4ECDC4, #45B7D1, #96CEB4, #FECA57);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fun-distance-item:hover::before {
    opacity: 1;
}

.fun-icon {
    font-size: 2rem;
    line-height: 1;
    min-width: 2.5rem;
    text-align: center;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.fun-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #FFC107;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    min-width: 90px;
    text-align: right;
    white-space: nowrap;
}

.fun-unit {
    flex: 1;
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .fun-distances {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .fun-distance-item {
        padding: 10px 14px;
        gap: 10px;
        min-height: 50px;
    }

    .fun-icon {
        font-size: 1.6rem;
        min-width: 1.8rem;
    }

    .fun-value {
        font-size: 1.1rem;
        min-width: 70px;
    }

    .fun-unit {
        font-size: 0.85rem;
        white-space: normal;
        line-height: 1.1;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    opacity: 0.8;
    font-size: 0.9rem;
}

.last-refresh {
    margin-top: 10px;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .dashboard {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 2rem;
    }

    .details {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    #map {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .stat-value {
        font-size: 1.8rem;
    }
}

/* Loading animations */
.loading-skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    background: rgba(30, 60, 114, 0.95) !important;
    color: white !important;
    border-radius: 10px !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3) !important;
}

.leaflet-popup-tip {
    background: rgba(30, 60, 114, 0.95) !important;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Accessibility improvements */
.stat-card:focus,
.detail-section:focus {
    outline: 2px solid #FFC107;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    .container {
        max-width: none !important;
    }

    .map-container {
        page-break-inside: avoid;
    }
}