/**
 * POLICE CONNECT - Citizen Portal Modern Component Styles
 * Responsive, Mobile-First, Accessible, WCAG AA Compliant
 */

:root {
    --color-preview-gold: #d97706;
    --color-preview-bg: #fffbeb;
    --color-preview-border: #fcd34d;
    --color-preview-text: #92400e;
}

/* 1. Legal & Trust Safety Sticky Banner (Permanently Hidden) */
#previewSafetyBanner,
.preview-safety-banner {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    opacity: 0 !important;
}

.preview-safety-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.preview-safety-badge {
    background: #d97706;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.preview-safety-text {
    flex: 1;
    line-height: 1.4;
}

.preview-safety-close {
    background: none;
    border: none;
    color: #92400e;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.preview-safety-close:hover {
    background: rgba(217, 119, 6, 0.15);
}

/* 3. Nearest Station Highlight Card */
.nearest-station-card-highlight {
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 12px;
    padding: 20px;
}

.nearest-badge {
    display: inline-block;
    background: #16a34a;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

/* 4. Feedback Form Alerts & Errors */
.alert-feedback-success {
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.form-control.has-error {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
}

/* 5. Responsive Table Containers (No horizontal page spill) */
.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem;
    border: 1px solid var(--color-border-subtle, #e2e8f0);
    border-radius: 8px;
}

.table-responsive-wrapper table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

/* 6. Dynamic Detail Page Components */
.detail-hero-box {
    background: linear-gradient(135deg, #040e1a 0%, #0f2744 100%);
    color: #ffffff;
    padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 32px);
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: 0 10px 30px rgba(4, 14, 26, 0.2);
}

.detail-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.step-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.step-item-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.step-number-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1e3a8a;
    color: #ffffff;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

/* 7. Dark Mode & High Contrast Enhancements */
[data-theme="dark"] {
    --color-bg-body: #0a1120;
    --color-text-body: #cbd5e1;
    --color-text-headings: #f8fafc;
    --color-border-subtle: #1e293b;
    --color-card-bg: #0f172a;
}

[data-theme="dark"] body {
    background-color: #040e1a !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .main-content,
[data-theme="dark"] #mainContent,
[data-theme="dark"] .page-content-wrapper {
    background-color: #0a1120 !important;
}

[data-theme="dark"] .card,
[data-theme="dark"] .service-card,
[data-theme="dark"] .station-card,
[data-theme="dark"] .contact-form-card,
[data-theme="dark"] .step-item-card {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .form-control {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .preview-safety-banner {
    background: #451a03 !important;
    border-bottom-color: #d97706 !important;
    color: #fef3c7 !important;
}

/* 8. Accessible Focus Rings */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2.5px solid #38bdf8 !important;
    outline-offset: 2px !important;
}


/* 9. Dropdown & Mega Menu Screen Bounds Safeguard */
.mega-menu-panel {
    max-width: min(840px, calc(100vw - 32px)) !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

@media (min-width: 993px) and (max-width: 1280px) {
    .mega-menu-about {
        width: 700px !important;
        max-width: calc(100vw - 36px) !important;
    }
    .dropdown-about .mega-menu-panel {
        left: -80px !important;
        right: auto !important;
    }
    .dropdown-report .mega-menu-panel,
    .dropdown-citizen .mega-menu-panel {
        left: -60px !important;
    }
}


/* 10. Operations Hub Accessible Tabs System (Step 4) */
#muiOperationsHub,
.section-mui-operations {
    scroll-margin-top: 100px;
}

.mui-tabs-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto 28px auto;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 9999px;
    border: 1px solid #cbd5e1;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
    max-width: 980px;
    width: 100%;
    scroll-margin-top: 100px;
}

.mui-tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    min-height: 44px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #334155;
    background: transparent;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    text-decoration: none;
    flex: 1 1 0;
    text-align: center;
}

.mui-tab-btn:hover {
    color: #1976d2;
    background: rgba(255, 255, 255, 0.85);
}

.mui-tab-btn:focus-visible {
    outline: 3px solid #0284c7 !important;
    outline-offset: 2px !important;
}

.mui-tab-btn.active,
.mui-tab-btn[aria-selected="true"] {
    background: #1976d2 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(25, 118, 210, 0.35);
    transform: translateY(-1px);
}

.mui-tab-btn .tab-icon {
    font-size: 1.15rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

/* Panel Animations & Accessibility */
.mui-tab-content {
    display: none !important;
}

.mui-tab-content.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    animation: tabFadeSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tabFadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mui-tab-content:not([hidden]),
    .mui-tab-content.active {
        animation: none !important;
    }
    .mui-tab-btn {
        transition: none !important;
    }
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 992px) {
    .mui-tabs-nav {
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        width: 100%;
        max-width: 100%;
        padding: 6px 8px;
        flex-wrap: nowrap;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-radius: 14px;
    }

    .mui-tabs-nav::-webkit-scrollbar {
        display: none;
    }

    .mui-tab-btn {
        flex: 0 0 auto;
        scroll-snap-align: center;
        padding: 10px 16px;
        font-size: 0.88rem;
    }
}

/* Dark Mode Tokens for Operations Hub Tabs */
[data-theme="dark"] .mui-tabs-nav {
    background: #0f172a !important;
    border-color: #334155 !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .mui-tab-btn {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .mui-tab-btn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .mui-tab-btn.active,
[data-theme="dark"] .mui-tab-btn[aria-selected="true"] {
    background: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5) !important;
}


/* 11. Devanagari Typography & Bilingual Wrapping Rules */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700;800&display=swap');

html[lang="mr"],
html[lang="mr"] body {
    font-family: 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    line-height: 1.6;
    letter-spacing: 0.01em;
}

html[lang="mr"] .nav-link,
html[lang="mr"] .mega-col-title,
html[lang="mr"] .mui-tab-btn,
html[lang="mr"] .btn,
html[lang="mr"] .section-title,
html[lang="mr"] .section-badge,
html[lang="mr"] h1,
html[lang="mr"] h2,
html[lang="mr"] h3,
html[lang="mr"] h4 {
    font-family: 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    word-break: break-word;
    min-width: 0;
}

.mui-tab-btn {
    min-width: 0;
    max-width: 100%;
}
