:root {
    --bg-app: #e0e5ec;
    --text-main: #31344b;
    --primary-glow: #ff6d00;
    --nm-shadow-out: 9px 9px 16px rgb(163,177,198,0.6), -9px -9px 16px rgba(255,255,255, 0.5);
    --nm-shadow-in: inset 6px 6px 12px #c1c9d2, inset -6px -6px 12px #ffffff;
}

.hidden { display: none !important; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-app);
    color: var(--text-main);
    margin: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding-bottom: 110px;
    transition: all 0.4s ease;
}

.container { width: 100%; max-width: 450px; display: flex; flex-direction: column; padding: 20px; box-sizing: border-box; }

/* 3D ACTION BUTTON */
.round-clock-btn {
    width: 260px; height: 260px; border-radius: 50%;
    border: 4px solid var(--bg-app); 
    background: var(--bg-app);
    box-shadow: var(--nm-shadow-out);
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; position: relative; overflow: hidden;
    transition: all 0.3s ease;
}

.round-clock-btn.active {
    background: var(--primary-glow);
    box-shadow: 0 0 50px var(--primary-glow), inset 0 0 25px rgba(255,255,255,0.4);
    border-color: var(--bg-app) !important;
}

/* TEXT VISIBILITY */
p, span, label, .decimal-meter, h1, h2 {
    opacity: 1.0 !important;
    font-weight: 800;
}

/* PROGRESS RING */
.progress-ring { position: absolute; top: 0; left: 0; transform: rotate(-90deg); pointer-events: none; }
.progress-ring__circle { transition: stroke-dashoffset 0.4s; transform-origin: 50% 50%; stroke: var(--primary-glow); filter: drop-shadow(0 0 8px var(--primary-glow)); }

/* CLOCK TEXT */
#clock-status-text {
    font-size: 1.5rem; font-weight: 900; margin: 10px 0; color: var(--text-main);
    letter-spacing: 2px;
}

/* LAYOUT HELPERS */
.btn-stack { display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 2; }
.decimal-meter { font-size: 3rem; font-weight: 900; color: var(--text-main); line-height: 1; margin-bottom: 5px; letter-spacing: -1px; }
#btn-clock-text { font-size: 0.8rem; font-weight: 900; letter-spacing: 3px; color: var(--text-main); opacity: 0.5; text-transform: uppercase; }

/* ACTIVE TEXT COLORS */
.round-clock-btn.active #btn-clock-text { color: var(--text-main) !important; opacity: 1; }
.round-clock-btn.active .decimal-meter { color: var(--text-main) !important; }

/* NAV */
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 450px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 15px 10px 25px 10px; background: var(--bg-app); box-shadow: 0 -10px 20px rgba(0,0,0,0.1); z-index: 1000; border-top: 1px solid rgba(255,255,255,0.1); }
.nav-item { background: var(--bg-app); box-shadow: var(--nm-shadow-out); border-radius: 12px; padding: 16px 0; color: var(--text-main); font-size: 0.6rem; font-weight: 900; text-align: center; border: 1px solid rgba(255,255,255,0.1); }
.nav-item.active { box-shadow: var(--nm-shadow-in); color: var(--primary-glow); border-color: var(--primary-glow); }

.card { background: var(--bg-app); box-shadow: var(--nm-shadow-out); border-radius: 20px; padding: 20px; }
.input-field { width: 100%; padding: 15px; margin: 5px 0; border-radius: 12px; border: none; background: var(--bg-app); box-shadow: var(--nm-shadow-in); color: var(--text-main); box-sizing: border-box; font-weight: 800; }
.status-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.mini-capsule { padding: 5px 12px; border-radius: 8px; font-size: 0.6rem; font-weight: 900; background: var(--bg-app); box-shadow: var(--nm-shadow-out); color: var(--text-main); }

/* --- FULLSCREEN CARD MODE --- */
.card.fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    max-width: none !important;
    max-height: none !important;
    display: flex;
    flex-direction: column;
    background: var(--bg-app) !important; /* Ensures it doesn't look transparent */
}

/* Forces the inside of the card to stretch and scroll perfectly */
.card.fullscreen-mode .scroll-area, 
.card.fullscreen-mode .dynamic-content {
    flex: 1 !important;
    max-height: none !important;
    overflow-y: auto !important;
}
/* --- CLEAN MINIMALIST CARDS --- */
.card-standard {
    background: #ffffff;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.mobile-route-card {
    background: #ffffff !important;
    border-radius: 14px !important; 
    padding: 16px !important;
    margin-bottom: 12px !important;
    border: 1px solid rgba(0,0,0,0.03) !important; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important; 
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Slimmer status bar */
.mobile-route-card::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important; top: 0 !important; bottom: 0 !important;
    width: 4px !important;
    background: var(--primary-glow) !important; 
}

/* Modern Pill Badge */
.route-priority-badge {
    position: absolute !important;
    top: 14px !important;
    right: 14px !important;
    font-size: 0.6rem !important;
    font-weight: 900 !important;
    padding: 4px 10px !important;
    border-radius: 6px !important; 
    text-transform: uppercase;
    color: white !important;
}

/* Cleaner high-contrast inputs */
.input-field {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
    color: #1e293b !important;
}
.input-field:focus {
    border-color: var(--primary-glow) !important;
    background: #ffffff !important;
}

/* High-contrast solid colors for driver recognition */
.priority-CRITICAL { background: #ef4444 !important; color: #ffffff !important; border: none !important; }
.priority-HIGH { background: #f97316 !important; color: #ffffff !important; border: none !important; }
.priority-NORMAL { background: #f1f5f9 !important; color: #64748b !important; border: 1px solid #e2e8f0 !important; box-shadow: none !important; }

/* Dim completed/returned stops */
.mobile-route-card.status-COMPLETED, 
.mobile-route-card.status-RETURNED {
    opacity: 0.7 !important;
    background: #f8fafc !important;
}

.route-reason-text {
    font-size: 0.8rem !important;
    color: #64748b !important;
    margin-top: 4px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
}

/* --- NOTIFICATION BADGES --- */
.msg-badge {
    position: absolute;
    top: -5px;
    right: 10px;
    background-color: var(--primary-glow); /* Safety Orange */
    color: #fff;
    font-size: 0.7rem;
    font-weight: 900;
    height: 18px;
    min-width: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 5px rgba(255, 109, 0, 0.4);
    z-index: 10;
}

.msg-badge.hidden {
    display: none;
}

/* --- FAILED INSPECTION PULSE --- */
@keyframes hazard-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.status-fail-pulse {
    border-left: 4px solid var(--hazard-color) !important;
    animation: hazard-pulse 2s infinite;
}

/* --- LIVE GPS PULSE DOT --- */
.gps-marker-pulse {
    background-color: #3b82f6; /* Bright Blue */
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    animation: gps-pulse 1.5s infinite;
}

@keyframes gps-pulse {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}