/* --- VARIABLES --- */
:root {
    --primary-red: #d32f2f;
    --bg-gray: #f1f5f9;
    --text-dark: #333;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #e0e0e0;
    margin: 0;
    display: flex;
    justify-content: center;
    height: 100vh;
}

/* --- APP CONTAINER --- */
.app-container {
    width: 100%;
    max-width: 400px;
    background: white;
    height: 100%;
    position: relative;
    box-shadow: 0 0 25px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- SCREENS --- */
.screen {
    display: none; /* Hidden by default */
    flex-direction: column;
    height: 100%;
}
.screen.active { display: flex; animation: fade 0.3s; }
@keyframes fade { from{opacity:0} to{opacity:1} }

/* --- HEADER --- */
.header {
    background: var(--primary-red);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}
.back-btn { cursor: pointer; padding: 5px; }

/* --- LOGIN SCREEN --- */
#login-screen { justify-content: center; text-align: center; padding: 20px; }
.logo-circle {
    background: var(--primary-red);
    width: 70px; height: 70px;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 2rem;
}

/* --- BUTTONS & INPUTS --- */
input {
    width: 100%; padding: 12px; margin: 10px 0;
    border: 1px solid #ccc; border-radius: 6px; box-sizing: border-box;
}
.btn {
    background: var(--primary-red); color: white;
    padding: 12px; width: 100%; border: none; border-radius: 6px;
    font-weight: bold; cursor: pointer;
}
.btn-outline {
    background: transparent; border: 1px solid white; color: white;
    padding: 5px 10px; border-radius: 4px; font-size: 0.8rem; cursor: pointer;
}

/* --- CARDS --- */
.content { padding: 15px; }
.bus-card {
    background: white;
    border-left: 5px solid var(--primary-red);
    padding: 15px; margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 6px; cursor: pointer;
}
.bus-card h3 { margin: 0 0 5px; font-size: 1rem; display: flex; justify-content: space-between; }
.bus-card h3 span { font-weight: normal; color: #888; font-size: 0.8rem; }
.status-badge {
    display: inline-block; padding: 4px 8px; border-radius: 4px;
    font-size: 0.75rem; font-weight: bold; margin-top: 5px;
}
.status-badge.delayed { background: #ffebee; color: var(--primary-red); }
.status-badge.on-time { background: #e8f5e9; color: green; }

/* --- MAP AREA --- */
.map-container { padding: 10px; display: flex; flex-direction: column; flex: 1; }
#map { flex: 1; width: 100%; border-radius: 8px; border: 1px solid #ddd; }
.stats-row { display: flex; gap: 10px; margin-bottom: 10px; }
.stat-box { flex: 1; background: white; padding: 8px; text-align: center; border-radius: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.stat-box.red { background: var(--primary-red); color: white; }
.alert-box {
    background: #ffebee; color: #b71c1c; padding: 10px;
    border-radius: 6px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; font-size: 0.9rem;
}