/* ==========================================================================
   PREMIUM LIGHT-THEME DESIGN SYSTEM - TAXI BLAZOR APP
   Colors: Soft Light Blue/Slate Gradient, Pure Glassmorphism, Glowing Badges
   ========================================================================== */

/* Universal & Typography Reset */
:root {
    --bg-dark-radial: radial-gradient(circle at top, #f1f5f9 0%, #cbd5e1 100%);
    --panel-glass: rgba(255, 255, 255, 0.65);
    --panel-border: rgba(255, 255, 255, 0.85);
    --panel-glow: rgba(30, 41, 59, 0.03);
    
    --neon-green: #10b981;
    --neon-green-glow: rgba(16, 185, 129, 0.4);
    --neon-red: #ef4444;
    --neon-red-glow: rgba(239, 68, 68, 0.4);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: rgba(15, 23, 42, 0.08);
    
    --font-outfit: 'Outfit', sans-serif;
}

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

html, body {
    font-family: var(--font-outfit);
    background: #cbd5e1;
    background-image: var(--bg-dark-radial);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    padding: 0;
}

/* Page Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

/* Header & Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

.gradient-text {
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Premium Card Glassmorphism (Light Mode) */
.glass-card {
    background: var(--panel-glass);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 10px 40px -10px rgba(15, 23, 42, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--x, 0px) var(--y, 0px), rgba(255,255,255,0.4), transparent 45%);
    pointer-events: none;
    z-index: 1;
}

/* Stunning Traffic Light (Semafor) Component */
.semafor-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 0 2rem 0;
}

.semafor-housing {
    width: 90px;
    height: 185px;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-radius: 45px;
    border: 3px solid #334155;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 15px 35px -5px rgba(15, 23, 42, 0.3),
                inset 0 2px 5px rgba(255,255,255,0.1),
                0 0 0 1px rgba(255,255,255,0.05);
    position: relative;
}

/* Visual caps or hoods for the traffic lights */
.semafor-light-container {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #020617;
    border: 4px solid #1e293b;
    box-shadow: inset 0 3px 10px rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

.semafor-light {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    position: relative;
    transition: all 0.5s ease;
    cursor: pointer;
}

/* Light Glass Highlight (Glossy look) */
.semafor-light::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 8px;
    width: 32px;
    height: 16px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
    border-radius: 50% 50% 10px 10px;
    pointer-events: none;
}

/* Unlit light state details */
.light-red {
    background: radial-gradient(circle at 35% 35%, #450a0a 0%, #1e0000 100%);
}

.light-green {
    background: radial-gradient(circle at 35% 35%, #022c22 0%, #00120b 100%);
}

/* Active glowing state details with animations */
.light-red.active {
    background: radial-gradient(circle at 35% 35%, #fca5a5 0%, var(--neon-red) 70%, #991b1b 100%);
    box-shadow: 0 0 25px var(--neon-red),
                inset 0 0 10px rgba(255,255,255,0.4);
    animation: pulse-red 2s infinite alternate;
}

.light-green.active {
    background: radial-gradient(circle at 35% 35%, #a7f3d0 0%, var(--neon-green) 70%, #065f46 100%);
    box-shadow: 0 0 25px var(--neon-green),
                inset 0 0 10px rgba(255,255,255,0.4);
    animation: pulse-green 2s infinite alternate;
}

/* Pulsing Animations */
@keyframes pulse-red {
    0% {
        box-shadow: 0 0 12px rgba(239, 68, 68, 0.4), inset 0 0 5px rgba(255,255,255,0.3);
    }
    100% {
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.9), inset 0 0 15px rgba(255,255,255,0.5);
    }
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 12px rgba(16, 185, 129, 0.4), inset 0 0 5px rgba(255,255,255,0.3);
    }
    100% {
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.9), inset 0 0 15px rgba(255,255,255,0.5);
    }
}

/* Premium Countdown / Progress Indicator */
.refresh-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.refresh-bar-bg {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    margin-top: 5px;
}

.refresh-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border-radius: 2px;
    transition: width 1s linear;
}

/* Custom Table Layout styling */
.table-container {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid var(--border-color);
}

.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 0.95rem;
}

.premium-table th {
    background: rgba(241, 245, 249, 0.9);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
}

.premium-table td {
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.premium-table tbody tr {
    background: transparent;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.premium-table tbody tr:hover {
    background: rgba(15, 23, 42, 0.025);
}

.premium-table tbody tr.selected {
    background: rgba(37, 99, 235, 0.08) !important;
}

.premium-table tbody tr.selected td {
    color: var(--text-primary);
    border-bottom-color: rgba(37, 99, 235, 0.15);
}

/* Search Box Container */
.search-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    color: var(--text-primary);
    font-family: var(--font-outfit);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.search-input:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.1),
                inset 0 1px 2px rgba(0,0,0,0.02);
    background: rgba(255, 255, 255, 0.95);
}

.search-icon {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

/* Quick Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.02);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--neon-green);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.stat-icon.red {
    background: rgba(239, 68, 68, 0.1);
    color: var(--neon-red);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.stat-icon.blue {
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.12);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Loading Overlay & Micro interactions */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pulse-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.1);
    border: 2px solid #2563eb;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(0.6);
        opacity: 0.1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.text-pulse {
    animation: glow-pulse 2s infinite alternate;
}

@keyframes glow-pulse {
    0% {
        opacity: 0.6;
    }
    100% {
        opacity: 1;
    }
}

/* ==========================================================================
   MOBILE SCREEN OPTIMIZATIONS (max-width: 767px)
   ========================================================================== */
@media (max-width: 767px) {
    .app-container {
        padding: 0.5rem 0.35rem;
    }

    h1.gradient-text {
        font-size: 1.35rem !important;
    }
    
    p.text-secondary {
        font-size: 0.75rem !important;
    }

    .glass-card {
        padding: 0.65rem 0.5rem !important;
        border-radius: 14px;
        margin-bottom: 0.5rem;
    }

    /* Fixed height for the two top cards side-by-side on mobile */
    .dashboard-card {
        min-height: 120px !important;
        height: 120px !important;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem !important;
    }

    .card-title {
        font-size: 0.65rem !important;
        margin-bottom: 2px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        line-height: 1;
    }

    /* Make the horizontal Traffic Light extremely small and cute */
    .semafor-wrapper {
        padding: 0 !important;
        margin: 0 !important;
    }

    .semafor-housing {
        width: 80px;
        height: 40px;
        flex-direction: row;
        border-radius: 12px;
        padding: 4px 8px;
        border-width: 1.5px;
        gap: 6px;
    }

    .semafor-light-container {
        width: 28px;
        height: 28px;
        border-width: 2px;
    }

    .semafor-light {
        width: 22px;
        height: 22px;
    }

    .semafor-light::after {
        width: 12px;
        height: 6px;
        left: 2px;
        top: 1px;
    }

    .reset-button-container {
        margin-top: 2px !important;
        line-height: 1;
    }

    /* Compress the Stats Grid on mobile */
    .stats-mini-row {
        width: 100%;
        display: flex !important;
        gap: 4px !important;
        margin-bottom: 0px !important;
    }

    .stat-mini-item {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 3px 2px !important;
        border-radius: 6px !important;
        font-size: 0.7rem !important;
        font-weight: 700;
        border: 1px solid rgba(15, 23, 42, 0.05);
        gap: 3px;
    }

    .stat-mini-item i {
        font-size: 0.65rem;
    }

    .stat-mini-item.blue {
        background: rgba(37, 99, 235, 0.06);
        color: #2563eb;
    }

    .stat-mini-item.green {
        background: rgba(16, 185, 129, 0.08);
        color: var(--neon-green);
    }

    .stat-mini-item.red {
        background: rgba(239, 68, 68, 0.08);
        color: var(--neon-red);
    }

    /* Compact countdown bar on mobile */
    .refresh-indicator {
        font-size: 0.65rem !important;
        margin-bottom: 0px !important;
    }

    /* Table Compact styling on Mobile */
    .premium-table th, .premium-table td {
        padding: 0.5rem 0.4rem !important;
        font-size: 0.8rem !important;
    }

    .search-input {
        padding: 0.45rem 0.6rem 0.45rem 1.8rem !important;
        font-size: 0.8rem !important;
        border-radius: 8px;
    }

    .search-icon {
        left: 0.6rem !important;
        font-size: 0.8rem !important;
    }
}