:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--gray-100);
    color: var(--gray-900);
}

/* Header */
.header {
    background: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

    .header h1 {
        margin: 0;
        font-size: 1.5rem;
    }

    .header .subtitle {
        color: var(--gray-500);
        font-size: 0.875rem;
        margin-left: 0.5rem;
    }

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.current-time {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 1.25rem;
    color: var(--gray-700);
}

.connection-status {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

    .connection-status.connected {
        background: #dcfce7;
        color: var(--success);
    }

    .connection-status.disconnected {
        background: #fee2e2;
        color: var(--danger);
    }

/* Controls */
.controls {
    background: white;
    padding: 1rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    border-bottom: 1px solid var(--gray-200);
}

.add-airport {
    display: flex;
    gap: 0.5rem;
}

.icao-input {
    width: 120px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 1rem;
    font-family: monospace;
    text-transform: uppercase;
}

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

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

.filters {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

    .filters label {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        font-size: 0.875rem;
        color: var(--gray-700);
    }

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

    .btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.btn-primary {
    background: var(--primary);
    color: white;
}

    .btn-primary:hover:not(:disabled) {
        background: var(--primary-dark);
    }

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

    .btn-secondary:hover:not(:disabled) {
        background: var(--gray-200);
    }

.btn-danger {
    background: white;
    color: var(--danger);
    border: 1px solid var(--gray-300);
}

    .btn-danger:hover:not(:disabled) {
        background: #fee2e2;
    }

.btn-icon {
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

    .btn-icon:hover {
        background: var(--gray-100);
    }

.btn-remove:hover {
    background: #fee2e2;
    color: var(--danger);
}

/* Error message */
.error-message {
    margin: 1rem 1.5rem;
    padding: 0.75rem 1rem;
    background: #fee2e2;
    color: var(--danger);
    border-radius: 0.375rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .error-message button {
        background: none;
        border: none;
        font-size: 1.25rem;
        cursor: pointer;
        color: var(--danger);
    }

/* Loading & Empty state */
.loading, .empty-state {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--gray-500);
}

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

    .empty-state h2 {
        color: var(--gray-700);
        margin: 0 0 0.5rem;
    }

    .empty-state .hint {
        font-size: 0.875rem;
        color: var(--gray-500);
    }

/* Airport list - kompakt */
.airport-list {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Airport card - kompakt */
.airport-card {
    background: white;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    overflow: visible;
    border: 2px solid transparent;
}

    .airport-card.amd-alert {
        border-color: var(--danger);
        animation: pulse-border 1s ease-in-out infinite;
    }

@keyframes pulse-border {
    0%, 100% {
        border-color: var(--danger);
    }

    50% {
        border-color: #fca5a5;
    }
}

@keyframes blink-bg {
    0%, 100% {
        background: #fee2e2;
    }

    50% {
        background: #fecaca;
    }
}

.airport-header {
    padding: 0.25rem 0.75rem;
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.airport-info {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

    .airport-info .icao {
        font-size: 1rem;
        font-weight: 700;
        font-family: monospace;
    }

    .airport-info .country {
        font-size: 0.75rem;
        opacity: 0.9;
    }

.airport-actions {
    display: flex;
    gap: 0.25rem;
}

    .airport-actions .btn-icon {
        color: white;
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.75rem;
    }

        .airport-actions .btn-icon:hover {
            background: rgba(255,255,255,0.2);
        }

/* Kompakt report linje */
.report-line {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.875rem;
    position: relative;
}

    .report-line:last-child {
        border-bottom: none;
    }

    .report-line.new-report {
        background: #fef3c7;
    }

    .report-line.new-amd {
        background: #fee2e2;
        animation: blink-bg 1s ease-in-out infinite;
    }

    /* Report type badge (TAF/METAR) */
    .report-line .report-type {
        font-weight: 600;
        font-size: 0.75rem;
        padding: 0.125rem 0.375rem;
        border-radius: 0.1875rem;
        flex-shrink: 0;
        width: 3rem;
        text-align: center;
    }

.report-type.taf {
    background: #dbeafe;
    color: #1e40af;
}

.report-type.metar {
    background: #dcfce7;
    color: #166534;
}

/* Badge area - fast bredde for alignment */
.badge-area {
    display: flex;
    gap: 0.25rem;
    width: 5rem;
    flex-shrink: 0;
}

.report-line .badge {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.3rem;
    border-radius: 0.1875rem;
    text-transform: uppercase;
}

.badge.amd {
    background: var(--danger);
    color: white;
}

.badge.cor {
    background: var(--warning);
    color: white;
}

.badge.speci {
    background: #7c3aed;
    color: white;
}

/* Raw report tekst */
.report-line .report-raw {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tooltip - barn af report-line, ikke report-raw */
.report-line .tooltip-box {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 100;
    background: var(--gray-900);
    color: var(--gray-100);
    border: 1px solid var(--gray-500);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8125rem;
    white-space: normal;
    word-break: break-word;
    max-width: 90vw;
    width: max-content;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.report-line:hover .tooltip-box {
    display: block;
}

/* Tidsstempel */
.report-line .report-time {
    font-size: 0.8125rem;
    color: var(--gray-500);
    flex-shrink: 0;
    margin-left: auto;
}

    .report-line .report-time .age {
        color: var(--gray-400);
    }

/* Footer */
.footer {
    padding: 2rem;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .add-airport {
        width: 100%;
    }

    .icao-input {
        flex: 1;
    }

    .actions {
        justify-content: space-between;
    }

    .filters {
        margin-left: 0;
    }

    .report-line {
        flex-wrap: wrap;
    }

    .badge-area {
        width: auto;
    }

    .report-line .report-raw {
        white-space: normal;
        word-break: break-word;
        flex-basis: 100%;
        order: 10;
        margin-top: 0.25rem;
    }
}

/* Blazor fejl-UI - skjult som standard */
#blazor-error-ui {
    background: #ffdc00;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }
