/* =========================================================================
   👑 DESIGN SYSTEM: PREMIUM INLINE ENGINE FOR ISLAMIC TIME SIMULATIONS
   ========================================================================= */
:root {
    --panel-bg-glass: rgba(19, 28, 46, 0.75);
    --surface-card: rgba(30, 41, 59, 0.45);
    --surface-hover: rgba(51, 65, 85, 0.6);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    /* Elegant Dual Accent Colors */
    --accent-blue: #38bdf8;
    --accent-blue-glow: rgba(56, 189, 248, 0.25);
    --gold-premium: #e2b438;
    --gold-glow: rgba(226, 180, 56, 0.2);
    
    --input-border: rgba(255, 255, 255, 0.08);
    --input-border-focus: rgba(226, 180, 56, 0.4);
    
    /* Dimension Rules */
    --bar-height: 40px;
    --font-premium: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* 1. Global Box-Sizing & Premium Anti-Aliasing */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: var(--font-premium);
}

/* 2. Elegant Row Layout Unification */
.control-grid {
    display: flex !important;
    flex-direction: row !important;      /* Forces perfect horizontal layout */
    flex-wrap: nowrap !important;        /* Strictly prevents multi-row breakage */
    align-items: flex-end !important;    /* Flushes bottoms perfectly together */
    gap: 12px !important;                /* Relaxed yet compact luxury spacing */
    width: 100%;
    padding: 4px 0;
    box-sizing: border-box;
}

/* 3. Proportional Spatial Agility Splits */
.control-group {
    display: flex;
    flex-direction: column;
    min-width: 0;                        /* Protects inner assets from clipping out */
}

/* 🛠️ UPGRADE LEBAR: Fokus Bandar dibesarkan (3.2) & Speed dikurangkan (1.2) */
.control-group:has(#focus-city) {
    flex: 3.0 !important; 
    gap: 6px;
}

.control-group:has(#speed-slider) {
    flex: 1.4 !important;
    gap: 0 !important;                  /* Remove hard margin to balance structural flex constraints */
    justify-content: space-between;
    height: calc(var(--bar-height) + 16px); /* Match dynamic height calculations of labeled blocks */
}

.control-group.action-buttons {
    flex: 0 0 auto !important;          /* Hard-locks action buttons from squeezing */
}

/* 4. Elegant Typography Styling */
.control-group label {
    font-size: 11px !important;
    font-weight: 600;
    letter-spacing: 0.04em;
    /*text-transform: uppercase;*/           /* Gives professional telemetry dashboard style */
    opacity: 0.85;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

/* 5. Luxury Focus City Select Menu Upgrade */
#focus-city {
    width: 100%;
    height: var(--bar-height);
    background: var(--surface-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--text-main);
    padding: 0 28px 0 10px;              /* Space out to allow custom visual arrows */
    font-size: 12px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    text-overflow: ellipsis;
    -webkit-appearance: none;
    appearance: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Subtle chevron arrow injection fallback */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://w3.org' fill='none' viewBox='0 0 24 24' stroke='%23e2b438'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

#focus-city:focus {
    border-color: var(--input-border-focus);
    box-shadow: 0 0 12px var(--gold-glow);
    background-color: rgba(30, 41, 59, 0.7);
}

/* 6. High-Fidelity Custom Speed Slider Upgrade */
#speed-slider {
    width: 100%;
    height: var(--bar-height);          /* Keeps matching box height bounds */
    background: transparent !important; /* Frame and backgrounds completely cleared */
    border: none !important;            /* Outer frame line border removed */
    padding: 0 !important;              /* Margins reset to sit flush inside row flow */
    margin: 0;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    align-items: center;                /* Vertically centers slider track inside container box */
}

/* Track Customization */
#speed-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    transition: background 0.2s;
}

#speed-slider:focus::-webkit-slider-runnable-track {
    background: rgba(255, 255, 255, 0.15);
}

/* Luxury Thumb Customization (Centered perfectly over cross-axis tracking guidelines) */
#speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-main);
    border: 2px solid var(--accent-blue);
    margin-top: -5.5px;                 /* Perfectly calculated cross-axis center offset */
    box-shadow: 0 0 10px var(--accent-blue-glow);
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s;
}

#speed-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--accent-blue);
}

/* 7. Premium Action Buttons (Glassmorphic Controls) */
.buttons-wrapper {
    display: flex;
    gap: 8px;
    height: var(--bar-height);
}

.control-group .btn {
    width: 42px !important;              /* Elegant square profile sizing */
    height: var(--bar-height) !important;
    border: 1px solid var(--input-border);
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    background: var(--surface-card);
    color: var(--text-main);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.control-group .btn:active {
    transform: scale(0.92);
}

/* Play/Pause Button Premium Glow */
.control-group .btn-pause {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
    color: var(--accent-blue);
}

.control-group .btn-pause:hover {
    background: var(--accent-blue);
    color: #0f172a;
    box-shadow: 0 0 15px var(--accent-blue-glow);
    border-color: transparent;
}

/* Reset Button Premium Design */
.control-group .btn-reset {
    background: var(--surface-card);
    color: var(--text-muted);
}

.control-group .btn-reset:hover {
    background: var(--surface-hover);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.15);
}

.control-group .icon-symbol {
    font-size: 1.15rem !important;
    font-weight: normal;
}

/* 8. Visibility Control Alignment */
.desktop-only {
    display: none !important;
}

@media (min-width: 769px) {
    .desktop-only {
        display: block !important;
    }
}

/* 9. Seamless Mini Display Rules (< 360px width protection) */
@media (max-width: 360px) {
    .control-grid {
        gap: 6px !important;
    }
    .control-group:has(#speed-slider) {
        height: calc(var(--bar-height) + 18px);
    }
    .control-group label {
        font-size: 10px !important;
    }
    #focus-city {
        font-size: 10px;
        padding-right: 20px;
    }
    .control-group .btn {
        width: 34px !important;
    }
}

/* =========================================================================
   🕋 OPTIONS ACCORDION PANEL SHEET - LOW COMPACT ABOVE MENU BOTTOM
   ========================================================================= */
.panel-overlay {
    position: fixed !important;
    left: 0 !important;
    width: 100% !important;
    background-color: var(--panel-bg, #131c2e) !important;
    color: var(--text-main, #ffffff) !important;
    border-radius: 24px 24px 0 0 !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5) !important;
    
    /* 🛠️ DIBAIKI: Letakkan tapak panel ngam-ngam DI ATAS menu bottom (65px) */
    bottom: var(--nav-h, 65px) !important; 
    
    /* 🛠️ DIRENDAHKAN MAKSIMUM: Ruang padding yang ultra-kompak dan nipis */
    padding: 16px 16px 16px 24px !important;
    box-sizing: border-box !important;
    z-index: 8000 !important; /* Kekal di bawah z-index menu bottom */
    
    /* Sembunyikan panel ke bawah dengan selamat bermula dari sempadan menu bottom */
    transform: translateY(calc(100% + var(--nav-h, 65px))) !important;
    will-change: transform;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

/* Dicetuskan apabila panel dibuka menerusi JavaScript */
.panel-overlay.show {
    /* Meluncur naik secara automatik dan melekat di atas bumbung menu bottom */
    transform: translateY(0) !important;
}

