/* Global Stacking Context Hierarchy
   Enforces visual priority: Tooltips > Advice Cards > Content
*/

/* Body-Hoisted Tooltip - Replaces .layer-tooltip logic */
.hoisted-tooltip {
    z-index: 2147483647 !important;
    position: fixed !important;
    /* Fixed relative to viewport key for hoisting */
    background-color: #0f172a;
    /* slate-900 */
    color: white;
    font-size: 0.75rem;
    /* text-xs */
    padding: 0.5rem;
    border-radius: 0.375rem;
    /* rounded-md */
    border: 1px solid #ea580c;
    /* brand order */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    max-width: 250px;
    pointer-events: none;
    line-height: 1.375;
    white-space: normal;
    display: none;
    /* Hidden by default, JS toggles it */
}

/* Tier 2: Advice Cards / Status Alerts */
.layer-advice {
    z-index: 50 !important;
}

/* Utility to allow overflow for tooltips */
.allow-overflow {
    overflow: visible !important;
}

/* --- MOBILE TOOLTIP LOCKDOWN --- */
/* This class is applied by JS when on mobile */
.mobile-tooltip-overlay {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90vw !important;
    max-width: 350px !important;
    z-index: 2147483647 !important;
    /* Max layer */
    margin: 0 !important;
    white-space: normal !important;
    height: auto !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    border: 2px solid #ea580c !important;
}

/* Mobile Backdrop */
.tooltip-backdrop {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    /* Dimmed background */
    z-index: 2147483646 !important;
    /* One below tooltip */
    display: none;
    /* JS toggles this */
    cursor: pointer;
    backdrop-filter: blur(2px);
}

/* --- MOBILE OPTIMIZATION --- */
@media (max-width: 640px) {

    /* Task 1: Logo & Header Scaling */


    header h1 {
        font-size: 1.25rem !important;
    }

    /* Task 3: Horizontal Scroll Fix */
    html,
    body {
        overflow-x: hidden;
        width: 100%;
    }

    /* Ensure containers don't overflow */
    .max-w-4xl,
    section,
    header,
    main {
        max-width: 100% !important;
        overflow-x: hidden;
        /* Prevent internal spills */
    }
}

/* --- PREMIUM SLIDER STYLES (Moved from index.html) --- */
.premium-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    outline: none;
    transition: background 0.3s;
}

.premium-slider:hover {
    background: #cbd5e1;
}

.premium-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #ea580c;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    margin-top: -4px;
}

.premium-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    border-color: #c2410c;
}

.premium-slider::-moz-range-track {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
}

.premium-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border: 2px solid #ea580c;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.premium-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    border-color: #c2410c;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}