:root {
    --bg-dark: #1a1a2e;
    --bg-card: #16213e;
    --text-primary: #eee;
    --text-secondary: #aaa;
    --accent: #0f3460;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --border: #2c3e50;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* Header */
header {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.refresh-indicator {
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.refresh-indicator.active {
    color: var(--success);
    animation: pulse 1s infinite;
}

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

/* Messages */
.messages {
    margin-bottom: 20px;
}

.message {
    background: var(--warning);
    color: #000;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: 500;
}

.message.error {
    background: var(--danger);
    color: #fff;
}

/* Departure Board */
.departure-board {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

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

thead {
    background: var(--accent);
}

thead th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody td {
    padding: 15px;
}

.time {
    font-size: 1.2rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.destination {
    font-weight: 500;
}

.platform {
    font-size: 1.3rem;
    font-weight: bold;
    text-align: center;
    color: var(--warning);
}

.status {
    font-weight: 500;
}

.status.on-time {
    color: var(--success);
}

.status.delayed {
    color: var(--warning);
}

.status.cancelled {
    color: var(--danger);
}

.loading {
    text-align: center;
    padding: 40px !important;
    color: var(--text-secondary);
}

.no-data {
    text-align: center;
    padding: 40px !important;
    color: var(--text-secondary);
}

/* Footer */
footer {
    margin-top: 30px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    background: var(--bg-card);
    border-radius: 8px 8px 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--text-primary);
    background: var(--accent);
    border-bottom-color: var(--warning);
}

.board-container {
    margin-bottom: 20px;
}

.board-container .departure-board {
    border-radius: 0 0 8px 8px;
    border-top: none;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.origin {
    font-weight: 500;
}

.duration {
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
}

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

    header h1 {
        font-size: 1.5rem;
    }

    table {
        font-size: 0.85rem;
    }

    thead th, tbody td {
        padding: 10px 8px;
    }

    .time {
        font-size: 1rem;
    }

    .platform {
        font-size: 1.1rem;
    }

    .tab-btn {
        padding: 12px 10px;
        font-size: 0.9rem;
    }

    .chiltern-alert {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .planned-changes-section {
        padding: 15px;
    }

    .planned-changes-section h2 {
        font-size: 1.1rem;
    }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
    .container {
        padding: 8px;
    }

    header {
        padding: 15px;
    }

    header h1 {
        font-size: 1.2rem;
    }

    .status-bar {
        font-size: 0.8rem;
    }

    table {
        font-size: 0.8rem;
    }

    thead th, tbody td {
        padding: 8px 6px;
    }

    .hide-mobile {
        display: none;
    }

    .time {
        font-size: 0.9rem;
    }

    .destination, .origin {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tab-btn {
        padding: 10px 8px;
        font-size: 0.8rem;
    }

    footer {
        font-size: 0.75rem;
        margin-top: 20px;
    }

    .chiltern-alert {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .planned-change {
        padding: 12px;
    }

    .planned-change-date {
        font-size: 0.85rem;
    }

    .planned-change-message {
        font-size: 0.85rem;
    }
}

/* Chiltern Alerts Banner */
.chiltern-banner {
    margin-bottom: 20px;
}

.chiltern-alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: 500;
    border-left: 4px solid;
    animation: slideIn 0.3s ease-out;
}

.chiltern-alert.severe {
    background: rgba(231, 76, 60, 0.2);
    border-left-color: var(--danger);
    color: #ff6b6b;
}

.chiltern-alert.warning {
    background: rgba(243, 156, 18, 0.2);
    border-left-color: var(--warning);
    color: #ffa94d;
}

.chiltern-alert.info {
    background: rgba(52, 152, 219, 0.2);
    border-left-color: #3498db;
    color: #74b9ff;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Planned Changes Section */
.planned-changes-section {
    margin-top: 30px;
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border);
}

.planned-changes-section h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.new-badge {
    background: var(--danger);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.planned-changes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.planned-change {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid var(--warning);
}

.planned-change-date {
    color: var(--warning);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.planned-change-message {
    color: var(--text-secondary);
    line-height: 1.5;
}
