/* ==========================================================================
   Custom Accessible Styles & Visual Overrides
   Hostinger Premium Hosting Compatible (Pure CSS + Dynamic Client Compiler)
   WCAG 2.1 AA / GIGW 3.0 / W3C Standards Compliant
   ========================================================================== */

/* Design Tokens & CSS Custom Properties (Node-Free Deployment) */
:root {
    --color-brand-navy: #0F172A;
    --color-brand-navyLight: #1E293B;
    --color-brand-blue: #1E40AF;
    --color-brand-accentBlue: #2563EB;
    --color-brand-lightBg: #F8FAFC;
    --color-brand-darkText: #090D16;
    --color-brand-success: #065F46;
    --color-brand-warning: #9A3412;
    --color-brand-error: #991B1B;

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Outfit', sans-serif;
}

/* Standalone Brand Color & Utility Classes */
.bg-brand-navy { background-color: var(--color-brand-navy) !important; }
.bg-brand-navyLight { background-color: var(--color-brand-navyLight) !important; }
.bg-brand-blue { background-color: var(--color-brand-blue) !important; }
.bg-brand-accentBlue { background-color: var(--color-brand-accentBlue) !important; }
.bg-brand-lightBg { background-color: var(--color-brand-lightBg) !important; }
.bg-brand-warning { background-color: var(--color-brand-warning) !important; }
.bg-brand-success { background-color: var(--color-brand-success) !important; }
.bg-brand-error { background-color: var(--color-brand-error) !important; }

.text-brand-navy { color: var(--color-brand-navy) !important; }
.text-brand-navyLight { color: var(--color-brand-navyLight) !important; }
.text-brand-blue { color: var(--color-brand-blue) !important; }
.text-brand-accentBlue { color: var(--color-brand-accentBlue) !important; }
.text-brand-darkText { color: var(--color-brand-darkText) !important; }
.text-brand-warning { color: var(--color-brand-warning) !important; }
.text-brand-success { color: var(--color-brand-success) !important; }

.font-sans { font-family: var(--font-sans); }
.font-display { font-family: var(--font-display); }

/* 1. Global Focus Indicator Override (WCAG 2.1/2.2 AA)
   Enforces a highly visible focus indicator on all interactive controls.
   -------------------------------------------------------------------------- */
:focus-visible {
    outline: 3px solid #2563EB !important; /* Brand Accent Blue */
    outline-offset: 2px !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8) !important;
}

/* Ensure Safari-friendly active state visible outlines */
a:focus-visible, 
button:focus-visible, 
input:focus-visible, 
select:focus-visible, 
textarea:focus-visible {
    outline: 3px solid #2563EB !important;
    outline-offset: 2px !important;
}

/* Disable native outline on pointer-device click, keeping it for tab navigation */
:focus:not(:focus-visible) {
    outline: none !important;
}

/* 2. Screen Reader Only Utility (Visually Hidden)
   Keeps text available to screen readers while hiding it visually.
   -------------------------------------------------------------------------- */
.visually-hidden,
.sr-only {
    position: absolute !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    white-space: nowrap !important;
}

/* Skip link behaviour - hides offscreen until focused by keyboard */
.skip-link:not(:focus-within):not(:active) {
    position: absolute !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    white-space: nowrap !important;
}

/* 3. Typography & Styling Enhancements
   -------------------------------------------------------------------------- */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.025em;
}

/* Glassmorphism effects for premium financial feel */
.glass-panel {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.glass-panel-dark {
    background: rgba(15, 23, 42, 0.85); /* Slate 900 */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Premium gradient animations */
@keyframes pulseGlow {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.4; }
}

.glow-effect {
    position: relative;
}
.glow-effect::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 25px 5px rgba(37, 99, 235, 0.25);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}
.glow-effect:hover::after {
    opacity: 1;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #F8FAFC;
}
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* 4. Accessible Form Inputs
   -------------------------------------------------------------------------- */
/* Invalid styles using :user-invalid for non-annoying validation */
input:user-invalid,
select:user-invalid,
textarea:user-invalid {
    border-color: #991B1B !important; /* Crimson Red */
    background-color: #FEF2F2;
}

/* Custom indicator styles */
.input-error-border {
    border-color: #991B1B !important;
}

/* 5. Custom Table Layouts for SEBI Disposal Metrics
   -------------------------------------------------------------------------- */
.sebi-table th, .sebi-table td {
    padding: 1rem 1.25rem;
    text-align: left;
}
.sebi-table tbody tr:nth-child(even) {
    background-color: #F1F5F9;
}
.sebi-table tbody tr:hover {
    background-color: #E2E8F0;
}

/* ==========================================================================
   6. Custom Accessibility Helper Classes (WCAG / ADA / Section 508)
   ========================================================================== */

/* Text Scale Factors */
html.a11y-text-120 {
    font-size: 120% !important;
}
html.a11y-text-150 {
    font-size: 150% !important;
}
html.a11y-text-200 {
    font-size: 200% !important;
}

/* High Contrast Modes */
body.a11y-high-contrast {
    background: #000000 !important;
    color: #FFFFFF !important;
}
body.a11y-high-contrast * {
    background-color: #000000 !important;
    color: #FFFFFF !important;
    border-color: #FFFFFF !important;
    box-shadow: none !important;
    text-shadow: none !important;
}
body.a11y-high-contrast a, 
body.a11y-high-contrast a *, 
body.a11y-high-contrast button, 
body.a11y-high-contrast button * {
    color: #FFFF00 !important; /* Yellow links for standard visibility */
    text-decoration: underline !important;
}
body.a11y-high-contrast a:hover, 
body.a11y-high-contrast button:hover {
    background: #FFFFFF !important;
    color: #000000 !important;
}

/* Monochromatic / Grayscale */
body.a11y-grayscale {
    filter: grayscale(100%) !important;
}

/* Dyslexia Friendly Fonts */
body.a11y-dyslexia, 
body.a11y-dyslexia * {
    font-family: 'Comic Sans MS', 'Dyslexie', 'OpenDyslexic', 'Courier New', sans-serif !important;
}

/* Highlight Links */
body.a11y-highlight-links a,
body.a11y-highlight-links button {
    outline: 3px solid #D97706 !important; /* Amber 600 */
    outline-offset: 3px !important;
    text-decoration: underline !important;
    font-weight: 800 !important;
}

/* Reading Ruler Line */
.a11y-reading-ruler {
    position: fixed;
    left: 0;
    width: 100%;
    height: 6px;
    background-color: #2563EB; /* Bright Blue */
    z-index: 99999;
    pointer-events: none;
    display: none;
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.5);
}

/* Speaking Highlight */
.a11y-speaking-highlight {
    outline: 2px dashed #2563EB !important;
    outline-offset: 3px !important;
    background-color: rgba(37, 99, 235, 0.08) !important;
}

/* WhatsApp Floating Widget Dedicated Styles */
#whatsapp-widget {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 999;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.wa-toggle-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    background-color: #25D366 !important;
    color: #FFFFFF !important;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(37, 211, 102, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wa-toggle-btn:hover {
    background-color: #20BA5A !important;
    transform: scale(1.08);
    box-shadow: 0 15px 30px -5px rgba(37, 211, 102, 0.6), 0 10px 12px -5px rgba(0, 0, 0, 0.4);
}

.wa-toggle-btn:focus-visible {
    outline: 3px solid #25D366 !important;
    outline-offset: 3px !important;
}

.wa-toggle-btn i {
    font-size: 1.85rem;
    color: #FFFFFF !important;
}

.wa-pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background-color: #25D366;
    animation: waPulse 2s cubic-bezier(0, 0, 0.2, 1) infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes waPulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    70%, 100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.wa-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 1.25rem;
    height: 1.25rem;
    background-color: #EF4444 !important;
    color: #FFFFFF !important;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFFFFF;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.wa-chat-box {
    position: absolute;
    bottom: 4.5rem;
    left: 0;
    margin-bottom: 0.75rem;
    width: 20rem;
    max-width: calc(100vw - 3rem);
    background-color: #0F172A !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.5), 0 0 15px rgba(37, 211, 102, 0.15);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom left;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1000;
}

.wa-hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(1rem) scale(0.95) !important;
    pointer-events: none !important;
}

.wa-visible {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: auto !important;
}

.wa-chat-header {
    background-color: #075E54 !important;
    padding: 1rem;
    color: #FFFFFF !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wa-chat-header-title {
    font-weight: 700;
    font-size: 0.875rem;
    color: #FFFFFF !important;
    margin: 0;
}

.wa-chat-header-status {
    font-size: 0.7rem;
    color: #A7F3D0 !important;
    display: flex;
    align-items: center;
    margin-top: 0.15rem;
}

.wa-online-dot {
    width: 0.45rem;
    height: 0.45rem;
    background-color: #34D399;
    border-radius: 9999px;
    margin-right: 0.35rem;
    display: inline-block;
    animation: waBlink 1.5s infinite;
}

@keyframes waBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.wa-close-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8) !important;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.wa-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF !important;
}

.wa-chat-body {
    padding: 1rem;
    background-color: #0B132B !important;
}

.wa-chat-bubble {
    background-color: #1E293B !important;
    border-left: 3px solid #25D366 !important;
    border-radius: 0.75rem;
    border-top-left-radius: 0;
    padding: 0.75rem 0.875rem;
    margin-bottom: 0.875rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.wa-chat-bubble p {
    color: #E2E8F0 !important;
    font-size: 0.8rem;
    line-height: 1.45;
    margin: 0;
}

.wa-chat-bubble .wa-bubble-author {
    color: #25D366 !important;
    font-weight: 700;
    font-size: 0.725rem;
    margin-bottom: 0.25rem;
    display: block;
}

.wa-start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #25D366 !important;
    color: #090D16 !important;
    font-weight: 700;
    font-size: 0.825rem;
    text-decoration: none !important;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
    transition: all 0.2s ease;
}

.wa-start-btn:hover {
    background-color: #20BA5A !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.45);
    color: #000000 !important;
}

.wa-start-btn i {
    font-size: 1.15rem;
    margin-right: 0.5rem;
    color: #090D16 !important;
}

.wa-tooltip {
    display: none;
}

@media (min-width: 768px) {
    .wa-tooltip {
        display: block;
        position: absolute;
        left: 100%;
        margin-left: 0.75rem;
        background-color: #0F172A;
        color: #FFFFFF;
        font-size: 0.75rem;
        font-weight: 600;
        padding: 0.4rem 0.75rem;
        border-radius: 0.5rem;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        border: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    }
    
    .wa-toggle-btn:hover .wa-tooltip {
        opacity: 1;
    }
}


