/**
 * RC Flyer Flight Map Styles
 */

/* Container */
.rc-flight-map-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin: 20px 0;
}

/* Stats Bar */
.rcfm-stats-bar {
    display: flex;
    justify-content: space-around;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: 10px;
}

.rcfm-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 80px;
}

.rcfm-stat-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.rcfm-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.rcfm-stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filters */
.rcfm-filters {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.rcfm-search {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.rcfm-search::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.rcfm-search:focus {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.15);
}

.rcfm-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rcfm-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.rcfm-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: transparent;
}

.rcfm-btn-icon {
    font-size: 14px;
}

/* Map Wrapper */
.rcfm-map-wrapper {
    position: relative;
}

.rcfm-map {
    width: 100%;
    min-height: 400px;
    background: #1a1a2e;
}

/* Loading Overlay */
.rcfm-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 46, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.rcfm-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.rcfm-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: rcfm-spin 1s linear infinite;
}

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

.rcfm-loading-text {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* Footer */
.rcfm-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.3);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.rcfm-powered a {
    color: #667eea;
    text-decoration: none;
}

.rcfm-powered a:hover {
    text-decoration: underline;
}

/* Custom Marker Cluster Styles */
.marker-cluster-small {
    background-color: rgba(102, 126, 234, 0.6);
}
.marker-cluster-small div {
    background-color: rgba(102, 126, 234, 0.9);
}

.marker-cluster-medium {
    background-color: rgba(118, 75, 162, 0.6);
}
.marker-cluster-medium div {
    background-color: rgba(118, 75, 162, 0.9);
}

.marker-cluster-large {
    background-color: rgba(234, 102, 126, 0.6);
}
.marker-cluster-large div {
    background-color: rgba(234, 102, 126, 0.9);
}

.marker-cluster {
    background-clip: padding-box;
    border-radius: 50%;
}
.marker-cluster div {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-top: 5px;
    text-align: center;
    border-radius: 50%;
    font: 12px 'Helvetica Neue', Arial, sans-serif;
    font-weight: bold;
    color: white;
    line-height: 30px;
}
.marker-cluster span {
    line-height: 30px;
}

/* Flight Popup */
.rcfm-popup {
    min-width: 220px;
}

.rcfm-popup-header {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.rcfm-popup-pilot {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.rcfm-popup-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.rcfm-popup-stat {
    text-align: center;
    padding: 6px;
    background: #f5f5f5;
    border-radius: 6px;
}

.rcfm-popup-stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}

.rcfm-popup-stat-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
}

.rcfm-popup-location {
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rcfm-popup-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.rcfm-popup-btn:hover {
    opacity: 0.9;
    color: white;
}

.rcfm-popup-date {
    font-size: 11px;
    color: #999;
    text-align: center;
    margin-top: 8px;
}

/* Custom flight marker - base style */
.rcfm-marker {
    border: 2px solid white;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* GPS flight marker (has 3D replay) - purple gradient */
.rcfm-marker-gps {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* Non-GPS flight marker - grey/blue */
.rcfm-marker-no-gps {
    background: linear-gradient(135deg, #4a5568, #718096);
}

/* Leaflet popup customisation */
.leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 12px 14px;
}

.leaflet-popup-tip {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .rcfm-stats-bar {
        padding: 12px;
    }

    .rcfm-stat {
        min-width: 70px;
    }

    .rcfm-stat-value {
        font-size: 20px;
    }

    .rcfm-stat-label {
        font-size: 10px;
    }

    .rcfm-filters {
        padding: 10px 12px;
    }

    .rcfm-search {
        min-width: 150px;
    }

    .rcfm-btn span:not(.rcfm-btn-icon) {
        display: none;
    }

    .rcfm-footer {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .rcfm-stats-bar {
        justify-content: center;
    }

    .rcfm-stat {
        flex: 1;
        min-width: 60px;
    }

    .rcfm-btn {
        padding: 10px 12px;
    }
}
