/* =========================================================
   GLOBAL DESIGN SYSTEM & THEME
   ========================================================= */
:root {
    --primary-color: #f8fafc;
    /* High contrast text / headings */
    --accent-blue: #2563eb;
    /* Modern tech blue */
    --accent-blue-hover: #1d4ed8;
    /* Darker blue on hover */
    --success-green: #16a34a;
    /* Clean success indicator */
    --danger-red: #dc2626;
    /* Error red */

    /* MODERN DARK SLATE DESIGN SYSTEM: Solid cards against deep canvas */
    --card-bg: #0f172a;
    --text-main: #f8fafc;
    /* High contrast text */
    --text-muted: #94a3b8;
    /* Slate 400 for subtitles and secondary text */
    --border-color: rgba(255, 255, 255, 0.12);
    /* Subtle border tone for cards & inputs */

    --radius: 14px;
    /* Smooth modern rounded corners */
    --shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
    /* Deep crisp shadow */
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #090d16;
    color: var(--text-main);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    box-sizing: border-box;
}

/* =========================================================
   SHARED CONTAINERS & CARDS (Solid Dark Slate Surfaces)
   ========================================================= */
.upload-container,
.container,
.form-card,
.login-container {
    background: #0f172a;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: 100%;
    max-width: 520px;
    box-sizing: border-box;
    margin: 20px auto;
    color: #f8fafc;
}

.container,
.upload-container {
    max-width: 1000px;
    /* Wider for Dashboards */
}

h1,
h2 {
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    margin-top: 0;
    letter-spacing: -0.025em;
}

p.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 14px;
}

/* =========================================================
   COMPANY BRANDING HEADER (Logo & Name)
   ========================================================= */
.brand-header {
    text-align: center;
    margin-bottom: 25px;
}

.brand-logo {
    max-width: 90px;
    /* Controlled responsive width */
    height: auto;
    /* Preserves natural aspect ratio */
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 12px;
}

.brand-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.02em;
    margin: 0;
}

.brand-tagline {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* =========================================================
   FORM CONTROLS & INPUTS
   ========================================================= */
.form-group {
    margin-bottom: 22px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #f8fafc;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
input[type="url"],
input[type="date"],
input[type="file"],
input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background-color: #1e293b;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

select option {
    background-color: #1e293b;
    color: #ffffff;
    padding: 6px 10px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: #0f172a;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

input::-moz-placeholder,
textarea::-moz-placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

.file-upload-box {
    background: #1e293b;
    padding: 20px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    transition: all 0.2s;
    color: #f8fafc;
}

.file-upload-box:hover {
    border-color: var(--accent-blue);
    background: #27354a;
}

/* Disable native browser password reveal icons */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-credentials-auto-fill-button {
    display: none !important;
}

/* Password Toggle Wrapper */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-wrapper input {
    width: 100%;
    padding-right: 44px !important;
    box-sizing: border-box;
}

.toggle-password-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted, #64748b);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    border-radius: 6px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.toggle-password-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    background-color: rgba(0, 0, 0, 0.05) !important;
    box-shadow: none !important;
    transform: translateY(-50%) scale(1.05);
}

.toggle-password-btn:active {
    background: rgba(0, 0, 0, 0.1) !important;
    background-color: rgba(0, 0, 0, 0.1) !important;
    box-shadow: none !important;
    transform: translateY(-50%) scale(0.95);
}

.toggle-password-btn:focus {
    outline: none;
    box-shadow: none !important;
}

/* =========================================================
   BUTTONS
   ========================================================= */
button {
    width: 100%;
    padding: 12px 20px;
    background-color: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

button:hover {
    background-color: var(--accent-blue-hover);
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-success {
    background-color: var(--success-green, #10b981) !important;
    color: white !important;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.25) !important;
}

.btn-success:hover {
    background-color: #059669 !important;
}

/* =========================================================
   TABLES (Dashboards)
   ========================================================= */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 15px;
    background: #0f172a;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

th,
td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
    color: var(--text-main);
}

th {
    background-color: #1e293b;
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.04);
}

tr:last-child td {
    border-bottom: none;
}

/* =========================================================
   UTILITIES & HEADER CONTROLS
   ========================================================= */
.badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid #bfdbfe;
}

.logout-link {
    color: var(--danger-red);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.2s;
}

.logout-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

/* =========================================================
   GLASSMORPHISM EFT & BANKING MODAL STYLES
   ========================================================= */
.glass-eft-card {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5) !important;
    border-radius: 16px !important;
    color: #f8fafc !important;
}

.bank-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px dashed rgba(203, 213, 225, 0.8);
    font-size: 13.5px;
}

.bank-label {
    color: var(--text-muted);
    font-weight: 500;
}

.bank-value {
    color: var(--primary-color);
    font-weight: 700;
}

.bank-value.highlight {
    font-family: monospace;
    font-size: 14.5px;
    letter-spacing: 0.05em;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 3px 8px;
    border-radius: 5px;
    color: var(--accent-blue);
}

/* =========================================================
   FLOATING HELP BUTTON
   ========================================================= */
.help-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 6px;
    width: auto; /* ADD THIS: Stops it from stretching across the screen */
}

/* =========================================================
   MOBILE RESPONSIVENESS & COMPONENT UTILITIES
   ========================================================= */
/* Mobile Header Fix */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

@media (max-width: 600px) {
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    .header-actions {
        justify-content: space-between;
        width: 100%;
        flex-wrap: wrap;
    }
    .header-actions button {
        flex: 1; /* Buttons take equal width on mobile */
        text-align: center;
        justify-content: center;
    }
}

/* True Native App Tab Scrolling */
.tabs-container, .tab-container {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    
    /* Mobile scrolling magic */
    overflow-x: auto;
    flex-wrap: nowrap; /* STRICTLY NO WRAPPING */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.tabs-container::-webkit-scrollbar, .tab-container::-webkit-scrollbar { 
    display: none; /* Hide scrollbar for clean UI in Chrome/Safari */
}

/* --- FALSE EDGE FADE FIX --- */
.tabs-scroll-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 22px;
}

/* We remove the margin from the nav itself because the wrapper handles it now */
.tabs-scroll-wrapper .tabs-container {
    margin-bottom: 0; 
    padding-right: 40px; /* Give it extra padding so the last item can clear the fade */
}

/* The Frosted Glass Fade */
.tabs-scroll-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 45px; /* The width of the blur */
    height: 100%;
    /* Gradient from transparent to frosted white */
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9));
    border-radius: 0 12px 12px 0;
    pointer-events: none; /* CRITICAL: Lets the user tap the buttons underneath the blur */
    z-index: 10;
}

/* Optional: Hide the fade on large desktop screens where scrolling isn't needed */
@media (min-width: 800px) {
    .tabs-scroll-wrapper::after {
        display: none;
    }
}

.tab-btn {
    flex: 0 0 auto; /* Prevent shrinking */
    min-width: max-content; /* Size to text */
    scroll-snap-align: start;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: none;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.85); /* Keep it slightly frosty */
    color: var(--accent-blue);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.15);
}

/* Dark Solid Panel for AI Tools */
.glass-panel {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 20px -2px rgba(0,0,0,0.5);
    color: #f8fafc;
}

/* Pulse Loading Animation */
@keyframes pulse-glow {
    0% { opacity: 0.6; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 0.6; transform: scale(0.98); }
}

.loading-state-active {
    display: inline-block;
    animation: pulse-glow 1.5s infinite ease-in-out;
    background: #eef2ff;
    color: var(--accent-blue);
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid #c7d2fe;
    font-weight: 700;
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .upload-container,
    .container,
    .form-card,
    .login-container {
        padding: 20px; /* Reduces the massive 40px desktop padding */
        margin: 10px auto;
    }
}

/* =========================================================
   QUIZ UI FIXES
   ========================================================= */

/* Solid Dark Quiz Setup Card */
.quiz-setup-card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 5px solid #eab308; /* Keep the yellow accent */
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
    color: #f8fafc;
}

/* Mobile-Friendly Topic Scroll Box */
.topic-scroll-box {
    max-height: 250px; /* Let it breathe */
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 15px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    -webkit-overflow-scrolling: touch;
}

/* Fat-Finger Friendly Checkboxes & Radio Buttons */
.touch-friendly-label {
    display: flex;
    align-items: flex-start; /* Aligns text to top if it wraps */
    gap: 12px;
    margin-bottom: 12px;
    font-size: 15px;
    cursor: pointer;
    padding: 12px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(203, 213, 225, 0.5);
    border-radius: 8px;
    transition: all 0.2s ease;
    text-transform: none;
    color: var(--text-main);
}

.touch-friendly-label:hover, .touch-friendly-label:active {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--accent-blue);
}

.touch-friendly-label input[type="checkbox"], 
.touch-friendly-label input[type="radio"] {
    width: 20px; /* Bigger tap target */
    height: 20px;
    margin-top: 2px; /* aligns perfectly with text */
    cursor: pointer;
    flex-shrink: 0; /* Prevents button from squishing on long text */
}

/* Responsive Button Stack */
.action-btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

@media (max-width: 600px) {
    .action-btn-group {
        grid-template-columns: 1fr; /* Stack vertically on phones */
    }
}

/* Mobile Swipe Hint */
.mobile-swipe-hint {
    display: none; /* Hidden on desktop */
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    margin-bottom: 6px;
    padding-right: 5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mobile-swipe-hint span {
    display: inline-block;
    animation: pulse-horizontal 1.5s infinite;
}

@keyframes pulse-horizontal {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

@media (max-width: 600px) {
    .mobile-swipe-hint {
        display: block; /* Only show on phones */
    }
    
    /* Optional: Add extra padding to the end of the tabs so the last one doesn't stick to the edge */
    .tabs-container {
        padding-right: 30px; 
    }
}

/* =========================================================
   PROFILE DROPDOWN MENU
   ========================================================= */

.glass-pill {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    color: #f8fafc;
}

.profile-menu-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
}

.profile-menu-btn:hover, .profile-menu-btn:active {
    background: white;
    transform: scale(1.05);
}

.profile-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    width: 220px;
    display: none; /* Hidden by default */
    flex-direction: column;
    z-index: 9999;
    padding: 8px;
    animation: dropDownFade 0.2s ease;
}

.profile-dropdown.show {
    display: flex;
}

@keyframes dropDownFade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.profile-dropdown button {
    background: transparent;
    border: none;
    text-align: left;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.profile-dropdown button:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--accent-blue);
}

.profile-dropdown .logout-dropdown-btn {
    color: var(--danger-red);
}

.profile-dropdown .logout-dropdown-btn:hover {
    background: rgba(220, 38, 38, 0.1); /* Light red background on hover */
}

.profile-dropdown hr {
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin: 4px 0;
}

/* =========================================================
   GLASS FAB (FLOATING ACTION BUTTON) & HELP MODAL
   ========================================================= */

/* --- FAB Base --- */
.glass-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  color: var(--accent-blue, #4CA1AF); /* Fallback color provided */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9995;
  transition: transform 0.2s ease, background 0.2s ease;
  pointer-events: auto;
}

.glass-fab svg {
  pointer-events: none;
}

.glass-fab:hover, .glass-fab:active {
  transform: scale(1.05);
  background: #27354f;
}

/* --- Modal Overlay & Container --- */
.glass-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.glass-modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none !important;
}

.glass-modal-content {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  color: #f8fafc;
  /* Prevent virtual keyboard from crushing the modal on mobile */
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
}

/* --- Modal Typography & Inputs --- */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}

.icon-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 8px;
}

.glass-modal-content .form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

.glass-modal-content .form-group label {
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.8);
  text-transform: none;
  letter-spacing: normal;
}

.glass-modal-content .form-group select,
.glass-modal-content .form-group textarea {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 12px;
  color: #fff;
  font-family: inherit;
  font-size: 1rem; /* 16px prevents iOS zoom on focus */
  box-sizing: border-box;
  width: 100%;
}

.glass-modal-content .form-group select option {
  background: #1e293b;
  color: #fff;
}

.glass-modal-content .form-group select:focus,
.glass-modal-content .form-group textarea:focus {
  outline: none;
  border-color: var(--accent-blue, #4CA1AF);
}

.btn-primary {
  width: 100%;
  background: var(--accent-blue, #4CA1AF);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s ease;
}

/* =========================================================
   SHARED MODAL & PAYMENT / EFT STYLES
   ========================================================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: #0f172a;
    width: 100%;
    max-width: 600px;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 20px;
    border: none;
    background: transparent;
    color: var(--danger-red);
    cursor: pointer;
    font-weight: bold;
}

.action-pill-btn {
    width: auto;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    text-decoration: none;
    box-sizing: border-box;
}

.tts-listen-btn, .audio-btn {
    width: auto;
    padding: 6px 12px;
    font-size: 12px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: none;
}

.tts-listen-btn:hover, .audio-btn:hover {
    background: #1d4ed8;
}

.translate-btn {
    background: #8b5cf6 !important;
    color: white !important;
    border: 1px solid #7c3aed !important;
}

.translate-btn:hover {
    background: #7c3aed !important;
}

.download-btn {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
}

.download-btn:hover {
    background: #fee2e2 !important;
}

.glass-eft-card {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5) !important;
    border-radius: 16px !important;
    color: #f8fafc !important;
}

.bank-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px dashed rgba(203, 213, 225, 0.8);
    font-size: 13.5px;
}

.bank-label {
    color: var(--text-muted);
    font-weight: 500;
}

.bank-value {
    color: var(--primary-color);
    font-weight: 700;
}

.bank-value.highlight {
    font-family: monospace;
    font-size: 14.5px;
    letter-spacing: 0.05em;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 3px 8px;
    border-radius: 5px;
    color: var(--accent-blue);
}

/* =========================================================
   GLOBAL MOBILE RESPONSIVENESS (<= 768px and <= 360px)
   ========================================================= */
@media (max-width: 768px) {
    body {
        padding: 12px 10px;
    }

    .upload-container,
    .container,
    .form-card,
    .login-container {
        padding: 24px 18px;
        margin: 10px auto;
        border-radius: 12px;
        max-width: 100%;
    }

    .modal-content {
        padding: 20px 16px;
        max-width: 95vw;
    }

    .brand-title {
        font-size: 20px;
    }

    .brand-logo {
        max-width: 70px;
    }

    .bank-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
}

@media (max-width: 360px) {
    body {
        padding: 8px 6px;
    }

    .upload-container,
    .container,
    .form-card,
    .login-container {
        padding: 18px 12px;
        margin: 6px auto;
        border-radius: 10px;
    }

    .modal-content {
        padding: 16px 12px;
    }

    .brand-title {
        font-size: 18px;
    }

    .brand-tagline {
        font-size: 12px;
    }
}

/* =========================================================
   UNIVERSAL DIAGRAM & PARAMETRIC TABLE PROTECTION
   ========================================================= */
.funda-diagram-container {
    background: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 12px !important;
    padding: 16px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    color: #0f172a !important;
}

.funda-diagram-container svg {
    background: #ffffff !important;
    border-radius: 8px;
}

.funda-diagram-container table {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #0f172a !important;
}

.funda-diagram-container th,
.funda-diagram-container td {
    color: #0f172a !important;
    background: transparent !important;
    border-bottom: 1px solid #cbd5e1 !important;
}

.funda-diagram-container th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

.funda-diagram-container tr:hover td {
    background: transparent !important;
}

/* =========================================================
   GLOBAL BRAND LOCKUP & NAVIGATION TOPBAR UNIFICATION
   ========================================================= */
.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo-badge {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    font-size: 18px;
    font-weight: 800;
    color: #ffffff !important;
    flex-shrink: 0;
    user-select: none;
    letter-spacing: -0.02em;
}

.nav-brand-text h1,
.brand-text-title,
.brand-text h1 {
    font-size: 18px;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, #ffffff 40%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.nav-brand-text p,
.brand-text-sub,
.brand-text p {
    font-size: 10.5px;
    margin: 0;
    color: #60a5fa !important;
    font-weight: 600;
    letter-spacing: 0.05em;
    line-height: 1.2;
}

.app-topbar,
.learner-header {
    background: #090d16 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5) !important;
}


/* Screen-Reader Only Accessible Region (WCAG 2.1 Compliant) */
.sr-only {
    position: fixed;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
    pointer-events: none;
}
