/* ./public/css/styles.css */

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #363636;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-text-size-adjust: 100%;
}

/* ── App Shell ────────────────────────────────────────────────────────────── */
#app {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* ── View Visibility ──────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Template View (full-screen canvas) ───────────────────────────────────── */
#template-view {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ── Loading View ─────────────────────────────────────────────────────────── */
#loading-view {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 1.2rem;
    color: #e88c35;
    font-weight: bold;
}

.loading-spinner {
    color: #e88c35;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    padding: 40px;
    width: 100%;
}

.error-msg {
    color: #c7363f;
    font-size: 1rem;
    text-align: center;
    padding: 40px 20px;
}

/* ── Agency Select View ───────────────────────────────────────────────────── */
#agency-select-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #1e1e1e;
    padding: 16px;
    overflow: hidden;
}

#agency-select-view h1 {
    color: #e88c35;
    font-size: clamp(16px, 4vw, 22px);
    font-weight: 900;
    margin-bottom: 12px;
    border-bottom: 2px solid #e88c35;
    padding-bottom: 8px;
}

#agency-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agency-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    cursor: pointer;
    color: #fff;
    transition: border-color 0.2s;
    width: 100%;
    text-align: left;
}

.agency-btn:hover { border-color: #e88c35; }

.agency-logo {
    height: 36px;
    max-width: 80px;
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
    padding: 2px;
    flex-shrink: 0;
}

.agency-info {
    display: flex;
    flex-direction: column;
}

.agency-name {
    font-weight: bold;
    font-size: clamp(13px, 3.5vw, 17px);
}

.agency-dist {
    font-size: 12px;
    color: #88bd48;
    margin-top: 2px;
}

/* ── Stop Select View ─────────────────────────────────────────────────────── */
#stop-select-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 24px;
    gap: 16px;
    background: #1e1e1e;
}

#stop-select-view h2 {
    color: #e88c35;
    font-size: clamp(16px, 4vw, 22px);
    font-weight: 900;
    text-align: center;
}

#stop-input {
    width: 100%;
    max-width: 300px;
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid #444;
    background: #2a2a2a;
    color: #fff;
    font-size: 1.2rem;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

#stop-input:focus { border-color: #e88c35; }

#stop-submit-btn {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    background: #265da6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

#stop-submit-btn:hover { background: #1e4a8a; }

/* ── Leaflet customization ────────────────────────────────────────────────── */
.leaflet-container { background: #1a1a2e; }

.bus-icon { background: transparent !important; border: none !important; }

/* ── Card flip animation (next bus cards) ─────────────────────────────────── */
@keyframes cardFlip {
    0%   { transform: perspective(600px) rotateX(0deg); opacity: 1; }
    50%  { transform: perspective(600px) rotateX(90deg); opacity: 0; }
    100% { transform: perspective(600px) rotateX(0deg); opacity: 1; }
}

.card-flip {
    animation: cardFlip 0.5s ease-in-out;
}

/* ── Pulse animation (alert button) ──────────────────────────────────────── */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.04); }
}

/* ── Scrollbar styling ────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: #1a1a1a; }
::-webkit-scrollbar-thumb { background: #555; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #e88c35; }
