body {
    background-color: #f4f4f9; 
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    margin: 0;
    min-height: 100vh;
}

/* --- HEADER --- */
.header-container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e0e0e0;
    position: relative; /* Anchor for the pill */
}

/* The J1N2 Experiment Pill */
.j1n2-pill {
    position: absolute;
    top: 0;
    left: 0;
    background-color: #32cd32; /* Parrot Green */
    color: #000;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 20px;
    /* text-transform: uppercase; */
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
    z-index: 10;
}

.j1n2-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* The Title Block */
.brand-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 30px; /* Space for the pill */
    margin-bottom: 25px;
    text-align: center;
}

.sub-heading {
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    margin-bottom: 5px;
}

h1 {
    color: #202124;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    margin: 0;
    font-size: 2.2rem;
    font-family: 'Google Sans', Roboto, 'Helvetica Neue', sans-serif;
    font-weight: 900;
    line-height: 1;
}

/* --- CONTROLS --- */
.controls-row {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

select {
    background: #fff;
    color: #333;
    border: 1px solid #ccc;
    padding: 10px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    outline: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* --- TOGGLE SWITCH --- */
.toggle-container {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.toggle-label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: 10px;
    color: #555;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider { background-color: #2c3e50; }
input:checked + .slider:before { transform: translateX(26px); }


/* --- BOARD GRID --- */
.board {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 900px;
}

.loading-state {
    color: #888;
    text-align: center; 
    margin-top: 40px;
}

.row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr; 
    gap: 20px;
    background: #fff;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-left: 6px solid #ddd;
    transition: all 0.3s ease;
    align-items: center;
}

.city { 
    font-size: 1.4rem; 
    font-weight: 800; 
    color: #2c3e50; 
    letter-spacing: -0.5px;
}

.flight-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.hero-time {
    font-size: 1.6rem;
    font-weight: 700;
    color: #222;
    line-height: 1;
    margin-bottom: 4px;
}

.countdown { font-size: 0.9rem; font-weight: 500; }
.countdown.urgent { color: #e74c3c; } 
.countdown.good { color: #27ae60; }   
.countdown.far { color: #95a5a6; }    

.flight-badge {
    display: inline-block;
    background: #f0f2f5;
    color: #666;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    margin-top: 6px;
    width: fit-content;
}

.label-small {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #999;
    font-weight: 700;
    margin-bottom: 2px;
}

/* --- DYNAMIC STATES --- */
.row.status-urgent { border-left-color: #e74c3c; }
.row.status-good { border-left-color: #27ae60; }
.row.status-far { border-left-color: #bdc3c7; }

.row:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }

/* Mobile */
@media (max-width: 600px) {
    .j1n2-pill {
        position: static;
        align-self: flex-start;
        margin-bottom: 15px;
    }
    .brand-row { margin-top: 0; }
    
    .row { grid-template-columns: 1fr; gap: 15px; }
    .flight-block { 
        flex-direction: row; 
        justify-content: space-between; 
        align-items: center; 
        border-top: 1px solid #eee;
        padding-top: 10px;
    }
    .flight-badge { margin-top: 0; }
    .controls-row { flex-direction: column; width: 100%; }
    select, .toggle-container { width: 100%; box-sizing: border-box; }
    .toggle-container { justify-content: space-between; }
}

/* Weather Block Styling */
.weather-block {
    margin-left: auto; /* Pushes it to the far right */
    text-align: center;
    padding-left: 20px;
    border-left: 1px solid rgba(0,0,0,0.1);
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #555;
}

.weather-icon {
    font-size: 32px !important; /* Size of the icon */
    color: #f39c12; /* Sun Yellow/Orange */
    margin-bottom: 2px;
}

.weather-temp {
    font-weight: 700;
    font-size: 1.1rem;
    color: #333;
}

.weather-desc {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #888;
    margin-top: 2px;
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    .row {
        flex-wrap: wrap; /* Allow wrapping on small screens */
    }
    
    .weather-block {
        margin-left: 0;
        margin-top: 15px;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid rgba(0,0,0,0.1);
        padding-top: 10px;
        width: 100%; /* Full width on mobile */
        flex-direction: row; /* Horizontal layout on mobile */
        gap: 10px;
    }
    
    .weather-desc {
        font-size: 0.9rem;
    }
}