/* 1. RESET & GLOBAL STYLES */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Poppins', sans-serif; 
}

body { 
    background-color: #f4f7f6; 
    color: #333; 
    line-height: 1.6; 
    min-height: 100vh;
}

/* 2. LAYOUT & PANELS (Fixed the "Blank Space" Logic) */
#adminPanel, #marketplaceSection, #studentHero, #howItWorks, 
#studentTabs, #studentDashboard, #teacherDashboard {
    display: none; /* Everything hidden until JS triggers it */
}

/* Force Flex for Admin when shown */
#adminPanel[style*="display: flex"], 
#adminPanel[style*="display: block"] {
    display: flex !important;
    flex-direction: row !important;
}

/* 3. NAVIGATION */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000; /* Increased to ensure it stays above content */
}

.logo { font-size: 24px; font-weight: 700; color: #008080; }
.logo span { color: #FF7F50; }

.login-btn, .logout-btn {
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
    background: transparent;
}

.login-btn { border: 2px solid #008080; color: #008080; }
.login-btn:hover { background: #008080; color: white; }

.logout-btn { border: 2px solid #FF7F50; color: #FF7F50; }
.logout-btn:hover { background: #FF7F50; color: white; }

/* 4. HERO SECTION */
.hero {
    text-align: center;
    padding: 60px 5%;
    background: linear-gradient(135deg, #008080 0%, #005a5a 100%);
    color: white;
}

.search-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

#subjectSearch {
    width: 90%;
    max-width: 500px;
    padding: 15px 25px;
    border-radius: 30px;
    border: none;
    outline: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* 5. UNIFIED TAB SYSTEM (Consolidated) */
.tab-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
}

.t-tab {
    width: 100%;
    padding: 14px 16px;
    border-radius: 10px;
    border: none !important; /* Remove the hard border */
    background: transparent !important; /* Clean background */
    color: #555;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: left;
}

.t-tab:hover {
    background: #f0fdfa !important; /* Soft green highlight */
    color: #006d6d;
}

.t-tab.active {
    background: #e6f4f4 !important; /* Highlighted state */
    color: #006d6d;
    font-weight: 700;
}

/* 6. MODALS & LOGIN SCREEN */
.modal, .login-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal { background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); display: none; }
.login-screen { background: #008080; }

.login-box, .modal-content {
    background: white;
    padding: 40px;
    border-radius: 25px;
    width: 90%;
    max-width: 450px;
    position: relative;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* 7. DASHBOARDS (Teacher/Student/Admin) */
#teacherDashboard, #studentDashboard {
    padding: 20px 5%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* 8. PROFILE IMAGES (Unified) */
.profile-img, #profileImg {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f4f7f6;
    transition: transform 0.3s;
}

.teacher-item:hover .profile-img { transform: scale(1.1); }

/* 9. REGISTRATION & FORMS */
.registration-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

#regAbout, .full-width {
    grid-column: span 2;
    width: 100%;
}

#studentRegModal, #scheduleModal, #reviewModal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100000; /* Absolute top layer */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

#studentRegForm, .modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 95%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* 10. STATUS & ANIMATIONS */
.online-toggle {
    transition: all 0.3s ease;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    background: #28a745;
}

.live-pulse, .dot.online {
    animation: status-pulse 2s infinite;
}

@keyframes status-pulse {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); transform: scale(1); }
    70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); transform: scale(1.05); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); transform: scale(1); }
}

/* 11. MARKETPLACE & TEACHER CARDS */
#teacher-grid, #marketplaceGrid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 20px;
    padding: 20px 0;
    width: 100%;
}

.teacher-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    padding: 16px;
    display: flex !important;
    flex-direction: column !important;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 280px;
    opacity: 1 !important;
}

.teacher-card:hover {
    transform: translateY(-8px);
    border-color: #006d6d;
    box-shadow: 0 15px 30px rgba(0, 109, 109, 0.1) !important;
}

/* 12. CALLS & TIMERS (Fixed z-index fighting) */
#liveTimerSection, #callOverlay, .timer-container {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 999999 !important;
    background: #1a1a1a !important;
    color: white !important;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* 13. DATA TABLES */
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

#teacherTransactionLog td, #teacherTransactionLog th {
    padding: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid #eee;
}

.teacher-tab-content {
    overflow-x: auto;
    width: 100%;
}
/* 14. THE MASTER LAYOUT FIX (Stops the Blank Space) */
html, body { 
    margin: 0; 
    padding: 0; 
    width: 100%; 
    min-height: 100vh;
    background: #f0f4f4;
    overflow-x: hidden;
    overflow-y: auto !important; 
}

/* Force Hide Utility - The only one you need */
.hidden-section {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

/* 15. DASHBOARD BUTTONS (Unified Style) */
.btn-action, .sch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-launch { background: #006d6d; color: white; box-shadow: 0 2px 6px rgba(0, 109, 109, 0.2); }
.btn-done { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.btn-declined, .btn-reject { background: #fff1f0; color: #ff4d4f; border: 1px solid #ffccc7; }

.btn-action:hover { transform: translateY(-2px); filter: brightness(0.95); }

/* 16. SIDEBAR & CONTROL CENTER */
.teacher-control-center, .teacher-app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar-nav, .sidebar {
    width: 260px;
    min-width: 260px;
    background: #ffffff;
    border-right: 1px solid #e0e0e0;
    padding: 20px;
    height: 100vh;
    position: sticky;
    top: 0;
}

/* 17. OVERLAYS & TOASTS (Highest Priority) */
#loginOverlay, #callGuardToast, #filter-loader {
    position: fixed !important;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 200000 !important; 
    display: none; 
    justify-content: center;
    align-items: center;
}

#callGuardToast {
    height: auto;
    width: auto;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4d4f;
    padding: 15px 25px;
    border-radius: 10px;
}

/* 18. STICKY ACTION BAR */
.sticky-action-bar, #landingStickyBar {
    position: fixed !important;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    padding: 15px;
    display: flex;
    gap: 12px;
    box-shadow: 0 -10px 25px rgba(0,0,0,0.1);
    z-index: 1000;
}

/* 19. APPRECIATION & CAT PILLS */
.appreciation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.cat-pill {
    background: #f0f4f4;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    border: 1px solid #cee;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cat-pill:has(input:checked) {
    background: #006d6d;
    color: white;
}
.cat-pill input { display: none; }

/* The container that limits the viewable area */
#storyTrackContainer {
    height: 400px; /* Adjust based on how much space you want to show */
    overflow: hidden;
    position: relative;
}

/* The moving track */
.story-track {
    display: flex;
    flex-direction: column; /* THIS MAKES IT VERTICAL */
    gap: 20px;
    animation: scrollStoriesVertical 20s linear infinite;
}

.story-card {
    width: 100%; /* Take up full width of the box */
    min-height: 120px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

/* Vertical Animation Keyframes */
@keyframes scrollStoriesVertical {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); } /* Assumes you have enough cards to loop */
}

/* Pause on hover so people can read */
.story-track:hover {
    animation-play-state: paused;
}

/* 1. The Main Wrapper (The 'Container') */
#studentSubjectOptions {
    display: block !important; /* Change this from grid to block */
    width: 100% !important;
}

/* 2. The Header (Academic Subjects, etc.) */
.subject-group-header {
    width: 100% !important;
    color: #006d6d !important;
    font-weight: 800 !important;
    font-size: 16px !important;
    margin: 20px 0 10px 0 !important;
    padding-bottom: 5px !important;
    border-bottom: 2px solid #e0f2f2 !important;
    display: block !important;
}

/* 3. THE MAGIC: This targets the grid your JS creates */
.subject-checkbox-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important; /* 3 Columns! */
    gap: 12px !important;
    width: 100% !important;
    margin-bottom: 20px !important;
}

/* 4. The Labels (The selection pills) */
.checkbox-label {
    display: flex !important;
    align-items: center !important;
    background: #ffffff !important;
    padding: 12px !important;
    border: 1px solid #c8e1e1 !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
}

.checkbox-label:hover {
    background: #f0fafa !important;
    border-color: #006d6d !important;
}

/* 5. Checkbox size */
.checkbox-label input[type="checkbox"] {
    margin-right: 10px !important;
    width: 18px !important;
    height: 18px !important;
}
#teacherSubjectOptions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    width: 100%;
}

.subject-group-header {
    grid-column: 1 / -1; /* Makes the header span the full width */
    font-size: 11px;
    font-weight: 800;
    color: #006d6d;
    text-transform: uppercase;
    margin-top: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e0f2f2;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #444;
    cursor: pointer;
    padding: 4px;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: #e6f7f7;
    border-radius: 4px;
}
/* Ensure the modal doesn't have "overflow: hidden" */
#studentRegModal {
    overflow-y: auto !important;
}

/* Ensure the selects are visible */
select {
    position: relative;
    z-index: 10;
}
/* Premium Login Overlay Styles */
#loginOverlay {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px); /* Modern blur effect */
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    text-align: center;
    position: relative;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.login-card h2 {
    color: #006d6d;
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 800;
}

.login-card p {
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

/* Custom Input Styling */
.input-group {
    display: flex;
    align-items: center;
    background: #f4f7f6;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 5px 15px;
    margin-bottom: 20px;
    transition: 0.3s;
}

.input-group:focus-within {
    border-color: #006d6d;
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 109, 109, 0.1);
}

.input-group span {
    font-weight: bold;
    color: #006d6d;
    margin-right: 10px;
}

.input-group input {
    border: none;
    background: transparent;
    padding: 12px 0;
    width: 100%;
    font-size: 16px;
    outline: none;
    letter-spacing: 1px;
}

/* Modern Role Selector */
/* Container for the tabs */
.role-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    padding: 5px;
    background: #f1f3f2; /* Light grey track background */
    border-radius: 16px;
}

.role-option {
    flex: 1;
    position: relative;
}

/* Hide the actual radio circle */
.role-option input {
    position: absolute;
    opacity: 0;
}

/* Default Style (Inactive Tab) */
.role-label {
    display: block;
    padding: 12px;
    background: transparent; /* Shows the grey track underneath */
    border-radius: 12px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    text-align: center;
}

/* Hover Effect for Inactive Tabs */
.role-label:hover {
    background: rgba(0, 109, 109, 0.05);
    color: #006d6d;
}

/* Active State (Checked Tab) */
.role-option input:checked + .role-label {
    background: white; /* Lifted look */
    color: #006d6d;
    border-color: #e0e6e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Adds depth */
}

/* Add an icon or dot for the active state (Optional Polish) */
.role-option input:checked + .role-label::before {
    content: "●";
    margin-right: 6px;
    font-size: 10px;
    vertical-align: middle;
}
/* Default state for all buttons */
.role-btn {
    color: #666;
    background: transparent;
}

/* Hover effect for buttons that aren't active */
.role-btn:hover {
    color: #006d6d;
}

/* The magic 'Active' state */
/* We target the div that comes right after a checked radio input */
input[type="radio"]:checked + .role-btn {
    background: white !important;
    color: #006d6d !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* Specific styling for Admin when checked */
input[type="radio"][value="admin"]:checked + .role-btn {
    color: #d9534f !important;
    border: 1px solid rgba(217, 83, 79, 0.2);
}
#teacher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px;
}

.teacher-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 320px; /* Forces uniform height */
    position: relative;
}

.teacher-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.avatar-wrapper img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #eee;
    margin-bottom: 10px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    border-top: 1px solid #f9f9f9;
    padding-top: 15px;
}

.action-btn {
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 13px;
}
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.profile-main-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 30px;
}

/* Ensure the sticky sidebar stays fixed while scrolling bio */
@media (min-width: 801px) {
    .profile-sidebar-sticky {
        position: sticky;
        top: 20px;
    }
}
#teacherProfile {
    position: relative;
    z-index: 999;
    width: 100%;
}

.teacher-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
/* The switch - the box around the slider */
.switch {
  position: relative;
  display: inline-block;
  width: 40px; /* Slightly wider for better look */
  height: 20px;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* 1. The base background of the toggle */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

/* 2. Creating the white "knob" circle */
.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 3. Change background color when ON */
input:checked + .slider {
    background-color: #008080;
}

/* 4. Slide the knob to the right when ON */
input:checked + .slider:before {
    transform: translateX(20px);
}
#dashDisplaySubject {
    display: block;
    max-height: 80px;
    overflow-y: auto;
    font-size: 11px;
    line-height: 1.4;
    padding-right: 5px;
}
/* Add this to your style section */
#dashDisplayClass {
    white-space: normal;      /* Allows text to wrap */
    word-break: break-word;   /* Prevents long words from breaking layout */
    display: block;
    min-height: 40px;
}
#dashDisplayClass {
    white-space: normal !important;
    word-break: break-word;
    display: block;
    line-height: 1.4;
}
/* Add this to your CSS */
#studentApp {
    display: none; /* Default */
    position: relative !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 99 !important;
    background: white !important;
}

#view-dash {
    min-height: 500px !important;
    width: 100% !important;
    background: #f4f7f6 !important; /* Light grey so you can see it */
    display: none; 
}
#teacherRegistrationModal {
    z-index: 10001 !important; /* One higher than everything else */
    background-color: white;   /* Ensure it's not transparent */
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
/* Find the container that holds the Teacher's Full Profile details */
#teacherProfileContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: white;
    z-index: 5000; /* Lower than the modal, higher than the main app */
    overflow-y: auto;
}

.teacher-profile-detail-container { 
    position: fixed; /* Takes it out of the normal flow */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: white; /* Or the #f4f7f7 you're using */
    z-index: 5000; /* Higher than the marketplace, lower than the modal */
    overflow-y: auto; /* Lets you scroll if the profile is long */
}

/* Add this class to your Profile Detail view container */
.profile-overlay-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: white;
    z-index: 1000; /* Lower than the modal, higher than the marketplace */
    overflow-y: auto;
}
#teacherModal {
    position: fixed; /* Fixes it to the viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 5000; /* High enough to cover the marketplace */
    background: #f4f7f7; 
    overflow-y: auto; /* Allows scrolling inside the profile if it's long */
}

/* Ensure your Schedule Modal is even higher */
#scheduleModal {
    position: fixed;
    z-index: 10000; 
}
/* Add this to your <style> or solvenow.css to support Part 6 */
#adminPanel aside {
    flex-shrink: 0; /* Prevents the sidebar from getting narrow */
}
.admin-view {
    animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Force visibility when in teacher mode */
body.teacher-mode #teacherApp,
body.teacher-mode #teacherDashboard,
body.teacher-mode #realDashboardContent {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure nothing is covering it */
body.teacher-mode #view-market-landing,
body.teacher-mode #loginOverlay {
    display: none !important;
}   
/* Ensure the Teacher App doesn't grow longer than the screen */
#teacherApp {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevents the "two page" scroll */
}

/* Allow ONLY the dashboard content to scroll if needed */
#teacherDashboard {
    flex: 1;
    overflow-y: auto; 
    padding: 20px;
    background: #f4f7f7;
}


/* Prevent the double-page scroll */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
}

/* Ensure all main containers start at the top of the screen */
#view-market-landing, 
#teacherApp, 
#studentApp, 
#teacherOnboarding, 
#adminPanel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
}
#adminTeacherTable tr:hover {
    background-color: #f1f8f8 !important;
    transition: 0.2s;
}
/* Add this to your style section */
#studentSubjectsList {
    max-height: 250px; 
    overflow-y: auto;
    padding-right: 5px;
}
/* Style the scrollbar to keep it thin */
#studentSubjectsList::-webkit-scrollbar {
    width: 4px;
}
#studentSubjectsList::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}
/* Add this to your <style> section */
#upcomingBookingsList {
    max-height: 500px; /* Adjust this height as needed */
    overflow-y: auto;  /* This enables the vertical scrollbar */
    padding-right: 5px;
}

/* Optional: Make the scrollbar look cleaner */
#upcomingBookingsList::-webkit-scrollbar {
    width: 6px;
}
#upcomingBookingsList::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
}
/* This targets the container holding your buttons */
.dash-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    
    /* 1. Define a height so the browser knows when to start scrolling */
    max-height: calc(100vh - 250px); /* Adjust 250px based on the size of your profile header */
    
    /* 2. Force the scrollbar to appear */
    overflow-y: auto !important; 
    overflow-x: hidden;
    
    /* 3. Ensure it doesn't shrink */
    flex-shrink: 0;
    padding-bottom: 20px; /* Gives extra room at the bottom */
}

/* Ensure the main sidebar wrapper isn't cutting things off */
.teacher-sidebar-wrapper {
    height: 100%;
    overflow: visible !important;
}
/* Update your modal body style */
#teacherRegistrationModal .modal-content {
    max-height: 90vh; /* Keeps it within the screen */
    display: flex;
    flex-direction: column;
}

#teacherRegistrationModal .modal-body {
    overflow-y: auto; /* Allows internal scrolling */
    min-height: 500px; /* Adjust based on your average tab height */
    padding-bottom: 20px;
}
#teacherRegistrationModal .modal-body {
    min-height: 600px; /* Adjust this to the average height of your form */
    max-height: 80vh;
    overflow-y: auto;
    scroll-behavior: auto !important; /* Prevents "sliding" jumps */
}

/* Ensure the container is always ready to display */
#studentJoinSection {
    display: none; /* Keep it hidden by default */
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 10000;
}

/* Pulse animation for the IN-PROGRESS badge */
    @keyframes pulse {
        0% { opacity: 1; transform: scale(1); }
        50% { opacity: 0.7; transform: scale(0.98); }
        100% { opacity: 1; transform: scale(1); }
    }

/* Style for the monospace timer to prevent table jumping */
    #queueLiveTimer {
        font-variant-numeric: tabular-nums;
        letter-spacing: 1px;
        background: #fff1f0;
        padding: 2px 6px;
        border-radius: 4px;
        border: 1px solid #ffa39e;
    }
.teacher-tab-content {
    height: auto;
    max-height: calc(100vh - 180px); /* Adjusts based on your header height */
    overflow-y: auto !important;
    padding-bottom: 40px;
}
#subjectBreakdownContainer::-webkit-scrollbar {
    width: 6px;
}
#subjectBreakdownContainer::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
#subjectBreakdownContainer::-webkit-scrollbar-thumb {
    background: #006d6d;
    border-radius: 10px;
}
#subjectBreakdownContainer::-webkit-scrollbar-thumb:hover {
    background: #004d4d;
}

    /* Add this to your CSS or inside a <style> tag */
    .booked-sub-view {
        max-height: 500px; /* Adjust height as needed */
        overflow-y: auto;
        border: 1px solid #eee;
        border-radius: 8px;
        position: relative;
    }

    /* Keep headers at the top while scrolling */
    .booked-sub-view table thead th {
        position: sticky;
        top: 0;
        background: #f8f9fa;
        z-index: 10;
        box-shadow: 0 2px 2px -1px rgba(0,0,0,0.1);
    }
/* Update the div containing the expertise list */
.expertise-box {
    max-height: 80px;            /* Limit height to keep row clean */
    overflow-y: auto;           /* Enable vertical scroll only when needed */
    padding-right: 5px;
    scrollbar-width: thin;      /* Makes scrollbar less bulky in Firefox */
    scrollbar-color: #008080 #f0f0f0;
}

/* Custom Scrollbar for Chrome/Edge/Safari */
.expertise-box::-webkit-scrollbar {
    width: 4px;
}
.expertise-box::-webkit-scrollbar-thumb {
    background: #008080;
    border-radius: 10px;
}
.expertise-box::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.live-indicator-dot {
    height: 10px;
    width: 10px;
    background-color: #00ff88;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(0, 255, 136, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}
#walletTableBody td {
    word-wrap: break-word; /* 🎯 Prevents long text from breaking the table */
    max-width: 0; /* 🎯 Magic fix to force percentages to hold */
}

#walletTableBody td:nth-child(2) {
    max-width: 300px; /* 🎯 Limits description width on smaller screens */
}
#walletTableBody tr:hover {
    background-color: #fafafa;
    transition: background 0.2s ease;
}

<style>
    /* Make table headers stand out more */
    #view-dash th {
        font-size: 12px !important;
        letter-spacing: 1px;
        color: #006d6d !important;
        padding-bottom: 15px !important;
    }
    
    /* Improve Sidebar button readability */
    .side-nav-btn {
        font-size: 15px !important;
        padding: 12px 20px !important;
        margin-bottom: 8px !important;
    }
</style>

/* Force the main container to take up space */
#view-booked {
    position: relative !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
    background: white !important;
}

.booked-sub-view {
    position: relative !important;
    z-index: 10000 !important;
}

/* Ensure text is not transparent */
#pastBookedTable td {
    color: #000 !important;
    background: #fff !important;
}

/* Fix for the gray bar issue */
#upcomingBookedTable, #pastBookedTable {
    min-height: 100px;
}
.admin-view {
    display: block !important;
    width: 100% !important;
    min-height: 400px !important;
    background: white !important;
    overflow: visible !important;
}

/* 🔧 FIX: .booked-sub-view was sharing the rule above, whose
   `overflow: visible !important` canceled out the earlier
   `.booked-sub-view { overflow-y: auto; max-height: 500px; }` rule —
   that's why Upcoming/Past booking tables never scrolled. */
.booked-sub-view {
    display: block !important;
    width: 100% !important;
    min-height: 400px !important;
    background: white !important;
    max-height: 500px !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
}

table {
    width: 100% !important;
    border-collapse: collapse !important;
    min-height: 100px !important;
}

td, th {
    padding: 15px !important;
    border-bottom: 1px solid #eee !important;
}
#upcomingBookedTable, #pastBookedTable {
    display: table-row-group !important;
    width: 100% !important;
}

#upcomingBookedTable tr {
    display: table-row !important;
    visibility: visible !important;
}
#admin-dashboard-root {
    display: flex !important;
    width: 100vw;
    height: 100vh;
}

#adminPanel {
    display: flex !important;
    width: 100%;
}

.admin-main-content {
    flex: 1;
    margin-left: 260px; /* Adjust this to match your sidebar width */
    padding: 20px;
    background: #f9f9f9;
}
.admin-view {
    min-height: 80vh; /* Keeps the page from collapsing to 0px */
}

/* Optional: Subtle animation for the data appearing */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#teacherLeaderboardContainer, #subjectPieChart {
    animation: fadeIn 0.4s ease-out;
}
/* Container padding and background */
#view-analytics {
    background-color: #f8f9fa; /* Light grey background makes white cards pop */
    padding: 30px;
}

/* Card titles */
h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
    letter-spacing: -0.5px;
}

/* Table styling in Leaderboard */
#teacherLeaderboardContainer table tr:hover {
    background-color: #fcfcfc;
    transition: 0.2s;
}
/* 1. Ensure the app container takes up full width */
#teacherApp, #realDashboardContent {
    width: 100% !important;
    max-width: none !important; /* This cancels out the 1200px rule */
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

/* 2. Fix the flex container to fill the screen */
#realDashboardContent > div:last-child {
    display: flex;
    width: 100% !important;
    height: calc(100vh - 70px);
}

/* 3. Ensure the Sidebar and Dashboard Body behave correctly */
#sidebar {
    flex: 0 0 300px; /* Slightly wider is okay for a sidebar */
    background: #ffffff;
    border-right: 1px solid #eef2f2; /* Softer border color */
    padding: 30px 20px; /* More top/bottom space */
    overflow-y: auto;
}

#teacherIdentityCard {
    /* Layout & Shape */
    padding: 25px;              /* Slightly increased for more breathing room */
    border-radius: 16px;        
    margin-bottom: 30px; 
    
    /* Visual Depth */
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05); /* Softer, wider spread */
    border: 1px solid #f0f0f0;  /* Subtle border to keep it crisp against the sidebar background */
    
    /* Content Alignment */
    text-align: center;
    position: relative;
    transition: transform 0.2s ease;
}

#teacherDashboardBody {
    flex: 1; /* This forces the dashboard body to fill all empty space */
}
#aiTeacherWidget {
    display: block !important;
}
#aiTeacherPanel {
    display: flex !important;
}
/* Ensure the parent container is ready for the iframe */
/* Ensure the parent container has a limit */
#view-aiTutor {
    display: none;
    width: 95%;
    margin: 0 auto;
    /* Use vh (viewport height) to give it room based on the screen, not fixed pixels */
    min-height: 550px; 
    height: 70vh; 
    overflow: hidden;
    box-sizing: border-box;
}

#aiTutorIframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 15px;
    display: block;
    /* This ensures the iframe itself can scroll internally */
    overflow-y: auto; 
}
/* Look for the parent of #view-aiTutor */
.parent-container-class {
    display: flex;
    flex-direction: column;
    align-items: center; /* This forces the child to center and respect width */
    width: 100%;
}
/* Ensure table text is dark and readable */
#adminWithdrawalBody tr {
    color: #333 !important; /* Darker grey/black for better contrast */
}

#adminWithdrawalBody .user-name {
    color: #000 !important; /* Bold black for the student name */
    font-weight: 600;
}

#adminWithdrawalBody .user-id {
    color: #555 !important; /* Slightly lighter but still readable */
}

/* Ensure currency and amounts pop out */
#adminWithdrawalBody td {
    color: #2c3e50 !important;
    font-weight: 500;
}
/* ==========================================================================
   FORM SIZE & PILL VISIBILITY IMPROVEMENTS (EXPERTS & STUDENTS)
   ========================================================================== */

/* 1. Make the Teacher Registration Form width match the Student Form */
#teacherRegistrationModal .modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 95%;
    max-width: 450px; /* Aligned exactly with student modal sizing */
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* 2. Completely Overhauled Interactive Category Pills */
.cat-pill {
    background: #f0fdfa; /* Changed from gray to a crisp light-teal background */
    color: #006d6d;      /* Deep professional teal text color by default */
    padding: 10px 16px;
    border-radius: 20px;
    cursor: pointer;
    border: 1px solid #b2dfdf; /* Matching clean theme border */
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 5px rgba(0, 109, 109, 0.05);
}

/* Subtle hover feedback for unselected category items */
.cat-pill:hover {
    background: #e6f4f4;
    transform: translateY(-1px);
    border-color: #006d6d;
}

/* 3. High-Contrast Active State (When Checked) */
.cat-pill:has(input:checked) {
    background: #006d6d !important; /* Solid vibrant brand teal color background */
    color: white !important;          /* Clear white text */
    border-color: #005a5a !important;
    box-shadow: 0 4px 12px rgba(0, 109, 109, 0.25);
}

/* 4. Support for the alternative structural wrappers (*Polishing fallback rules) */
input[type="checkbox"]:checked + .role-btn,
#categoryPicker .cat-pill:has(input:checked),
#teacherCategoryPicker .cat-pill:has(input:checked) {
    background: #006d6d !important;
    color: white !important;
}
/* ==========================================================================
   SOLVENOW — VISIBILITY FIX PATCH
   ADD THIS AT THE VERY BOTTOM OF YOUR EXISTING CSS BLOCK
   Date: 2026-06-25
   ========================================================================== */

/* ------------------------------------------------------------------
   FIX 1: LANDING PAGE — "Real Stories" card text invisible on white
   The story cards use very light grey text that vanishes on white bg
   ------------------------------------------------------------------ */

/* Story card quote text */
.story-card,
.story-card p,
.story-card .quote-text,
.story-card span:not(.live-indicator-dot) {
    color: #2c2c2c !important;
}

/* Story card attribution line (— Manier S. Class 10) */
.story-card .attribution,
.story-card em,
.story-card small {
    color: #555 !important;
    font-style: italic;
}

/* The live activity ticker at the bottom of the stories panel 
   "● Arjun is helping with Calculus..." */
#storyTrackContainer ~ p,
#storyTrackContainer + *,
.landing-live-ticker,
[id*="liveTicker"],
[id*="activityTicker"] {
    color: #333 !important;
}

/* General fix: ANY text inside the Real Stories white card box */
/* Target the white card panel on the right side of landing */
#storiesPanel,
#realStoriesCard,
[id*="stories"],
[class*="stories-panel"],
[class*="story-panel"] {
    color: #2c2c2c !important;
}

/* Catch-all for any light-colored text sitting on a white background
   on the landing page hero area */
#view-market-landing .story-card *,
#landingPage .story-card *,
#heroSection .story-card * {
    color: #333 !important;
}


/* ------------------------------------------------------------------
   FIX 2: MARKETPLACE / STUDENT DASHBOARD — Teacher card names faded
   Teacher names (SHILPA G, URVASHI L, SAMPREET O) are very light
   They appear to use color: #ccc or similar on white card background
   ------------------------------------------------------------------ */

/* Teacher name inside card — the big bold text showing teacher's name */
.teacher-card .teacher-name,
.teacher-card h3,
.teacher-card h4,
.teacher-card [class*="name"],
.teacher-card > div > strong,
.teacher-card > div > b {
    color: #1a1a1a !important;
}

/* Qualification line (MSC HOME SCIENCE B.ED / BCOM etc.) */
.teacher-card .teacher-qualification,
.teacher-card .qualification,
.teacher-card [class*="qual"],
.teacher-card p:first-of-type {
    color: #006d6d !important;  /* your teal brand colour — matches what looks correct */
    font-weight: 600 !important;
}

/* Subject list inside teacher card (10: Mathematics, English | 11: ...) */
.teacher-card .subject-list,
.teacher-card .subjects,
.teacher-card [class*="subject"],
.teacher-card p:not(:first-of-type) {
    color: #444 !important;
}

/* "+4 more" / "+2 more" links */
.teacher-card a,
.teacher-card [class*="more"] {
    color: #006d6d !important;
}

/* Rate display (₹12/min etc.) — make it bold and dark */
.teacher-card .rate,
.teacher-card [class*="rate"],
.teacher-card [class*="price"] {
    color: #1a1a1a !important;
    font-weight: 700 !important;
}

/* OFFLINE badge — currently barely visible grey pill */
.teacher-card .status-badge,
.teacher-card [class*="status"],
.teacher-card [class*="badge"] {
    font-weight: 700 !important;
}

/* Specifically the OFFLINE grey pill — ensure text is readable */
.teacher-card .offline-badge,
[class*="offline"] {
    background: #e8e8e8 !important;
    color: #555 !important;
    font-weight: 700 !important;
}

/* ONLINE green pill */
.teacher-card .online-badge,
[class*="online-badge"] {
    background: #e6f9f0 !important;
    color: #1a7a4a !important;
    font-weight: 700 !important;
}


/* ------------------------------------------------------------------
   FIX 3: STUDENT SIDEBAR — any light text on white sidebar bg
   ------------------------------------------------------------------ */

/* Welcome name text */
#studentApp .sidebar h2,
#studentApp .sidebar [class*="welcome"],
#studentApp .sidebar [class*="name"] {
    color: #1a1a1a !important;
}

/* Class label "Class: 10" */
#studentApp .sidebar [class*="class"],
#studentApp .sidebar p {
    color: #333 !important;
}

/* Section headers: TARGET LEVELS, ACADEMIC, LANGUAGES */
#studentApp .sidebar [class*="section-label"],
#studentApp .sidebar [class*="category-label"],
#studentApp .sidebar small,
#studentApp .sidebar span[style*="color:#"] {
    color: #555 !important;
}

/* Subject pills (Mathematics, Science, Social Science) 
   Currently look OK based on screenshot but adding safety net */
#studentApp .sidebar .subject-pill,
#studentApp .sidebar [class*="pill"]:not(.cat-pill) {
    color: #006d6d !important;
    border-color: #b2dfdf !important;
}


/* ------------------------------------------------------------------
   FIX 4: GLOBAL SAFETY NET
   Catch any remaining light-on-white text anywhere in the app
   (only targets obviously-too-light values, not intentional muted text)
   ------------------------------------------------------------------ */

/* Targets inline style color values that are too light for white bg */
[style*="color: #ccc"],
[style*="color:#ccc"],
[style*="color: #ddd"],
[style*="color:#ddd"],
[style*="color: #eee"],
[style*="color:#eee"],
[style*="color: lightgray"],
[style*="color: #bbb"],
[style*="color:#bbb"],
[style*="color: #aaa"],
[style*="color:#aaa"],
[style*="color: #999"],
[style*="color:#999"],
[style*="color: #888"],
[style*="color:#888"],
[style*="color: rgba(0,0,0,0.1)"],
[style*="color: rgba(0,0,0,0.15)"],
[style*="color: rgba(0,0,0,0.2)"] {
    color: #555 !important;
}

/* ==========================================================================
   END OF VISIBILITY FIX PATCH
   ========================================================================== */

   /* ── Teacher Registration Form — White Background Fix ─────── */

/* SELECT STREAM dropdown */
#teacherApp select,
#teacherOnboarding select,
.teacher-reg select {
    color: #1a1a1a !important;
    background: #ffffff !important;
}

/* SELECT STREAM label */
#teacherApp label,
#teacherOnboarding label,
.teacher-reg label {
    color: #2c3e50 !important;
}

/* Target Student Level checkboxes — labels invisible */
#teacherApp .level-option label,
#teacherApp input[name="tSkillLevel"] + label,
#teacherOnboarding .level-option label {
    color: #2c3e50 !important;
}

/* All checkbox/radio text in teacher forms */
#teacherApp .checkbox-label,
#teacherApp .radio-label,
#teacherApp .form-check-label {
    color: #2c3e50 !important;
}

/* File upload — filename not visible */
#teacherApp input[type="file"] + span,
#teacherApp .file-name,
#teacherApp .upload-filename,
#tPhotoInput + span,
#tPhotoInput ~ * {
    color: #2c3e50 !important;
}

/* General form inputs in teacher section */
#teacherApp input[type="text"],
#teacherApp input[type="email"],
#teacherApp input[type="tel"],
#teacherApp input[type="number"],
#teacherApp textarea {
    color: #1a1a1a !important;
    background: #ffffff !important;
}

/* Section headers */
#teacherApp .section-label,
#teacherApp h3,
#teacherApp h4,
#teacherApp p {
    color: #2c3e50 !important;
}
/* Tax Summary Table Override */
#taxSummaryContainer th {
    background: #ffffff !important;
    color: #7f8c8d !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 10px !important;
}

#taxSummaryContainer td {
    padding: 10px !important;
    color: #2c3e50 !important;
}
/* Admin sidebar scroll */
aside nav::-webkit-scrollbar {
    width: 4px;
}
aside nav::-webkit-scrollbar-track {
    background: #1a252f;
}
aside nav::-webkit-scrollbar-thumb {
    background: #34495e;
    border-radius: 4px;
}
aside nav::-webkit-scrollbar-thumb:hover {
    background: #4a6278;
}
/* ============================================================
   MOBILE RESPONSIVE PATCH — Student-Facing Pages
   Targets: Landing page, Login modal, Marketplace, Student Dashboard
   Purely additive — only activates on narrow viewports, does not
   alter desktop layout.
   ============================================================ */

@media (max-width: 900px) {

    /* ── LANDING PAGE: Hero stacks vertically ── */
    #view-market-landing > div[style*="display: flex; flex: 1"] {
        flex-direction: column !important;
        padding: 20px !important;
        gap: 20px !important;
    }

    #view-market-landing h1 {
        font-size: 30px !important;
        line-height: 1.2 !important;
    }

    #view-market-landing p {
        font-size: 15px !important;
    }

    /* ── LANDING PAGE: Feature cards (💬 📞 💰) stack ── */
    #view-market-landing div[style*="max-width: 750px"] {
        flex-direction: column !important;
        max-width: 100% !important;
    }

    /* ── LANDING PAGE: Story card panel gets full width, shorter ── */
    #view-market-landing > div[style*="display: flex; flex: 1"] > div:last-child {
        height: 260px !important;
        width: 100% !important;
    }

    /* ── LANDING PAGE: Navbar tightens up ── */
    nav[style*="padding: 12px 40px"] {
        padding: 10px 16px !important;
        flex-wrap: wrap;
        gap: 8px;
    }

    nav[style*="padding: 12px 40px"] .logo span {
        font-size: 18px !important;
    }

    /* ── LANDING PAGE: Sticky bottom action bar tightens padding ── */
    #landingStickyBar {
        padding: 10px 10px 20px !important;
        gap: 10px !important;
    }

    #landingStickyBar button {
        height: 52px !important;
        font-size: 14px !important;
    }
}

@media (max-width: 640px) {

    /* ── LOGIN MODAL: full-width, less padding on small phones ── */
    #loginOverlay .login-box,
    #loginOverlay > div {
        padding: 24px 20px !important;
        width: 92% !important;
    }

    /* ── STUDENT DASHBOARD: sidebar stacks above main content
       and drops sticky positioning (sticky + wrap was causing
       the profile card to overlap content beneath it) ── */
    #studentApprovedContent > div[style*="align-items: flex-start"] {
        flex-direction: column !important;
    }

    #studentApprovedContent > div[style*="align-items: flex-start"] > div:first-child {
        flex: 1 1 100% !important;
        width: 100% !important;
        position: relative !important;
        top: 0 !important;
    }

    #studentApprovedContent > div[style*="align-items: flex-start"] > div:last-child {
        flex: 1 1 100% !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    /* ── STUDENT DASHBOARD: top wallet/balance bar wraps cleanly ── */
    #view-welcome ~ div[style*="justify-content: space-between"],
    #studentApprovedContent div[style*="padding: 15px 25px"] {
        flex-wrap: wrap !important;
        gap: 12px !important;
    }

    /* ── ALL TABLES: force horizontal scroll instead of page overflow ── */
    #view-dash table,
    #section-wallet table,
    #section-bookings table,
    #section-callRecords table {
        min-width: 600px;
    }

    #section-wallet > div,
    .dash-section table,
    #walletPanel-transactions,
    #walletPanel-withdrawals {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* ── MARKETPLACE: single column on narrow phones ── */
    #teacher-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        padding: 10px !important;
    }

    /* ── TEACHER PROFILE MODAL: single column, not side-by-side ── */
    .profile-main-grid {
        grid-template-columns: 1fr !important;
    }

    /* ── GENERAL: shrink oversized headings app-wide on phones ── */
    h1 { font-size: 26px !important; }
    h2 { font-size: 20px !important; }
}

@media (max-width: 400px) {

    /* ── Extra-narrow phones: tighten further ── */
    #view-market-landing h1 {
        font-size: 24px !important;
    }

    #landingStickyBar button {
        font-size: 12px !important;
        height: 48px !important;
    }
}

/* ============================================================
   MOBILE PATCH #2 — Bookings / Call Records / Wallet Tables
   Fixes: table columns being crushed/clipped on narrow screens.
   Lets tables size to their real content and scroll horizontally
   instead of squeezing every column into a tiny fixed percentage.
   ============================================================ */

@media (max-width: 640px) {

    /* ── Let these specific tables size naturally instead of
       being locked to table-layout: fixed (which was crushing
       columns on narrow screens) ── */
    #sub-view-upcoming table,
    #sub-view-past table,
    #walletPanel-transactions table,
    #walletPanel-withdrawals table,
    #section-callRecords table {
        table-layout: auto !important;
        min-width: 560px; /* forces horizontal scroll instead of squeezing */
    }

    /* ── Ensure the scroll containers actually allow sideways
       scrolling (some only had overflow-y set) ── */
    #walletPanel-transactions > div,
    #walletPanel-withdrawals > div,
    #section-callRecords > div > div[style*="overflow-x"] {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* ── Shrink table text so more fits before scrolling is needed ── */
    #sub-view-upcoming table th, #sub-view-upcoming table td,
    #sub-view-past table th, #sub-view-past table td,
    #walletPanel-transactions table th, #walletPanel-transactions table td,
    #walletPanel-withdrawals table th, #walletPanel-withdrawals table td,
    #section-callRecords table th, #section-callRecords table td {
        font-size: 12px !important;
        padding: 8px 6px !important;
        white-space: nowrap;
    }

    /* Allow subject/topic/description text to wrap instead of
       forcing the whole row wider than necessary */
    #sub-view-upcoming table td:nth-child(3),
    #sub-view-past table td:nth-child(3),
    #walletPanel-transactions table td:nth-child(2) {
        white-space: normal !important;
    }

    /* ── Summary card rows (Total Sessions / Duration / Value,
       Total Spent + Withdraw button) — stack instead of
       squeezing 3 flex items into a 375px screen ── */
    #section-bookings > div[style*="display: flex; gap: 15px"],
    #section-wallet > div[style*="justify-content: space-between"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    #section-bookings > div[style*="display: flex; gap: 15px"] > div {
        width: 100% !important;
    }

    /* ── Reduce dashboard-card padding to reclaim space on phones ── */
    .dashboard-card {
        padding: 15px !important;
    }

    /* ── Search inputs (booking/wallet/call search boxes) full width ── */
    #bookingSearchInput,
    #callRecordSearch,
    #earningSearchInput {
        width: 100% !important;
        box-sizing: border-box;
    }
}

/* ============================================================
   MOBILE PATCH #3 — Live Timer vs Video Frame z-index conflict
   Fixes: timer box getting half-covered by the video frame on
   mobile, because both shared the same z-index (999999) and the
   video container sits later in the DOM, so it wins ties.
   ============================================================ */

@media (max-width: 640px) {

    #liveTimerSection {
        /* Higher than the video's forced z-index (999999) so the
           timer always renders on top, regardless of DOM order */
        z-index: 9999999 !important;
        /* Reposition to top-right corner on mobile — bottom-right
           was the spot most likely to sit inside the video box */
        top: 10px !important;
        right: 10px !important;
        bottom: auto !important;
        left: auto !important;
        min-width: 110px !important;
        padding: 8px 10px !important;
    }

    #liveTimerSection #liveClock {
        font-size: 20px !important;
    }

    #liveTimerSection #liveCost {
        font-size: 11px !important;
        margin-bottom: 6px !important;
    }

    #liveTimerSection #liveTimerDisplay {
        font-size: 9px !important;
    }

    #liveTimerSection button {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }
}

/* ============================================================
   MOBILE PATCH #4 — Teacher Dashboard
   Fixes: fixed-width sidebar sitting beside content instead of
   stacking, sticky positioning causing overlap once stacked,
   analytics grids not stacking, tables/search boxes overflowing.
   ============================================================ */

@media (max-width: 640px) {

    /* ── Header bar (TEACHER CONTROL CENTER / Go Online / Logout)
       wraps instead of overflowing off-screen ── */
    #realDashboardContent > div[style*="background: #004d4d"] {
        flex-wrap: wrap !important;
        gap: 10px !important;
        padding: 10px 12px !important;
    }

    #realDashboardContent > div[style*="background: #004d4d"] h2 {
        font-size: 13px !important;
    }

    #realDashboardContent > div[style*="background: #004d4d"] span[style*="opacity: 0.8"] {
        font-size: 12px !important;
    }

    #statusBtn {
        min-width: 0 !important;
        padding: 6px 10px !important;
        font-size: 12px !important;
    }

    /* ── Main flex row: sidebar + body stacks vertically ── */
    #realDashboardContent > div[style*="display: flex; width: 100%"] {
        flex-direction: column !important;
    }

    /* ── Sidebar: full width, drop sticky/fixed-height (this was
       causing overlap with content once stacked below it) ── */
    /* ── Sidebar: full width, drop sticky/fixed-height. 
       🔧 FIX: was using `flex: 1 1 100%`, but in a column-direction
       flex container, flex-basis controls HEIGHT not width — and
       with no fixed height on the row wrapper, "100%" had nothing
       to resolve against, collapsing the sidebar to ~30px. Using
       `flex: 0 0 auto` instead tells it to just take its natural
       content height, so the profile card + tabs render at full size. ── */
    #sidebar {
        flex: 0 0 auto !important;
        min-width: 0 !important;
        width: 100% !important;
        position: relative !important;
        top: 0 !important;
        height: auto !important;
        max-height: none !important;
        padding: 15px !important;
    }

    #teacherDashboardBody {
        padding: 15px !important;
    }

    /* ── Identity card: tighten padding on small screens ── */
    #teacherIdentityCard {
        padding: 15px !important;
    }

    #dashProfileImg {
        width: 70px !important;
        height: 70px !important;
    }

    /* ── Goal tracker card padding ── */
    .goal-tracker {
        padding: 15px !important;
    }

    /* ── 3-card metric row (Revenue / Sessions / Avg Rating)
       stacks instead of squeezing into thirds ── */
    #t-workspace div[style*="repeat(3, 1fr)"] {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    /* ── Analytics grid (1.5fr main column + 1fr side column)
       stacks vertically ── */
    #t-workspace div[style*="1.5fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* ── Live Queue / Call History lists: allow horizontal
       scroll for any tables rendered inside them ── */
    #studentQueueList,
    #callHistoryList {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    #studentQueueList table,
    #callHistoryList table {
        min-width: 560px;
        font-size: 12px !important;
    }

    /* ── Earning Log table: already has overflow-x wrapper,
       just tighten font/padding and force min-width so
       columns don't get crushed ── */
    #t-log table {
        min-width: 560px;
        font-size: 12px !important;
    }

    #t-log table th,
    #t-log table td {
        padding: 8px 6px !important;
    }

    /* ── Revenue summary cards (Total Sessions / Revenue / Avg)
       inside Earning Log — already auto-fit, just tighten gap ── */
    #t-log > div > div[style*="repeat(auto-fit, minmax(200px"] {
        gap: 10px !important;
    }

    /* ── Search inputs: full width instead of fixed 300px ── */
    #historySearch,
    #earningSearchInput {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Earning Log header row (title + search) stacks */
    #t-log div[style*="justify-content: space-between"][style*="flex-wrap: wrap"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    /* Call History header row (title + search) stacks */
    #t-history div[style*="justify-content: space-between"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    /* ── Sidebar tab buttons: slightly tighter on phones ── */
    .t-tab {
        padding: 10px !important;
        font-size: 13px !important;
    }
}
/* ============================================================
   MOBILE PATCH #5 — Fix #teacherApp clipping stacked content
   #teacherApp has height:100vh + overflow:hidden, which works
   fine on desktop (sidebar + body fit side-by-side in one
   screen), but once Patch #4 stacks them vertically on mobile,
   the combined height exceeds 100vh and gets silently clipped
   with no way to scroll to it — this was hiding the sidebar.
   ============================================================ */

@media (max-width: 640px) {
    #teacherApp {
        height: auto !important;
        min-height: 100vh !important;
        overflow: visible !important;
    }
}
/* ============================================================
   MOBILE PATCH #6 — Registration Modals (Student + Teacher)
   Fixes: hardcoded 3-column subject/course grids forcing pills
   to overflow the modal on narrow screens, since neither grid
   adjusted column count for smaller viewports.
   ============================================================ */

@media (max-width: 640px) {

    /* ── Student registration: subject/course pill grid ──
       Overrides the base .subject-checkbox-grid rule which forces
       3 fixed columns regardless of screen width. */
    .subject-checkbox-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    /* ── Teacher registration: subject grid (inline-styled, not
       using the shared class above — needs its own override) ── */
    #teacherSubjectOptions {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    /* ── Teacher registration: Class 1-12/UG/PG checkbox grid ──
       Was hardcoded to repeat(3, 1fr) with no mobile adjustment ── */
    #teacherClassGrid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    /* ── Category pickers (Academic/Professional/Languages/etc.)
       Ensure long labels wrap inside the pill instead of forcing
       the pill wider than the screen ── */
    .cat-pill {
        white-space: normal !important;
        word-break: break-word;
        font-size: 12px !important;
        padding: 8px 12px !important;
    }

    /* ── Any 2-column field grids inside registration modals
       (Full Name / Qualification, etc.) — stack to single column ── */
    #teacherRegistrationModal div[style*="grid-template-columns: 1fr 1fr"]:not([style*="1fr 1fr 1fr"]) {
            grid-template-columns: 1fr !important;
        }

    /* ── Checkbox/pill labels generally — allow wrapping instead
       of forcing horizontal overflow ── */
    .checkbox-label {
        white-space: normal !important;
        word-break: break-word;
    }

    /* ── Modal safety net: prevent any residual horizontal
       overflow from pushing the whole modal wider than the
       screen, while preserving existing vertical scrolling ── */
    #studentRegModal > div,
    #teacherRegistrationModal > div {
        overflow-x: hidden !important;
        max-width: 94vw !important;
    }
}

@media (max-width: 640px) {
    /* 🔧 FIX: Targets the newly-added class from Step 1. External
       stylesheet rules marked !important override inline styles
       regardless of specificity, so this correctly beats the
       inline "repeat(3, 1fr)" set by JS. */
    .teacher-subject-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================================
   MOBILE PATCH #7 — Admin Panel (God Mode Dashboard)
   Fixes: sidebar + main content sit side-by-side via a hardcoded
   margin-left: 260px on .admin-main-content, with no mobile
   adjustment — pushing all admin content off-screen on phones.
   ============================================================ */

@media (max-width: 900px) {

    /* ── Stack sidebar above content instead of side-by-side ── */
    #admin-dashboard-root,
    #adminPanel[style*="display: flex"],
    #adminPanel[style*="display: block"] {
        flex-direction: column !important;
        width: 100% !important;
        height: auto !important;
        min-height: 100vh !important;
    }

    /* ── Remove the fixed left margin that was reserving space
       for a sidebar that's no longer sitting beside the content ── */
    .admin-main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 15px !important;
    }

    /* ── Admin sidebar: full width, natural height, no longer
       sticky/fixed (matches the same fix already applied to the
       Teacher Dashboard sidebar in Patch #4) ── */
    #adminPanel aside {
        width: 100% !important;
        min-width: 0 !important;
        flex-shrink: 0 !important;
        height: auto !important;
        position: relative !important;
        top: 0 !important;
    }

    /* ── Top info bar (Server Time / Admin View) wraps cleanly
       instead of overflowing beside the sidebar ── */
    #adminPanel > div[style*="justify-content: space-between"] {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    /* ── Any 2+ column stat/summary grids inside admin views
       stack to a single column on phones ── */
    .admin-view div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* ── Admin tables: allow horizontal scroll instead of
       squeezing columns unreadable ── */
    .admin-view table {
        table-layout: auto !important;
        min-width: 500px;
    }

    .admin-view > div {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}