/* 19-Maktab Custom Styles */
:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --secondary: #06B6D4;
  --accent: #FACC15;
  --dark: #1F2937;
  --light: #F9FAFB;
  --card-bg: #FFFFFF;
  --border-color: #E5E7EB;
  --text-muted: #6B7280;
}

html, body {
  overflow-x: hidden !important;
  max-width: 100vw;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1f2937;
  background-color: #f8fafc;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

main {
  flex: 1;
}

/* Clean Minimal Header */
.main-header {
  background: #ffffff;
  border-bottom: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary, #4F46E5), var(--secondary, #06B6D4));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.brand-name {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: #0F172A;
}

.navbar-nav {
  gap: 0.25rem;
}

.navbar-nav .nav-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: #475569 !important;
  padding: 0.4rem 0.75rem !important;
  border-radius: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.navbar-nav .nav-link:hover {
  color: var(--primary, #4F46E5) !important;
  background-color: #F1F5F9;
}

.navbar-nav .nav-link.active {
  color: var(--primary, #4F46E5) !important;
  font-weight: 600;
  background-color: #EEF2FF;
}

.lang-select {
  width: 65px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  border-color: #CBD5E1;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.btn-theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #CBD5E1;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
}

.btn-theme-toggle:hover {
  background: #F1F5F9;
  color: var(--primary, #4F46E5);
}

/* Dark mode overrides for navbar */
[data-theme='dark'] .main-header {
  background: #0B1020;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] .brand-name {
  color: #F8FAFC;
}

[data-theme='dark'] .navbar-nav .nav-link {
  color: #94A3B8 !important;
}

[data-theme='dark'] .navbar-nav .nav-link:hover,
[data-theme='dark'] .navbar-nav .nav-link.active {
  color: #FFFFFF !important;
  background-color: rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] .lang-select,
[data-theme='dark'] .btn-theme-toggle {
  border-color: rgba(255, 255, 255, 0.15);
  color: #E2E8F0;
  background-color: #151D32;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.95), rgba(6, 182, 212, 0.9)), url('../images/hero-bg.jpg') center/cover no-repeat;
  color: #ffffff;
  padding: 5rem 0;
  position: relative;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.25rem;
  opacity: 0.92;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

/* Stat Cards */
.stat-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.75rem 1.25rem;
  text-align: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  border-bottom: 4px solid var(--primary);
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 0.5rem;
}

.stat-title {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
}

/* Cards */
.school-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid var(--border-color);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.school-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-img-wrapper {
  height: 200px;
  overflow: hidden;
  position: relative;
  background-color: #f3f4f6;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.school-card:hover .card-img-wrapper img {
  transform: scale(1.05);
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Teacher Avatar */
.teacher-avatar-wrapper {
  width: 110px;
  height: 110px;
  margin: 1.5rem auto 1rem;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #EEF2FF;
  background: #F3F4F6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.teacher-avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Badges */
.badge-category {
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Footer */
footer {
  background: #111827;
  color: #9CA3AF;
  padding: 3.5rem 0 1.5rem;
  margin-top: 4rem;
}

footer a {
  color: #D1D5DB;
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover {
  color: #FFFFFF;
}

footer .footer-title {
  color: #FFFFFF;
  font-weight: 700;
  margin-bottom: 1.25rem;
  font-size: 1.1rem;
}

/* Timeline */
.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline-item {
  position: relative;
  padding-left: 3rem;
  margin-bottom: 2.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: -2.5rem;
  width: 2px;
  background: #E5E7EB;
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  border: 4px solid #EEF2FF;
}

.timeline-year {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

/* ==========================================================================
   SMOOTH SCROLLING & SCROLL OFFSET FOR ANCHOR LINKS
   ========================================================================== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 85px;
}

/* ==========================================================================
   ULTRA-POLISHED MODERN MOBILE & RESPONSIVE DESIGN SYSTEM
   Professional, comfortable, highly legible, touch-friendly UI
   ========================================================================== */

/* Mobile Bottom Safe Area & Body Padding */
@media (max-width: 767.98px) {
  body {
    padding-bottom: 72px !important; /* Never overlap with bottom bar */
  }
}

/* 1. Header & Mobile Dropdown Navigation */
@media (max-width: 991.98px) {
  .navbar-toggler {
    padding: 0.35rem 0.5rem !important;
    border-radius: 8px !important;
    background: rgba(79, 70, 229, 0.06) !important;
  }
  .navbar-toggler i {
    color: var(--primary, #4F46E5) !important;
  }
  .navbar-collapse {
    background: #ffffff;
    border-radius: 18px;
    padding: 1.1rem 1.25rem;
    margin-top: 0.75rem;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(79, 70, 229, 0.1);
  }
  .navbar-nav {
    gap: 0.35rem;
  }
  .navbar-nav .nav-link {
    padding: 0.65rem 0.95rem !important;
    font-size: 0.95rem !important;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    color: #334155 !important;
  }
  .navbar-nav .nav-link:hover,
  .navbar-nav .nav-link.active {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary, #4F46E5) !important;
  }
}

/* 2. Global Mobile Typography & Touch Ergonomics (<= 768px) */
@media (max-width: 768px) {
  /* Section Spacing */
  .py-5 {
    padding-top: 2.25rem !important;
    padding-bottom: 2.25rem !important;
  }
  .py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }

  /* Typography: Readable & Well-Proportioned */
  .hero-section {
    padding: 2.5rem 0 2rem !important;
  }
  .hero-title {
    font-size: 1.85rem !important;
    line-height: 1.25 !important;
    margin-bottom: 0.75rem !important;
  }
  .hero-subtitle {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    margin-bottom: 1.5rem !important;
  }
  .hero-photo-frame {
    height: 230px !important;
    max-width: 100% !important;
    border-radius: 18px !important;
  }

  /* Section Titles */
  .section-title {
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
  }
  .section-label {
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px;
  }

  /* Buttons: Touch-Friendly (min 42px height) */
  .btn-lg {
    padding: 0.65rem 1.4rem !important;
    font-size: 0.92rem !important;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .btn {
    padding: 0.55rem 1.15rem !important;
    font-size: 0.88rem !important;
    font-weight: 600;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .btn-sm {
    padding: 0.4rem 0.9rem !important;
    font-size: 0.82rem !important;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Stats Section: 2x2 Grid with Crisp Numbers */
  .stat-card {
    padding: 1.1rem 0.75rem !important;
    border-radius: 14px !important;
    border-bottom-width: 3px !important;
  }
  .stat-value {
    font-size: 1.7rem !important;
    font-weight: 800 !important;
    margin-top: 0.35rem !important;
    line-height: 1.1 !important;
  }
  .stat-title {
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
  }
  .stat-card i {
    font-size: 1.5rem !important;
  }

  /* Mini Info Cards in Bizning Maktab */
  .mini-info-card {
    padding: 0.75rem 0.5rem !important;
    border-radius: 12px !important;
    gap: 0.25rem !important;
  }
  .mini-info-card i {
    font-size: 1.15rem !important;
  }
  .mini-info-card span {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    word-break: normal !important;
  }

  /* Director Card */
  .director-card {
    padding: 1.5rem 1.25rem !important;
    border-radius: 18px !important;
  }
  .director-photo-wrapper {
    width: 130px !important;
    height: 165px !important;
    border-radius: 14px !important;
  }
  .director-message-text {
    font-size: 0.92rem !important;
    line-height: 1.75 !important;
    text-align: left;
  }
  .director-quote-mark {
    font-size: 3rem !important;
    margin-bottom: -0.75rem !important;
  }

  /* News Carousel & Mini News */
  .carousel-hero-slide {
    min-height: 250px !important;
    padding: 1.25rem 1rem !important;
    border-radius: 16px !important;
  }
  .news-mini-img {
    height: 170px !important;
  }
  .news-mini-body {
    padding: 1rem !important;
  }
  .news-mini-title {
    font-size: 0.95rem !important;
    line-height: 1.35 !important;
  }
  .news-mini-excerpt {
    font-size: 0.84rem !important;
    line-height: 1.5 !important;
  }

  /* Spotlight Cards (Best Student & Teacher) */
  .spotlight-card {
    padding: 1.5rem 1.25rem !important;
    border-radius: 18px !important;
    gap: 1.25rem !important;
  }
  .spotlight-badge-circle {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.2rem !important;
  }
  .spotlight-name {
    font-size: 1.2rem !important;
  }
  .spotlight-achievement {
    font-size: 0.92rem !important;
  }

  /* Teacher Cards on Mobile */
  .teacher-home-card {
    border-radius: 16px !important;
  }
  .teacher-home-card .p-3 {
    padding: 0.75rem 0.65rem !important;
  }
  .teacher-home-card h6 {
    font-size: 0.88rem !important;
    line-height: 1.3 !important;
  }
  .teacher-home-card .badge {
    font-size: 0.72rem !important;
  }
  .teacher-home-card p {
    font-size: 0.75rem !important;
    margin-bottom: 0.5rem !important;
  }

  /* Mobile Bottom App Navigation Bar */
  .mobile-bottom-nav {
    height: 60px;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06) !important;
    z-index: 1045 !important;
  }
  .mobile-bottom-link {
    color: #64748B !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0;
    transition: all 0.2s ease;
  }
  .mobile-bottom-link i {
    font-size: 1.2rem !important;
    transition: transform 0.2s ease;
  }
  .mobile-bottom-link span {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    margin-top: 2px;
  }
  .mobile-bottom-link.active,
  .mobile-bottom-link.active i,
  .mobile-bottom-link.active span {
    color: var(--primary, #4F46E5) !important;
  }
  .mobile-bottom-link:active i {
    transform: scale(0.9);
  }

  /* Footer */
  footer {
    padding: 2.25rem 0 1.5rem !important;
  }
  footer .footer-title {
    font-size: 1rem !important;
    margin-bottom: 0.75rem !important;
  }
  footer ul, footer p {
    font-size: 0.85rem !important;
    line-height: 1.6 !important;
  }
}

/* 3. Small Smartphones (<= 480px) */
@media (max-width: 480px) {
  .container {
    padding-left: 0.9rem !important;
    padding-right: 0.9rem !important;
  }
  .hero-title {
    font-size: 1.65rem !important;
  }
  .stat-card {
    padding: 0.85rem 0.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    justify-content: center !important;
    gap: 0.2rem !important;
  }
  .stat-card i {
    font-size: 1.45rem !important;
    margin-bottom: 0.2rem !important;
  }
  .stat-value {
    font-size: 1.45rem !important;
    text-align: center !important;
    line-height: 1.15 !important;
  }
  .stat-title {
    font-size: 0.78rem !important;
    text-align: center !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    line-height: 1.25 !important;
    width: 100% !important;
  }
  .hero-photo-frame {
    height: 200px !important;
  }
}

/* Dark Mode Overrides for Mobile Components */
[data-theme='dark'] .navbar-toggler {
  background: rgba(255, 255, 255, 0.08) !important;
}
[data-theme='dark'] .navbar-toggler i {
  color: #F8FAFC !important;
}
[data-theme='dark'] .navbar-collapse {
  background: #111827 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5) !important;
}
[data-theme='dark'] .navbar-nav .nav-link {
  color: #CBD5E1 !important;
}
[data-theme='dark'] .navbar-nav .nav-link:hover,
[data-theme='dark'] .navbar-nav .nav-link.active {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #FFFFFF !important;
}
[data-theme='dark'] .mobile-bottom-nav {
  background: rgba(15, 23, 42, 0.96) !important;
  border-top-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4) !important;
}
[data-theme='dark'] .mobile-bottom-link {
  color: #94A3B8 !important;
}
[data-theme='dark'] .mobile-bottom-link.active,
[data-theme='dark'] .mobile-bottom-link.active i,
[data-theme='dark'] .mobile-bottom-link.active span {
  color: #38BDF8 !important;
}

/* ==========================================================================
   CLEAN TYPOGRAPHY COLORS (Natural, sharp, highly legible)
   ========================================================================== */
body {
  color: #0F172A !important;
  font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}

h1, h2, h3, h4, h5, h6 {
  color: #0F172A;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  letter-spacing: -0.01em;
}

p, span, li {
  color: #334155;
}

.text-muted {
  color: #64748B !important;
}

/* ==========================================================================
   UNIVERSAL COMPLETE DARK MODE (Light/Dark 100% working)
   ========================================================================== */
[data-theme='dark'] body {
  background-color: #0B1120 !important;
  color: #F8FAFC !important;
}

[data-theme='dark'] .main-header {
  background-color: #0F172A !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme='dark'] .brand-name {
  color: #FFFFFF !important;
}

[data-theme='dark'] .navbar-nav .nav-link {
  color: #CBD5E1 !important;
}

[data-theme='dark'] .navbar-nav .nav-link:hover,
[data-theme='dark'] .navbar-nav .nav-link.active {
  color: #FFFFFF !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme='dark'] .lang-select,
[data-theme='dark'] .btn-theme-toggle {
  background-color: #1E293B !important;
  color: #F8FAFC !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

[data-theme='dark'] h1, 
[data-theme='dark'] h2, 
[data-theme='dark'] h3, 
[data-theme='dark'] h4, 
[data-theme='dark'] h5, 
[data-theme='dark'] h6 {
  color: #F8FAFC !important;
}

[data-theme='dark'] p, 
[data-theme='dark'] span:not(.badge), 
[data-theme='dark'] li {
  color: #CBD5E1 !important;
}

[data-theme='dark'] .text-muted {
  color: #94A3B8 !important;
}

[data-theme='dark'] .text-dark {
  color: #F8FAFC !important;
}

[data-theme='dark'] .bg-white {
  background-color: #111827 !important;
}

[data-theme='dark'] section[style*="background:#F8FAFC"],
[data-theme='dark'] section[style*="background: #F8FAFC"],
[data-theme='dark'] .bg-light {
  background-color: #0B1120 !important;
}

[data-theme='dark'] .stat-card,
[data-theme='dark'] .school-card,
[data-theme='dark'] .director-card,
[data-theme='dark'] .spotlight-card,
[data-theme='dark'] .gallery-card,
[data-theme='dark'] .teacher-mini-card,
[data-theme='dark'] .achievement-mini-card,
[data-theme='dark'] .card {
  background-color: #1E293B !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

[data-theme='dark'] .border,
[data-theme='dark'] .border-top,
[data-theme='dark'] .border-bottom {
  border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme='dark'] .director-quote-mark {
  color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme='dark'] footer {
  background-color: #050811 !important;
}


