/* =========================================================================
   SMART INTRADAY SCREENER - FINAL EXACT STYLES
   ========================================================================= */
/* Hide login screen and dashboard by default to prevent flicker */
#login-screen, #main-dashboard {
    display: none;
}

html, body {
    background-color: #131722 !important;
    margin: 0; padding: 4px; height: 100vh;
    color: #d1d4dc;
    font-family: "Trebuchet MS", sans-serif, -apple-system, BlinkMacSystemFont;
    display: flex; flex-direction: column; overflow: hidden;
    color-scheme: dark;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #131722 !important; }
::-webkit-scrollbar-thumb { background: #2a2e39 !important; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #363c4e !important; }

/* Control Row & KPIs */
.top-control-row {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid #2a2e39; padding-bottom: 3px; margin-bottom: 3px; flex-shrink: 0;
    position: relative; /* Anchors the center item - market status */
    width: 100%;        /* Ensures full span */
}
.kpi-display { display: flex; align-items: center; gap: 12px; font-size: 11px; font-weight: bold; }
.status-display {
    display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: bold;
    position: absolute;           /* Pulls it out of the normal layout flow */
    left: 50%;                    /* Pushes to the exact middle */
    transform: translateX(-50%);  /* Perfects the dead-center alignment */
    white-space: nowrap;          /* Stops "Live" from wrapping under the dot on tiny screens */
}
.status-dot { height: 8px; width: 8px; border-radius: 50%; display: inline-block; }
.green-dot { background-color: #00ff00; box-shadow: 0 0 8px rgba(0, 255, 0, 0.6); }
.red-dot { background-color: #ff4d4d; box-shadow: 0 0 8px rgba(255, 77, 77, 0.6); }

/* RESTORED TRADINGVIEW BLUE BUTTONS */
.control-btn {
    background-color: #2962ff !important; color: #ffffff !important; 
    border: none !important; border-radius: 3px;
    padding: 3px 8px; font-size: 11px; font-weight: bold; 
    cursor: pointer; transition: 0.1s;  display: inline-flex; align-items: center; text-decoration: none;
} 

.control-btn:hover { background-color: #1e4bd8 !important; }

/* Layout Wrappers */
.scroll-wrapper { flex-grow: 1; overflow-y: auto; overflow-x: hidden; }
.tab-content { display: none; }
.active-content { display: block; }
.table-scroll-zone { 
    max-height: 720px; 
    margin: auto;      
    overflow-y: auto; 
    overflow-x: auto; 
    border: 1px solid #2a2e39; 
    background-color: #131722;
     
}

/* Table Structure (Sticky Headers fixed) */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; text-align: center; table-layout: fixed; /* Locks the columns so they don't auto-resize */ }
th {
    position: sticky; top: 0; z-index: 10;
    background-color: #1e222d; color: #d1d4dc; font-weight: bold;
    border-bottom: 1px solid #2a2e39; border-right: 1px solid #2a2e39; border-top: 1px solid #2a2e39;
    padding: 4px; white-space: nowrap; 
}
th:first-child { border-left: 1px solid #2a2e39; }
td {
    padding: 4px; border-bottom: 1px solid #2a2e39; border-right: 1px solid #2a2e39;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #d1d4dc;
}
td:first-child { border-left: 1px solid #2a2e39; }

/* Colors & Headers */
.bullish { color: #00ff88 !important; font-weight: bold; }
.bearish { color: #ff4a4a !important; font-weight: bold; }
.table-header-title { font-size: 12px; font-weight: bold; text-align: center; padding: 4px 0; background-color: #1c2030; border: 1px solid #2a2e39; border-bottom: none; }
.bull-text { color: #00ff88; }
.bear-text { color: #ff4a4a; }

/* Tabs */
.top-toggle-container { display: flex; width: 100%; margin-bottom: 2px; }
.tab-bar { display: flex; margin: 3px 0; flex-shrink: 0; }
.tab-btn, .top-toggle-btn {
    flex: 1; background: #1e222d; border: 1px solid #2a2e39;
    color: #848e9c; padding: 6px 2px; font-size: 11px; font-weight: bold; cursor: pointer; outline: none;
}
.active-top, .tab-btn.active { background-color: #2a2e39 !important; color: #ffffff !important; border: 1px solid #4a4f5c !important; }
.tab-btn:hover, .top-toggle-btn:hover { color: #ffffff; background-color: #2a2e39; }

.card { background-color: #131722; position: relative; }
.bottom-docked-panel { flex-shrink: 0; border-top: 1px solid #2a2e39; padding-top: 3px; margin-top: 3px; background-color: #131722; }

/* Static Highlight & Indicator Classes */
.hlightBull { background-color: #c8e6c9 !important; color: black !important; font-weight: bold; }
.hlightBear { background-color: lightcoral !important; color: black !important; font-weight: bold; }
.hlightGainer { background-color: #a5d6a7 !important; color: black !important; font-weight: bold; }
.hlightLoser { background-color: lightcoral !important; color: black !important; font-weight: bold; }
.textPutHigh { color: #00ff88 !important; font-weight: bold; }
.textCallHigh { color: #ff4a4a !important; font-weight: bold; }
.oiHigh { background-color: #a7a272 !important; color: black !important; font-weight: bold; }
.crossMatch { color: #2962ff; font-weight: bold; }
.rsiHigh { background-color: #9ab09b !important; color: black !important; font-weight: bold; }
.rsiLow { background-color: #FFDED5 !important; color: black !important; font-weight: bold; }



/* --- UNIFIED PREMIUM DARK THEME --- */

.premium-auth-container {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    width: 100%;
    /* Unified deep background with a subtle ambient blue glow on the right */
    background-color: #0b0e14;
    background-image: radial-gradient(circle at 75% 50%, rgba(41, 98, 255, 0.08) 0%, transparent 40%);
    position: relative;
}

.auth-left {
    flex: 1.1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 8%;
    background: transparent;
}

.brand-content {
    transform: translateY(-20px);
}

.auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: transparent;
}

/* THE AUTH CARD: Sleek, Floating Terminal Look */
.auth-card-premium {
    background-color: rgba(19, 23, 34, 0.8); /* Semi-transparent dark matching your dashboard */
    backdrop-filter: blur(10px); /* Frosted glass effect */
    -webkit-backdrop-filter: blur(10px);
    width: 100%;
    max-width: 440px;
    padding: 45px 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05); /* Ultra-thin sleek border */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(41, 98, 255, 0.4); /* Deep drop shadow with a hint of blue rim light */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Premium Dark Inputs */
.premium-input {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    background-color: #0b0e14; /* Deep inset color */
    border: 1px solid #2a2e39;
    color: #ffffff;
    border-radius: 8px;
    box-sizing: border-box;
    margin-bottom: 16px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.premium-input:focus {
    border-color: #2962ff;
    box-shadow: 0 0 5px 3px rgba(41, 98, 255, 0.2); /* Glowing focus ring */
}

.premium-input::placeholder {
    color: #5a6578;
}

/* Premium Buttons */
.premium-btn {
    width: 100%;
    display: block;
    background-color: #2962ff;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(41, 98, 255, 0.3);
}

.premium-btn:hover:not(:disabled) {
    background-color: #1e4bd8;
    box-shadow: 0 6px 15px rgba(41, 98, 255, 0.4);
}

.premium-btn:disabled {
    background-color: #1e222d !important;
    color: #5a6578 !important;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1 !important;
}

.secondary-btn {
    background-color: #1e222d;
    color: #d1d4dc;
    border: 1px solid #2a2e39;
    box-shadow: none;
}

/* --- GLOBAL LOGIN FOOTER (Desktop) --- */
.global-auth-footer {
    position: absolute;
    bottom: 30px;
    left: 8%; /* Aligns perfectly with the logo text above it */
    max-width: 40%;
    color: #5a6578;
    font-size: 12px;
    line-height: 1.5;
    font-family: inherit;
}

.global-auth-footer p {
    margin-top: 0;
    margin-bottom: 6px;
}

.global-auth-footer a {
    color: #2962ff;
    text-decoration: none;
    font-weight: 600;
}


/* --- COMPREHENSIVE MOBILE FIX --- */
@media (max-width: 900px) {
    /* 1. Force the page to allow vertical scrolling on mobile */
    html, body {
        overflow-y: auto !important;
        overflow-x: hidden !important; 
        height: auto !important;
    }

    /* 2. Stack the layout and allow it to grow */
    .premium-auth-container { 
        flex-direction: column !important; 
        background-image: none;
        height: auto !important; 
        min-height: 100vh;
    }
    
    .auth-left, .auth-right {
        flex: none !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    .auth-left { 
        padding: 40px 24px 10px 24px !important; 
        text-align: center; 
    }

    .brand-content { 
        transform: translateY(0) !important; 
    }

    .brand-content div { 
        margin: 0 auto 20px auto !important; 
    }

    /* Ensure text scales down */
    .auth-left .brand-content h1 { 
        font-size: 2.2rem !important; 
        line-height: 1.2 !important;
    }

    .auth-left .brand-content p { 
        font-size: 1rem !important;
        margin: 0 auto !important;
    }

    .auth-right {
        padding: 10px 16px 40px 16px !important;
    }

    .auth-card-premium { 
        padding: 30px 20px !important; 
        max-width: 100% !important;
    }
    
    /* Global Footer Mobile Override */
    .global-auth-footer {
        position: static;
        max-width: 100%;
        text-align: center;
        padding: 0 24px 30px 24px;
        margin-top: auto; /* Pushes it to the very bottom of the scrolling screen */
    }
}
