/* 
 * Roh Financial Dashboard - High-Tech Futurist White Elegance Theme
 * Custom White Cyberpunk & Glassmorphism Design (v16.5)
 */

body {
    font-family: 'Sarabun', 'Inter', sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    overflow-x: hidden;
    position: relative;
}

/* 1. Cyber Grid Overlay Background */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: -10;
}

/* Ambient Pulsing Glow in the Background */
body::after {
    content: "";
    position: fixed;
    top: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.05) 0%, rgba(99, 102, 241, 0) 70%);
    pointer-events: none;
    z-index: -9;
    animation: floatAmbient 12s ease-in-out infinite alternate;
}

@keyframes floatAmbient {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-5%, 5%) scale(1.1); }
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
    border: 1px solid #f8fafc;
}
::-webkit-scrollbar-thumb:hover {
    background: #818cf8;
}

/* 2. Futuristic PIN Gate & Scanner Line */
.scanner-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #818cf8, #3b82f6, transparent);
    animation: scan 4s linear infinite;
    pointer-events: none;
}

@keyframes scan {
    0% { top: 0%; opacity: 0.1; }
    10% { opacity: 0.7; }
    90% { opacity: 0.7; }
    100% { top: 100%; opacity: 0.1; }
}

/* Custom keypad button styling with micro-shadows */
.keypad-btn {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    color: #0f172a;
    font-weight: 700;
    font-size: 1.3rem;
    height: 60px;
    border-radius: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02), 0 2px 4px -1px rgba(0,0,0,0.01);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.keypad-btn:hover {
    background-color: #ffffff;
    border-color: #818cf8;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.08), 0 4px 6px -2px rgba(99, 102, 241, 0.04);
}
.keypad-btn:active {
    background-color: #f1f5f9;
    transform: translateY(1px) scale(0.98);
    box-shadow: inset 0 2px 4px rgba(99,102,241,0.06);
}

/* Dot ripple effect when active */
.pin-dot {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 3. Tech Card Glassmorphism & Hover Glow */
.tech-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 15px -3px rgba(0,0,0,0.01), 0 2px 6px -2px rgba(0,0,0,0.01);
}

.tech-card:hover {
    transform: translateY(-3px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 
        0 20px 25px -5px rgba(99, 102, 241, 0.05),
        0 10px 10px -5px rgba(99, 102, 241, 0.02),
        0 0 15px rgba(99, 102, 241, 0.08);
}

/* Tabular numbers for financial metrics (Tactical display style) */
.tabular-num {
    font-variant-numeric: tabular-nums;
    font-family: 'Inter', 'Sarabun', sans-serif;
    letter-spacing: -0.02em;
}

/* 4. Tab Navigation High-Tech Styling */
.tab-btn {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
    overflow: hidden;
}

.tab-btn.active {
    background: #6366f1 !important;
    color: #ffffff !important;
    border-color: #6366f1 !important;
    box-shadow: 0 8px 16px -4px rgba(99, 102, 241, 0.3), 0 0 10px rgba(99, 102, 241, 0.15);
}

.tab-btn::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: #818cf8;
    transition: all 0.25s ease;
    transform: translateX(-50%);
}
.tab-btn:hover:not(.active)::after {
    width: 60%;
}

/* 5. Glowing Progressive Bar */
.glowing-bar {
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.35);
    background: linear-gradient(90deg, #6366f1 0%, #3b82f6 50%, #ec4899 100%);
    background-size: 200% 200%;
    animation: moveGradient 4s linear infinite;
    position: relative;
}

.glowing-bar::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 15px;
    background: #ffffff;
    opacity: 0.5;
    filter: blur(4px);
    animation: pulseGlow 1.5s ease-in-out infinite;
}

@keyframes moveGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulseGlow {
    0%, 100% { transform: scaleX(1); opacity: 0.3; }
    50% { transform: scaleX(2.5); opacity: 0.8; }
}

/* Pulsing Status Dot */
.pulse-dot {
    position: relative;
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
}
.pulse-dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #10b981;
    opacity: 0.8;
    animation: pulseRing 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulseRing {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* 6. Form elements focus ring */
input:focus, select:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    border-color: #818cf8 !important;
    outline: none;
}

/* Custom Alert Animations */
.tab-panel {
    animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Shake Animation for Incorrect PIN */
.animate-shake {
    animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Responsive Table Styles */
th {
    font-weight: 700;
    letter-spacing: 0.05em;
}

tr {
    transition: background-color 0.15s ease;
}
tbody tr:hover {
    background-color: rgba(99, 102, 241, 0.02) !important;
}

/* Digital Scanner Sweep for Header */
.header-glow {
    position: relative;
    overflow: hidden;
}
.header-glow::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #3b82f6, #ec4899);
}
