/* 
  Zazele Online - Mobile & Responsiveness Styles
  Targets: Landing Page, Student Dashboard, Admin Dashboard
*/

/* --- Global Mobile Overrides --- */
@media (max-width: 768px) {
  :root {
    --header-height: 70px;
  }

  .app-container {
    padding: 0 16px;
    margin: 20px auto;
  }

  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.2rem; }

  /* Table Responsiveness */
  .table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
  }

  .users-table, .admin-table {
    min-width: 600px; /* Force scroll on very small screens */
  }

  /* Modals */
  .modal-content {
    width: 95% !important;
    padding: 20px !important;
    margin: 10px;
  }

  /* Forms */
  .portal-form-box {
    padding: 24px !important;
  }

  /* Header */
  .app-header {
    padding: 0 16px;
  }

  .school-brand span {
    display: none; /* Hide "Online" text on small mobiles if needed, or just shrink */
  }
  
  .school-brand {
    font-size: 1.1rem;
  }

  .user-nav {
    gap: 12px;
  }

  .user-info-text {
    display: none; /* Hide name/role on mobile header to save space */
  }

  /* Grid layouts */
  .admin-detail-grid {
    grid-template-columns: 1fr !important;
  }

  .info-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .docs-grid {
    grid-template-columns: 1fr !important;
  }

  .module-selector-grid {
    grid-template-columns: 1fr !important;
  }

  .progress-grid {
    grid-template-columns: 1fr !important;
  }

  /* Module Viewer Tabs */
  .tabs-header {
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .module-tab-btn {
    padding: 10px 16px;
    font-size: 0.8rem;
    flex-shrink: 0;
  }

  /* Admin Navigation */
  .admin-nav-bar {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
    gap: 20px;
    -webkit-overflow-scrolling: touch;
  }

  .admin-nav-item {
    flex-shrink: 0;
  }

  /* Quiz UI */
  .quiz-header {
    padding: 20px !important;
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .quiz-content {
    padding: 30px 20px !important;
  }

  .question-text {
    font-size: 1.2rem !important;
  }

  .option-label {
    padding: 15px !important;
  }

  .quiz-navigation {
    padding: 20px !important;
    flex-direction: column-reverse;
    gap: 12px;
  }

  .quiz-navigation .btn {
    width: 100%;
  }

  .results-score {
    grid-template-columns: 1fr !important;
    padding: 20px !important;
  }

  /* Hero Section */
  .hero-section h1 {
    font-size: 2rem !important;
  }

  .hero-stats {
    gap: 20px !important;
  }

  .stat-number {
    font-size: 1.5rem !important;
  }

  /* Admin Module Management */
  .module-sections {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .assignment-section-admin {
    padding-left: 0 !important;
    border-left: none !important;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
  }

  /* Lesson Items */
  .lesson-item-admin {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
  }

  .lesson-actions {
    width: 100%;
    justify-content: flex-end;
  }

  /* Footer */
  .dashboard-footer {
    padding: 40px 20px !important;
  }

  /* Improved Touch Targets */
  .btn, .tab-btn, .admin-nav-item, .module-tab-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Better spacing for student dashboard cards */
  .progress-section-card {
    padding: 20px !important;
  }

  .module-select-card {
    padding: 20px !important;
  }

  /* Make header sticky on mobile for easier navigation */
  .app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-soft);
  }

  /* Centered Notification Dropdown for Mobile */
  .notification-dropdown {
    position: fixed !important;
    top: calc(var(--header-height) + 10px) !important;
    left: 10px !important;
    right: 10px !important;
    width: calc(100% - 20px) !important;
    max-width: none !important;
    margin-top: 0 !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15) !important;
  }
}

/* --- Small Mobile Fixes (iPhone SE etc) --- */
@media (max-width: 400px) {
  .hero-section h1 {
    font-size: 1.6rem !important;
  }

  .portal-tabs {
    flex-direction: column;
  }

  .app-header {
    padding: 0 10px;
  }

  .brand-logo {
    height: 32px;
  }
}

/* --- Homepage Mobile & Tablet Styles --- */
@media (max-width: 768px) {
  .home-header {
    height: 70px;
  }
  .home-header .header-content {
    padding: 0 16px;
  }
  .home-nav {
    display: none; /* Hide top nav links on mobile to save space */
  }
  .home-main {
    padding-top: 70px;
  }
  .home-hero-section,
  .home-mission-section,
  .home-services-section,
  .home-why-section,
  .home-footer-section {
    padding: 60px 0;
  }
  .home-hero-content h1 {
    font-size: 2.2rem;
    line-height: 1.2;
  }
  .home-hero-lead {
    font-size: 1.1rem;
    margin-bottom: 32px;
  }
  .home-hero-ctas,
  .footer-ctas {
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }
  .home-hero-ctas .btn,
  .footer-ctas .btn {
    width: 100%;
    text-align: center;
  }
  .mission-grid,
  .services-compare-grid,
  .why-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .mission-text-side h2,
  .home-section-header h2,
  .why-info-side h2,
  .footer-cta-card h2 {
    font-size: 1.8rem;
    line-height: 1.3;
  }
  .mission-text-side p,
  .home-section-header p,
  .why-info-side p,
  .footer-cta-card p {
    font-size: 1rem;
    line-height: 1.6;
  }
  .service-compare-card {
    padding: 32px 24px;
  }
  .advantage-metrics {
    gap: 24px;
    justify-content: flex-start;
  }
  .footer-cta-card {
    padding: 40px 20px;
  }
  .footer-links-row {
    flex-direction: column;
    gap: 20px;
    text-align: center;
    padding-top: 24px;
  }
  .social-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
  }
}

/* --- Mobile Navigation Drawer & Hamburger Styles --- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.mobile-menu-toggle span {
  width: 100%;
  height: 2.5px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform-origin: center center;
}

.mobile-nav-brand {
  display: none;
}

@media (max-width: 900px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .main-nav {
    display: flex !important;
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-direction: column;
    padding: 100px 24px 40px 24px;
    align-items: flex-start;
    border-left: 1px solid var(--border-color);
  }

  .main-nav.active {
    right: 0;
  }

  .mobile-nav-brand {
    display: block;
    width: 100%;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
  }

  .mobile-nav-brand .school-brand {
    justify-content: flex-start;
  }

  .main-nav ul {
    flex-direction: column !important;
    align-items: flex-start !important;
    width: 100%;
    gap: 16px !important;
  }

  .main-nav ul li {
    width: 100%;
  }

  .main-nav ul li a {
    display: block;
    width: 100%;
    padding: 12px 0;
    font-size: 1.1rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
  }

  .main-nav ul li a.btn {
    border-bottom: none;
    margin-top: 15px;
    text-align: center;
    padding: 12px;
  }

  /* Hamburger Active Animation */
  .mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
  }

  .mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Overlay Background dimming */
  .mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  .no-scroll {
    overflow: hidden !important;
  }

  /* Portfolio Card Mobile responsiveness */
  .portfolio-card {
    grid-template-columns: 1fr !important;
    gap: 30px !important;
    padding: 24px !important;
  }

  /* Packages Grid Responsiveness */
  .packages-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 650px) {
  .packages-grid {
    grid-template-columns: 1fr !important;
  }
}


