/* Guernsey ADS-B Dashboard Styles */

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

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #7c3aed;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e293b;
    --gray: #64748b;
    --light: #f1f5f9;
    --border: #e2e8f0;
    --white: #ffffff;
}

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    margin-top: 1rem;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.header-info {
    display: flex;
    gap: 2rem;
    align-items: center;
    color: var(--gray);
    font-size: 0.9rem;
}

.live-indicator {
    background: var(--danger);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    animation: pulse 2s infinite;
}

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

/* Main Content */
main {
    padding: 2rem 1.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    border-radius: 12px;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border);
    background: var(--light);
}

.card-header h2 {
    font-size: 1.3rem;
    color: var(--dark);
    font-weight: 700;
}

.badge {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

/* Charts */
.charts-section {
    margin-bottom: 2rem;
}

.chart-container {
    position: relative;
    height: 300px;
    padding: 1.5rem;
}

.time-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.time-select:hover {
    border-color: var(--primary);
}

.time-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Table */
.table-controls {
    padding: 1rem 1.5rem;
    background: var(--light);
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.table-wrapper {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

.aircraft-table {
    width: 100%;
    border-collapse: collapse;
}

.aircraft-table thead {
    background: var(--dark);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.aircraft-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.aircraft-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.aircraft-table tbody tr {
    transition: background 0.2s;
}

.aircraft-table tbody tr:hover {
    background: var(--light);
}

.aircraft-table .flight {
    font-weight: 700;
    color: var(--primary);
    font-family: 'Courier New', monospace;
}

.aircraft-table .hex {
    font-family: 'Courier New', monospace;
    color: var(--gray);
    font-size: 0.9rem;
}

.loading,
.no-data {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
    font-style: italic;
}

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.98);
    padding: 1.5rem 0;
    margin-top: 3rem;
    text-align: center;
    color: var(--gray);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.4rem;
    }
    
    .header-info {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        width: 100%;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .aircraft-table {
        font-size: 0.85rem;
    }
    
    .aircraft-table th,
    .aircraft-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    main {
        padding: 1rem;
    }
    
    .stat-icon {
        font-size: 2rem;
        width: 50px;
        height: 50px;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .card-header h2 {
        font-size: 1.1rem;
    }
}

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading::before {
    content: "⏳";
    display: inline-block;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--light);
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--dark);
}
