/* Aircraft Detail Overlay - Clean Professional Design */

.aircraft-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.aircraft-overlay.show {
    opacity: 1;
    visibility: visible;
}

.overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.overlay-content {
    position: relative;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    max-width: 95vw;
    max-height: 95vh;
    width: 1600px;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.aircraft-overlay.show .overlay-content {
    transform: scale(1);
}

.overlay-content.loading {
    width: 400px;
    height: 300px;
    display: flex;
    flex-direction: column;
}

/* Overlay Scrollbar */
.overlay-content::-webkit-scrollbar {
    width: 8px;
}

.overlay-content::-webkit-scrollbar-track {
    background: #0d1117;
}

.overlay-content::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 2px;
}

.overlay-content::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* Header */
.overlay-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #161b22;
    border-bottom: 1px solid #21262d;
}

.overlay-title {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aircraft-reg {
    color: #f0883e;
    font-size: 18px;
    font-weight: 600;
}

.aircraft-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.overlay-badge {
    padding: 3px 8px;
    background: #21262d;
    border-radius: 3px;
    font-size: 11px;
    color: #8b949e;
}

.overlay-badge.airline {
    background: #388bfd20;
    color: #58a6ff;
}

.overlay-badge.type {
    color: #8b949e;
}

.overlay-badge.status {
    background: #f0883e20;
    color: #f0883e;
}

.overlay-badge.freq {
    background: #a371f720;
    color: #a371f7;
}

.overlay-badge.live {
    background: #3fb95020;
    color: #3fb950;
    animation: pulse 2s infinite;
}

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

.overlay-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.overlay-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #8b949e;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f85149;
}

.status-dot.live {
    background: #3fb950;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.overlay-close {
    background: none;
    border: 1px solid #30363d;
    border-radius: 3px;
    color: #8b949e;
    font-size: 16px;
    cursor: pointer;
    padding: 6px 10px;
    transition: all 0.15s;
}

.overlay-close:hover {
    background: #21262d;
    color: #e6edf3;
    border-color: #484f58;
}

/* Body */
.overlay-body {
    padding: 20px;
}

.overlay-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

/* Panels */
.overlay-panel {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 6px;
    padding: 16px;
}

.panel-title {
    color: #e6edf3;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #21262d;
}

/* Info Grid */
.overlay-info-grid {
    display: grid;
    gap: 8px;
}

.overlay-info-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #21262d;
    font-size: 12px;
}

.info-label {
    color: #8b949e;
}

.info-value {
    color: #e6edf3;
    font-weight: 500;
}

/* Flight Status */
.overlay-flight-status {
    margin-top: 12px;
    padding: 10px;
    background: #0d1117;
    border-radius: 4px;
    text-align: center;
}

.overlay-flight-number {
    color: #f0883e;
    font-size: 16px;
    font-weight: 600;
}

.overlay-last-seen {
    color: #8b949e;
    font-size: 11px;
    margin-top: 4px;
}

/* Stats */
.overlay-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.overlay-stat {
    text-align: center;
    padding: 8px;
    background: #0d1117;
    border-radius: 4px;
}

.stat-value {
    display: block;
    color: #f0883e;
    font-size: 18px;
    font-weight: 600;
}

.stat-label {
    display: block;
    color: #8b949e;
    font-size: 10px;
    margin-top: 2px;
}

/* Map */
.overlay-map {
    aspect-ratio: 1 / 1;
    width: 100%;
    border-radius: 4px;
    border: 1px solid #21262d;
    position: relative;
    overflow: hidden;
    min-height: 200px;
    max-height: 350px;
    z-index: 99;
    background: #0d1117;
}

.overlay-map-info {
    margin-top: 8px;
    font-size: 11px;
    color: #8b949e;
    padding: 8px;
    background: #0d1117;
    border-radius: 4px;
}

.aircraft-marker-overlay {
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Activity */
.overlay-activity {
    max-height: 250px;
    overflow-y: auto;
}

.overlay-activity::-webkit-scrollbar {
    width: 6px;
}

.overlay-activity::-webkit-scrollbar-track {
    background: transparent;
}

.overlay-activity::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 3px;
}

.overlay-activity-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #21262d;
}

.activity-time {
    color: #8b949e;
    font-size: 11px;
    min-width: 50px;
}

.activity-content {
    flex: 1;
}

.activity-text {
    color: #e6edf3;
    font-size: 12px;
    margin-bottom: 4px;
}

.activity-badges {
    display: flex;
    gap: 4px;
}

.activity-category,
.activity-label {
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 2px;
}

.activity-category {
    background: #f0883e20;
    color: #f0883e;
}

.activity-label {
    background: #21262d;
    color: #8b949e;
}

/* Messages Section */
.overlay-messages {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 6px;
    padding: 16px;
}

.overlay-messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.overlay-messages-header h3 {
    color: #e6edf3;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.overlay-message-filters {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.overlay-filter-btn {
    background: #21262d;
    color: #8b949e;
    border: 1px solid #30363d;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    transition: all 0.15s;
}

.overlay-filter-btn:hover {
    border-color: #f0883e;
    color: #e6edf3;
}

.overlay-filter-btn.active {
    background: #f0883e20;
    color: #f0883e;
    border-color: #f0883e;
}

.overlay-search {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 3px;
    padding: 5px 10px;
    color: #e6edf3;
    font-size: 11px;
    font-family: inherit;
    width: 150px;
}

.overlay-search:focus {
    outline: none;
    border-color: #f0883e;
}

/* Messages List */
.overlay-messages-list {
    max-height: 600px;
    overflow-y: auto;
}

.overlay-messages-list::-webkit-scrollbar {
    width: 6px;
}

.overlay-messages-list::-webkit-scrollbar-track {
    background: transparent;
}

.overlay-messages-list::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 3px;
}

.overlay-message {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.overlay-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 6px;
}

.overlay-message-time {
    color: #8b949e;
    font-size: 11px;
}

.overlay-message-badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.overlay-msg-badge {
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 2px;
}

.overlay-msg-badge.category {
    background: #f0883e20;
    color: #f0883e;
}

.overlay-msg-badge.label {
    background: #21262d;
    color: #8b949e;
}

.overlay-msg-badge.flight {
    background: #388bfd20;
    color: #58a6ff;
}

.overlay-message-text {
    color: #e6edf3;
    line-height: 1.5;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 12px;
    word-break: break-word;
    white-space: pre-wrap;
}

.overlay-message-meta {
    margin-top: 6px;
    color: #8b949e;
    font-size: 10px;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #8b949e;
    padding: 40px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid #30363d;
    border-radius: 50%;
    border-top-color: #f0883e;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.loading-text {
    font-size: 14px;
    color: #e6edf3;
    margin-bottom: 4px;
}

.loading-subtext {
    font-size: 12px;
    color: #8b949e;
}

/* Responsive */
@media (max-width: 1200px) {
    .overlay-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .overlay-grid .overlay-panel:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .overlay-content {
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        max-width: 100vw;
    }
    
    .overlay-grid {
        grid-template-columns: 1fr;
    }
    
    .overlay-grid .overlay-panel:last-child {
        grid-column: span 1;
    }
    
    .overlay-header {
        padding: 12px 16px;
    }
    
    .overlay-body {
        padding: 12px;
    }
    
    .aircraft-reg {
        font-size: 16px;
    }
    
    .overlay-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .overlay-messages-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .overlay-message-filters {
        justify-content: flex-start;
    }
    
    .overlay-search {
        width: 100%;
        margin-top: 8px;
    }
}
