/* ========================================================
   WELCOME BIHAR - CUSTOM STYLES
   Bilingual, Mobile-First, Modern Government Dashboard
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --wb-primary: #1e3a8a;       /* Deep Bihar Blue */
    --wb-primary-light: #3b82f6;
    --wb-accent: #f59e0b;        /* Saffron Accent */
    --wb-accent-dark: #d97706;
    --wb-success: #10b981;
    --wb-danger: #ef4444;
    --wb-warning: #f59e0b;
    --wb-info: #0ea5e9;
    --wb-bg: #f8fafc;
    --wb-card-bg: #ffffff;
    --wb-text: #1e293b;
    --wb-text-muted: #64748b;
    --wb-border: #e2e8f0;
    --wb-radius: 12px;
    --wb-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --wb-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

html {
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: scroll !important;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--wb-bg);
    color: var(--wb-text);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: visible !important;
    display: flex;
    flex-direction: column;
}


/* ========================================================
   RESPONSIVE SIDEBAR & TOPBAR LAYOUT
   ======================================================== */

.wb-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    overflow-x: hidden;
}

/* Sidebar Styling */
.wb-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #0b1329 0%, #111e38 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1045;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.12);
}

.wb-sidebar-brand {
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wb-sidebar-brand .wb-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.wb-sidebar-brand .role-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.wb-sidebar-nav {
    padding: 1rem 0.75rem;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.wb-nav-header {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    padding: 0.75rem 0.75rem 0.25rem;
}

.wb-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.18s ease;
}

.wb-sidebar-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    color: #94a3b8;
    transition: color 0.18s ease;
}

.wb-sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.wb-sidebar-link:hover i {
    color: #60a5fa;
}

.wb-sidebar-link.active {
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.wb-sidebar-link.active i {
    color: #ffffff;
}

.wb-sidebar-footer {
    padding: 0.9rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wb-sidebar-footer .user-info {
    overflow: hidden;
    line-height: 1.25;
}

.wb-sidebar-footer .user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    display: block;
}

.wb-sidebar-footer .user-role {
    font-size: 0.72rem;
    color: #94a3b8;
}

/* Main Content Area */
.wb-main-wrapper {
    width: calc(100% - 260px);
    max-width: calc(100% - 260px);
    flex-grow: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--wb-bg);
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.wb-main-wrapper.no-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
}

/* Modern Minimal Topbar */
.wb-topbar {
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid var(--wb-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.wb-topbar-toggle {
    background: transparent;
    border: 1px solid var(--wb-border);
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wb-text);
    cursor: pointer;
    transition: all 0.18s ease;
}

.wb-topbar-toggle:hover {
    background: #f1f5f9;
}

/* Mobile Backdrop Overlay */
.wb-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.wb-backdrop.show {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Public Navbar (for non-authenticated pages) */
.wb-public-nav {
    background: linear-gradient(135deg, #0b1329 0%, #1e3a8a 100%);
    padding: 0.85rem 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Responsive Rules & Desktop Collapse */
@media (min-width: 992px) {
    body.sidebar-collapsed .wb-sidebar,
    html.sidebar-collapsed .wb-sidebar {
        transform: translateX(-100%);
    }
    body.sidebar-collapsed .wb-main-wrapper,
    html.sidebar-collapsed .wb-main-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
    }
}

@media (max-width: 991.98px) {
    .wb-sidebar {
        transform: translateX(-100%);
    }
    .wb-sidebar.show {
        transform: translateX(0);
    }
    .wb-main-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
    }
}

/* Compact Single-line Tables & Controls */
.table-single-line th,
.table-single-line td {
    padding: 0.65rem 0.9rem !important;
    vertical-align: middle !important;
    white-space: nowrap;
    font-size: 0.9rem;
}

.card-single-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--wb-border);
}

/* Card Styling */
.wb-card {
    background: var(--wb-card-bg);
    border: 1px solid var(--wb-border);
    border-radius: var(--wb-radius);
    box-shadow: var(--wb-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
}

.wb-card:hover {
    box-shadow: var(--wb-shadow-lg);
}

.wb-card-header {
    background: transparent;
    border-bottom: 1px solid var(--wb-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Metric / Stat Cards */
.stat-card {
    padding: 1.25rem;
    border-radius: var(--wb-radius);
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.stat-card .stat-icon {
    position: absolute;
    right: 15px;
    bottom: 10px;
    font-size: 3.5rem;
    opacity: 0.18;
}

.stat-card .stat-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.stat-card .stat-val {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.4rem 0 0 0;
}

.bg-gradient-blue { background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%); }
.bg-gradient-green { background: linear-gradient(135deg, #065f46 0%, #10b981 100%); }
.bg-gradient-orange { background: linear-gradient(135deg, #9a3412 0%, #f97316 100%); }
.bg-gradient-purple { background: linear-gradient(135deg, #581c87 0%, #8b5cf6 100%); }
.bg-gradient-dark { background: linear-gradient(135deg, #1e293b 0%, #475569 100%); }
.bg-gradient-danger { background: linear-gradient(135deg, #991b1b 0%, #ef4444 100%); }

/* Status Badges */
.badge-status {
    padding: 0.35rem 0.65rem;
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge-pending { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-under_review { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
.badge-approved { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-rejected { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.badge-paid { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-failed { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Passbook Table Direction Colors */
.text-credit { color: #10b981; font-weight: 700; }
.text-debit { color: #ef4444; font-weight: 700; }

/* Timeline Component */
.timeline {
    position: relative;
    padding-left: 2rem;
    margin-top: 1rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: var(--wb-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--wb-primary);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--wb-border);
}

.timeline-content {
    background: #f8fafc;
    border: 1px solid var(--wb-border);
    padding: 0.85rem 1rem;
    border-radius: 8px;
}

/* UPI QR Payment Box */
.qr-payment-box {
    max-width: 480px;
    margin: 2rem auto;
    text-align: center;
    padding: 2rem;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--wb-shadow-lg);
    border: 1px solid var(--wb-border);
}

.qr-image-wrapper {
    position: relative;
    display: inline-block;
    padding: 12px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin: 1.5rem 0;
    border: 1px solid #e2e8f0;
}

.qr-image-wrapper img {
    width: 240px;
    height: 240px;
    display: block;
}

.pulse-border {
    position: absolute;
    top: -4px; left: -4px; right: -4px; bottom: -4px;
    border: 2px dashed var(--wb-primary-light);
    border-radius: 16px;
    animation: pulse 2s infinite linear;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.02); opacity: 0.4; }
    100% { transform: scale(1); opacity: 0.8; }
}

/* Step Wizard Navigation */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.wizard-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.wizard-step .step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    color: var(--wb-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
}

.wizard-step.active .step-circle {
    background: var(--wb-primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.2);
}

.wizard-step.completed .step-circle {
    background: var(--wb-success);
    color: #fff;
}

.wizard-step .step-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--wb-text-muted);
}

.wizard-step.active .step-label {
    color: var(--wb-primary);
    font-weight: 700;
}

/* Footer */
footer {
    margin-top: auto;
    background: #0f172a;
    color: #94a3b8;
    padding: 1.5rem 0;
    font-size: 0.88rem;
    border-top: 1px solid #1e293b;
}

footer a {
    color: #cbd5e1;
    text-decoration: none;
}

footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stat-card .stat-val { font-size: 1.6rem; }
    .wb-card-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

/* ========================================================
   eCyberCafe Parity Styles - Request Cards, Chat & Print
   ======================================================== */
.req-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}
.req-card:hover {
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.08);
}
.req-card-pending {
    border-left: 6px solid #f59e0b !important;
    background: linear-gradient(to right, rgba(245, 158, 11, 0.03), #ffffff 20%);
}
.req-card-in-process {
    border-left: 6px solid #2563eb !important;
    background: linear-gradient(to right, rgba(37, 99, 235, 0.03), #ffffff 20%);
}
.req-card-completed {
    border-left: 6px solid #10b981 !important;
    background: linear-gradient(to right, rgba(16, 185, 129, 0.03), #ffffff 20%);
}
.req-card-rejected {
    border-left: 6px solid #ef4444 !important;
    background: linear-gradient(to right, rgba(239, 68, 68, 0.03), #ffffff 20%);
}

.req-badge-pending { background-color: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.req-badge-in-process { background-color: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.req-badge-completed { background-color: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.req-badge-rejected { background-color: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.timeline-tracker {
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    border: 1px solid #f1f5f9;
}
.timeline-bar-bg {
    height: 8px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
    display: flex;
}
.timeline-bar-fill {
    height: 100%;
    transition: width 0.4s ease;
}

/* Chat Styles */
.chat-window {
    height: 380px;
    overflow-y: auto;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.chat-msg {
    max-width: 80%;
    padding: 0.65rem 0.95rem;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.4;
    word-break: break-word;
}
.chat-msg-sent {
    align-self: flex-end;
    background-color: #2563eb;
    color: #ffffff;
    border-bottom-right-radius: 3px;
}
.chat-msg-recv {
    align-self: flex-start;
    background-color: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 3px;
}
.chat-meta {
    font-size: 0.68rem;
    opacity: 0.75;
    margin-top: 0.25rem;
}

/* Print Receipt Styles */
@media print {
    body * {
        visibility: hidden !important;
    }
    #printReceiptArea, #printReceiptArea * {
        visibility: visible !important;
    }
    #printReceiptArea {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        padding: 20px !important;
        background: #ffffff !important;
    }
    .no-print {
        display: none !important;
    }
}

