:root {
  --bg: #eef3fb;
  --card: #ffffff;
  --card-2: #f8fbff;
  --primary: #0f2b5b;
  --primary-2: #1e4ea8;
  --accent: #2f7cf6;
  --accent-2: #70a5ff;
  --text: #12233d;
  --muted: #5f7088;
  --success: #148a4b;
  --danger: #c53a3a;
  --warning: #d18b09;
  --border: rgba(15, 43, 91, 0.1);
  --shadow: 0 18px 45px rgba(15, 43, 91, 0.09);
  --shadow-soft: 0 10px 30px rgba(15, 43, 91, 0.06);
  --radius: 22px;
  --radius-sm: 14px;
  --transition: all 0.28s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: linear-gradient(180deg, #f5f8ff 0%, #eef3fb 100%);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video,
iframe {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.muted {
  color: var(--muted);
}

.center {
  text-align: center;
}

.mt-24 {
  margin-top: 24px;
}

.mt-40 {
  margin-top: 40px;
}

.hidden {
  display: none !important;
}

#loader {
  position: fixed;
  inset: 0;
  background: #09172f;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
}

.spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.16);
  border-top-color: #7db0ff;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#scrollProgress {
  position: fixed;
  top: 0;
  left: 0;
  height: 5px;
  width: 0;
  z-index: 3100;
  background: linear-gradient(90deg, #2f7cf6, #7db0ff, #2f7cf6);
  box-shadow: 0 0 18px rgba(47, 124, 246, 0.45);
}

#scrollTopBtn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-2), var(--accent));
  color: #fff;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 1200;
}

#scrollTopBtn.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.notification {
  position: fixed;
  top: 88px;
  right: 24px;
  z-index: 3500;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  color: var(--text);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px 20px;
  border-inline-start: 5px solid var(--success);
  min-width: 260px;
  max-width: min(420px, calc(100% - 32px));
  animation: slideIn .25s ease;
}

.notification.error {
  border-inline-start-color: var(--danger);
}

.notification.warning {
  border-inline-start-color: var(--warning);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 2000;
  padding: 12px 0;
  background: transparent;
  transition: var(--transition);
}

header.scrolled {
  background: rgba(8, 21, 45, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 35px rgba(8, 21, 45, 0.28);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo-img,
.logo img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-text {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.logo-text span {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  margin-top: 4px;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.main-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 12px;
  backdrop-filter: blur(10px);
}

.nav-list li {
  position: relative;
}

.nav-list a,
.dept-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 600;
  transition: var(--transition);
}

.nav-list a:hover,
.nav-list a.active,
.dept-toggle:hover,
.has-submenu.submenu-open > .dept-toggle {
  background: rgba(255, 255, 255, 0.14);
}

.submenu {
  list-style: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 230px;
  display: none;
  flex-direction: column;
  gap: 6px;
  background: rgba(8, 21, 45, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.28);
}

.has-submenu.submenu-open .submenu,
.has-submenu:hover .submenu {
  display: flex;
}

.submenu a {
  border-radius: 12px;
  padding: 12px 14px;
}

.user-profile {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #fff;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  min-width: 0;
  position: relative;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.user-info {
  min-width: 0;
}

.user-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.user-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  width: 220px;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 2100;
}

.user-menu-item {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}

.user-menu-item:hover {
  background: #f3f7ff;
}

.login-btn,
.primary-btn,
.secondary-btn,
.auth-btn,
.department-btn,
.admin-btn,
.hero-btn,
.outline-btn,
.role-action {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  padding: 13px 22px;
  font-weight: 700;
  transition: var(--transition);
}

.login-btn,
.primary-btn,
.auth-btn,
.department-btn,
.admin-btn,
.hero-btn,
.role-action {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-2), var(--accent));
  box-shadow: 0 12px 30px rgba(47, 124, 246, 0.28);
}

.secondary-btn,
.outline-btn {
  color: var(--primary);
  background: #fff;
  border: 1px solid var(--border);
}

.login-btn:hover,
.primary-btn:hover,
.secondary-btn:hover,
.auth-btn:hover,
.department-btn:hover,
.admin-btn:hover,
.hero-btn:hover,
.outline-btn:hover,
.role-action:hover {
  transform: translateY(-2px);
}

main {
  padding: 48px 0 80px;
}

.hero {
  min-height: 90vh;
  padding-top: 110px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #0b1c3b 0%, #17356c 48%, #2b6fe0 100%);
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(8, 21, 45, 0.84), rgba(23, 53, 108, 0.72), rgba(47, 124, 246, 0.6));
}

.floating-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.floating-shapes span {
  position: absolute;
  bottom: -90px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  animation: floatShape 18s linear infinite;
}

.floating-shapes span:nth-child(1) { right: 8%; animation-duration: 16s; }
.floating-shapes span:nth-child(2) { right: 24%; width: 32px; height: 32px; animation-duration: 22s; }
.floating-shapes span:nth-child(3) { right: 46%; width: 74px; height: 74px; animation-duration: 20s; }
.floating-shapes span:nth-child(4) { right: 68%; animation-duration: 24s; }
.floating-shapes span:nth-child(5) { right: 86%; width: 40px; height: 40px; animation-duration: 19s; }

@keyframes floatShape {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  15% { opacity: 0.25; }
  100% { transform: translateY(-950px) rotate(360deg); opacity: 0; }
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(840px, calc(100% - 32px));
  text-align: center;
  color: #fff;
}

.hero-content h1,
.hero-content h2 {
  font-size: clamp(34px, 5vw, 72px);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 20px;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.hero-content p {
  font-size: clamp(16px, 2vw, 22px);
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.section {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius);
  padding: 34px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.section::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary-2), var(--accent));
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary);
  font-size: clamp(24px, 2vw, 32px);
  margin-bottom: 16px;
}

.section-subtitle {
  color: var(--muted);
  margin-bottom: 26px;
}

.welcome-wrap,
.about-text {
  font-size: 17px;
}

.welcome-quote {
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 22px;
  text-align: center;
}

.welcome-goals {
  background: linear-gradient(135deg, #eff5ff, #f7fbff);
  border: 1px solid rgba(47, 124, 246, 0.12);
  border-radius: 18px;
  padding: 24px;
}

.welcome-goals h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--primary-2);
}

.welcome-goals ul,
.dept-meta,
.admission-list,
.admission-points {
  list-style: none;
}

.welcome-goals li,
.dept-meta li,
.admission-list li,
.admission-points li {
  padding-inline-start: 28px;
  position: relative;
  margin-bottom: 10px;
}

.welcome-goals li i,
.dept-meta li i,
.admission-list li i,
.admission-points li i {
  position: absolute;
  inset-inline-start: 0;
  top: 7px;
  color: var(--success);
}

.departments-grid,
.stats-container,
.media-container,
.footer-content,
.card-grid,
.steps-container,
.goals-grid,
.news-grid,
.teachers-grid,
.video-grid,
.dashboard-grid,
.lesson-form-grid,
.map-grid,
.quick-grid {
  display: grid;
  gap: 22px;
}

.departments-grid,
.news-grid,
.media-container,
.quick-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.stats-container,
.card-grid,
.steps-container,
.goals-grid,
.dashboard-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.teachers-grid,
.video-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.department-card,
.stat-card,
.media-item,
.info-card,
.step-card,
.goal-card,
.news-card,
.teacher-card,
.video-card,
.quick-card,
.dashboard-card,
.lesson-card,
.announcement-card,
.map-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}

.department-card:hover,
.stat-card:hover,
.media-item:hover,
.info-card:hover,
.step-card:hover,
.goal-card:hover,
.news-card:hover,
.teacher-card:hover,
.video-card:hover,
.quick-card:hover,
.lesson-card:hover,
.announcement-card:hover,
.map-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.department-icon {
  min-height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 62px;
}

.department-info,
.media-info,
.news-content,
.teacher-body,
.quick-card,
.lesson-card,
.announcement-card,
.dashboard-card,
.map-card {
  padding: 22px;
}

.department-info h3,
.news-content h3,
.teacher-name,
.quick-card h3,
.lesson-card h3,
.announcement-card h3,
.dashboard-card h3 {
  color: var(--primary);
  margin-bottom: 10px;
}

.department-card .department-btn {
  width: 100%;
  margin-top: 16px;
}

.stat-card {
  padding: 28px 20px;
  text-align: center;
}

.stat-icon {
  font-size: 44px;
  color: var(--primary-2);
  margin-bottom: 12px;
}

.stat-number {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  color: var(--primary);
}

.stat-text {
  color: var(--muted);
}

.media-item img,
.media-item video,
.news-card img,
.teacher-photo,
.video-card video {
  width: 100%;
  object-fit: cover;
}

.media-item img,
.media-item video,
.news-card img {
  aspect-ratio: 16 / 10;
}

.teacher-photo {
  aspect-ratio: 1 / 1;
}

.video-card video {
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: #0d1830;
}

.video-meta,
.lesson-meta,
.teacher-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.teacher-badge,
.lesson-badge,
.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--primary-2);
  border: 1px solid rgba(47, 124, 246, 0.12);
  font-size: 13px;
  font-weight: 700;
}

.principal-section {
  padding: 80px 0 30px;
}

.principal-wrap,
.admissions-wrap,
.map-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  align-items: center;
}

.principal-image {
  display: flex;
  justify-content: center;
}

.principal-image img,
.principal-img {
  width: min(360px, 100%);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 30px;
  box-shadow: var(--shadow);
  border: 5px solid rgba(255, 255, 255, 0.72);
  cursor: zoom-in;
  transition: transform .25s ease;
}

.principal-image img:hover,
.principal-img:hover {
  transform: scale(1.02);
}

.principal-name {
  margin-top: 18px;
  font-weight: 800;
  color: var(--primary);
}

.goals {
  padding: 20px 0 0;
}

.goal-card {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.goal-card i {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-2), var(--accent));
  flex-shrink: 0;
}

.news-date,
.lesson-date,
.small-note {
  font-size: 13px;
  color: var(--muted);
}

.comment-form {
  background: linear-gradient(135deg, #f1f6ff, #fbfdff);
  border: 1px solid rgba(47, 124, 246, 0.08);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 24px;
}

.comment-form textarea,
.admin-card textarea,
textarea,
input,
select {
  width: 100%;
  border: 1px solid rgba(18, 35, 61, 0.14);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
}

textarea,
input,
select {
  padding: 14px 16px;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(47, 124, 246, 0.55);
  box-shadow: 0 0 0 4px rgba(47, 124, 246, 0.12);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.comment {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 20px;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(18, 35, 61, 0.08);
}

.comment-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.comment-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-user-info h4 {
  color: var(--primary);
  margin-bottom: 4px;
}

.comment-time {
  color: var(--muted);
  font-size: 13px;
}

.quick-card p,
.lesson-card p,
.announcement-card p,
.map-card p,
.news-content p,
.media-info p,
.info-card p,
.step-card p,
.goal-card span,
.footer-section p,
.about-text p,
.principal-content p {
  color: var(--muted);
}

.announcement-list,
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.announcement-image,
.announcement-img {
  width: 100%;
  border-radius: 16px;
  margin-top: 12px;
  max-height: 360px;
  object-fit: contain;
  background: #f4f8ff;
}

.admissions-section {
  background: linear-gradient(135deg, #0d1f42, #17356c);
  color: #fff;
}

.admissions-section .section-title,
.admissions-section p,
.admissions-section li,
.admissions-section h3 {
  color: #fff;
}

.admissions-box {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  padding: 26px;
  backdrop-filter: blur(10px);
}

.admission-highlight + .admission-highlight {
  margin-top: 18px;
}

.info-card,
.step-card {
  padding: 24px;
}

.card-icon {
  font-size: 28px;
  color: var(--primary-2);
  margin-bottom: 12px;
}

.step-card {
  position: relative;
}

.step-number {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-2), var(--accent));
  color: #fff;
  font-weight: 800;
}

.map-card iframe {
  width: 100%;
  min-height: 360px;
  border: 0;
  border-radius: 18px;
}

.map-details {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.map-info-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f5f9ff;
}

.map-info-row i {
  color: var(--primary-2);
  margin-top: 5px;
}

.lesson-section-head,
.dashboard-head,
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.lesson-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lesson-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: #0d1830;
}

.lesson-empty,
.empty-state {
  text-align: center;
  padding: 32px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f5f9ff, #fbfdff);
  border: 1px dashed rgba(47, 124, 246, 0.22);
  color: var(--muted);
}

footer {
  background: linear-gradient(135deg, #09172f, #0f2b5b);
  color: #fff;
  padding: 56px 0 26px;
  margin-top: 34px;
}

.footer-section h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  margin-bottom: 16px;
}

.footer-section a:hover {
  color: #cfe1ff;
}

.social-links {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.social-links a {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.copyright {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
}

.auth-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 12, 25, 0.7);
  backdrop-filter: blur(4px);
  z-index: 3200;
}

.auth-container {
  width: min(540px, 100%);
  background: #fff;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(8, 21, 45, 0.35);
}

.auth-header {
  position: relative;
  padding: 28px 28px 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  text-align: center;
}

.auth-header h2 {
  margin-bottom: 8px;
}

.close-auth {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
}

.auth-tabs {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.14);
  padding: 6px;
  border-radius: 999px;
  margin-top: 18px;
}

.auth-tab {
  flex: 1;
  padding: 12px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}

.auth-tab.active {
  background: #fff;
  color: var(--primary);
}

.auth-content {
  padding: 26px;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.form-group {
  margin-bottom: 16px;
  position: relative;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  margin-bottom: 8px;
  font-weight: 700;
}

.input-icon,
.password-toggle {
  position: absolute;
  top: 45px;
  color: var(--muted);
}

.input-icon {
  right: 14px;
}

.password-toggle {
  left: 14px;
}

.form-group input {
  padding-inline-start: 44px;
  padding-inline-end: 44px;
}

.social-login {
  margin-top: 20px;
  text-align: center;
}

.social-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.social-btn {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}

.admin-body {
  background: linear-gradient(180deg, #eff4ff, #edf2fb);
}

.admin-shell {
  padding: 110px 0 50px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 26px;
}

.admin-header h1 {
  color: var(--primary);
  font-size: clamp(28px, 4vw, 42px);
}

.admin-panel {
  display: grid;
  gap: 22px;
}

.admin-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
  padding: 26px;
}

.admin-card h2 {
  color: var(--primary);
  margin-bottom: 8px;
}

.admin-card h3 {
  color: var(--primary);
  margin-bottom: 12px;
}

.lesson-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 18px;
}

.full-span {
  grid-column: 1 / -1;
}

.admin-inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.file-note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

.dashboard-item-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.danger-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #b92c2c, #d14646);
  color: #fff;
  font-weight: 700;
}

.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-container {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 30px;
}

.login-container h2 {
  color: var(--primary);
  margin-bottom: 10px;
}

.login-container p {
  color: var(--muted);
  margin-bottom: 18px;
}

.login-container form {
  display: grid;
  gap: 14px;
}

#error {
  color: var(--danger);
  min-height: 24px;
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s ease, transform .7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 10, 22, 0.84);
  backdrop-filter: blur(4px);
  z-index: 3300;
  padding: 20px;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: min(900px, 100%);
  max-height: 90vh;
}

.lightbox-content img {
  width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.lightbox-close {
  position: absolute;
  top: -12px;
  left: -12px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-soft);
}

.dashboard-note {
  padding: 16px 18px;
  border-radius: 18px;
  background: #f4f8ff;
  border: 1px solid rgba(47, 124, 246, 0.12);
  color: var(--muted);
}

@media (max-width: 992px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .main-nav {
    position: fixed;
    top: 76px;
    right: 16px;
    left: 16px;
    background: rgba(8, 21, 45, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.32);
    transform: translateY(-16px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .main-nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-list {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: 0;
  }

  .nav-list a,
  .dept-toggle {
    width: 100%;
    justify-content: space-between;
    border-radius: 16px;
    padding: 14px 16px;
  }

  .submenu {
    position: static;
    min-width: 0;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
    border-radius: 16px;
    border: 0;
    margin-top: 8px;
  }

  .has-submenu:hover .submenu {
    display: none;
  }

  .has-submenu.submenu-open .submenu {
    display: flex;
  }

  .desktop-profile,
  #loginButton {
    display: none !important;
  }

  .logo-text {
    font-size: 17px;
  }

  .logo-text span {
    font-size: 12px;
  }

  .principal-wrap,
  .admissions-wrap,
  .map-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    width: min(100% - 20px, 1180px);
  }

  header {
    padding: 10px 0;
  }

  .logo-img,
  .logo img {
    width: 42px;
    height: 42px;
  }

  .logo-text {
    font-size: 15px;
  }

  .logo-text span {
    display: none;
  }

  .hero {
    min-height: 72vh;
    padding-top: 94px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .section,
  .admin-card,
  .login-container,
  .auth-content {
    padding: 22px;
  }

  .section-title {
    font-size: 24px;
  }

  .social-buttons {
    grid-template-columns: 1fr;
  }

  .comment-header,
  .lesson-section-head,
  .dashboard-head,
  .admin-header,
  .flex-between {
    flex-direction: column;
    align-items: stretch;
  }

  .notification {
    left: 14px;
    right: 14px;
    top: 82px;
    max-width: none;
  }

  #scrollTopBtn {
    bottom: 18px;
    right: 18px;
  }
}


label {
  display: block;
  margin-bottom: 8px;
  color: var(--primary);
  font-weight: 700;
}

.loading {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.28);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.mobile-user {
  display: none;
}

@media (max-width: 992px) {
  .mobile-user {
    display: block;
  }
}

/* ===== 2026-03-30 polish + mobile + language switch ===== */
.logo {
  flex: 0 1 auto;
  min-width: 0;
}

.logo-text {
  font-size: clamp(15px, 1.35vw, 18px);
  max-width: 220px;
  font-weight: 800;
}

.logo-text span {
  font-size: 11px;
  line-height: 1.35;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.lang-btn {
  min-width: 44px;
  border: 0;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: transparent;
  transition: var(--transition);
}

.lang-btn.active {
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary);
  box-shadow: 0 8px 18px rgba(8, 21, 45, 0.18);
}

.mobile-profile {
  display: none;
}

.desktop-profile {
  display: none;
}

body:not(.menu-open) .mobile-profile .user-menu {
  inset-inline-end: 0;
  inset-inline-start: auto;
}

.admin-inline-actions .lang-switch,
.login-topbar .lang-switch {
  background: #eaf1ff;
  border-color: rgba(15, 43, 91, 0.08);
}

.admin-inline-actions .lang-btn,
.login-topbar .lang-btn {
  color: var(--primary);
}

.admin-inline-actions .lang-btn.active,
.login-topbar .lang-btn.active {
  background: linear-gradient(135deg, var(--primary-2), var(--accent));
  color: #fff;
}

.login-topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(15, 43, 91, 0.14);
  background: #fff;
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
  transition: var(--transition);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(47, 124, 246, 0.48);
  box-shadow: 0 0 0 4px rgba(47, 124, 246, 0.12);
}

textarea {
  min-height: 128px;
  resize: vertical;
}

.principal-image img,
.principal-img {
  width: min(320px, 100%);
  border-radius: 50%;
  border: 8px solid rgba(255, 255, 255, 0.9);
  cursor: default;
}

.principal-image img:hover,
.principal-img:hover {
  transform: none;
}

.lightbox {
  display: none !important;
}

.admin-body {
  background:
    radial-gradient(circle at top right, rgba(112, 165, 255, 0.18), transparent 28%),
    linear-gradient(180deg, #eef4ff, #edf2fb 52%, #f7faff 100%);
}

.admin-shell {
  padding-top: 90px;
}

.admin-card {
  position: relative;
  overflow: hidden;
}

.admin-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--primary-2), var(--accent));
}

.admin-card h2,
.admin-card h3 {
  padding-inline-end: 12px;
}

.dashboard-note {
  line-height: 1.9;
}

#lessonUploadStatus {
  margin-top: 10px;
}

.user-profile {
  max-width: 220px;
}

body.lang-en {
  direction: ltr;
}

body.lang-en .hero-content,
body.lang-en .section,
body.lang-en .about-text,
body.lang-en .welcome-goals,
body.lang-en .map-details,
body.lang-en .comment-form,
body.lang-en .dashboard-note,
body.lang-en .admin-card,
body.lang-en .login-container {
  text-align: left;
}

body.lang-en .notification {
  right: auto;
  left: 24px;
}

body.lang-en .user-menu {
  left: auto;
  right: 0;
}

body.lang-en .close-auth {
  left: auto;
  right: 16px;
}

body.lang-en .input-icon {
  right: auto;
  left: 14px;
}

body.lang-en .password-toggle {
  left: auto;
  right: 14px;
}

body.lang-en .form-group input {
  padding-inline-start: 44px;
  padding-inline-end: 44px;
}

@media (max-width: 992px) {
  .header-container {
    gap: 10px;
    align-items: center;
  }

  .logo {
    min-width: 0;
    flex: 1 1 auto;
  }

  .main-nav {
    top: 82px;
    right: 12px;
    left: 12px;
    max-height: calc(100vh - 94px);
    overflow: auto;
    padding: 18px;
  }

  .nav-list {
    gap: 10px;
  }

  .header-actions {
    margin-inline-start: 0;
    gap: 8px;
    flex-shrink: 0;
  }

  #loginButton {
    display: inline-flex;
    padding: 11px 14px;
    min-width: 0;
    box-shadow: none;
  }

  #loginButton i {
    margin: 0;
  }

  #loginButton span {
    display: inline;
  }

  .desktop-profile {
    display: none !important;
  }

  .mobile-profile {
    display: none;
    max-width: 150px;
    padding: 8px 10px;
  }

  .mobile-profile .user-avatar {
    width: 36px;
    height: 36px;
  }

  .mobile-profile .user-name {
    font-size: 12px;
  }

  .mobile-profile .user-role {
    font-size: 11px;
  }

  .hero {
    min-height: 78vh;
  }

  .hero-content {
    width: min(100% - 24px, 760px);
  }

  .hero-content h1,
  .hero-content h2 {
    font-size: clamp(30px, 9vw, 48px);
  }

  .hero-content p {
    font-size: 16px;
    line-height: 1.8;
  }

  .section,
  .admin-card,
  .login-container {
    border-radius: 20px;
  }
}

@media (max-width: 768px) {
  .container {
    width: min(100% - 16px, 1180px);
  }

  header {
    padding: 8px 0;
  }

  .header-container {
    gap: 8px;
  }

  .logo-img,
  .logo img {
    width: 38px;
    height: 38px;
  }

  .logo-text {
    font-size: 14px;
    max-width: 140px;
  }

  .logo-text span {
    display: none;
  }

  .lang-btn {
    min-width: 38px;
    padding: 8px 10px;
    font-size: 11px;
  }

  #loginButton {
    padding: 10px 12px;
    font-size: 12px;
    gap: 6px;
  }

  .main-nav {
    top: 74px;
    max-height: calc(100vh - 84px);
    border-radius: 22px;
    padding: 16px;
  }

  .nav-list a,
  .dept-toggle {
    font-size: 14px;
    padding: 13px 14px;
  }

  .mobile-profile {
    max-width: 132px;
  }

  .hero {
    min-height: 72vh;
    padding-top: 88px;
  }

  .hero-actions {
    width: 100%;
    gap: 10px;
  }

  .hero-actions > * {
    width: 100%;
  }

  .section,
  .admin-card,
  .login-container,
  .auth-content {
    padding: 20px 18px;
  }

  .section-title {
    font-size: 22px;
  }

  .departments-grid,
  .stats-container,
  .media-container,
  .card-grid,
  .steps-container,
  .goals-grid,
  .news-grid,
  .teachers-grid,
  .video-grid,
  .quick-grid,
  .lesson-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-inline-actions,
  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .map-card iframe {
    min-height: 280px;
  }

  .comment-header,
  .lesson-section-head,
  .dashboard-head,
  .admin-header,
  .flex-between {
    gap: 12px;
  }

  .notification {
    left: 12px;
    right: 12px;
    top: 76px;
    max-width: none;
  }
}

@media (min-width: 993px) {
  .desktop-profile {
    display: none;
  }
}

@media (min-width: 993px) {
  .desktop-profile {
    display: flex;
  }

  .mobile-profile {
    display: none !important;
  }
}


/* ===== 2026-03-30 v3 bug fix pass ===== */
.header-container {
  flex-wrap: nowrap;
}

.logo {
  min-width: 0;
  max-width: 320px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: start;
  gap: 2px;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.05;
  white-space: nowrap;
}

.logo-text span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
}

.header-actions {
  flex-wrap: nowrap;
  gap: 8px;
}

.header-actions > * {
  flex-shrink: 0;
}

#loginButton {
  white-space: nowrap;
}

.user-profile {
  min-width: 0;
}

body.lang-en .header-container,
body.lang-en .header-actions,
body.lang-en .nav-list,
body.lang-en .logo,
body.lang-en .main-nav {
  direction: ltr;
}

body.lang-en .logo-text {
  font-size: 14px;
  align-items: flex-start;
  text-align: left;
}

body.lang-en .logo-text span {
  font-size: 9px;
}

body.lang-en .user-profile,
body.lang-en .lesson-meta,
body.lang-en .teacher-meta,
body.lang-en .dashboard-item-actions,
body.lang-en .admin-inline-actions,
body.lang-en .hero-actions,
body.lang-en .social-links,
body.lang-en .map-info-row,
body.lang-en .lesson-section-head,
body.lang-en .dashboard-head {
  direction: ltr;
}

.dashboard-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.dashboard-stat {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(239,245,255,0.96));
  border: 1px solid rgba(47, 124, 246, 0.12);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.dashboard-stat-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.dashboard-stat-value {
  color: var(--primary);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

body[data-page='admin'] .video-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

body[data-page='admin'] .lesson-card,
body[data-page='admin'] .announcement-card,
body[data-page='admin'] .comment {
  height: 100%;
}

body[data-page='admin'] .admin-card {
  border-radius: 26px;
  box-shadow: 0 18px 45px rgba(15, 43, 91, 0.08);
}

body[data-page='admin'] .admin-inline-actions {
  align-items: center;
}

body[data-page='admin'] .outline-btn,
body[data-page='admin'] .admin-btn {
  min-height: 46px;
}

@media (max-width: 992px) {
  .logo {
    order: 1;
    max-width: calc(100vw - 180px);
  }

  .header-actions {
    order: 2;
    margin-inline-start: 0;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .menu-toggle {
    order: 3;
  }

  #loginButton {
    display: inline-flex;
    padding: 10px 12px;
    font-size: 12px;
    min-width: 0;
  }

  .mobile-profile {
    padding: 8px 10px;
    max-width: 148px;
  }

  .logo-text {
    font-size: 14px;
    max-width: 170px;
  }

  .logo-text span {
    font-size: 9px;
  }

  body.lang-en .logo {
    max-width: calc(100vw - 180px);
  }

  body.lang-en .logo-text {
    font-size: 12px;
    max-width: 160px;
  }

  body.lang-en .logo-text span {
    font-size: 8px;
  }

  .main-nav {
    right: 10px;
    left: 10px;
    top: 74px;
  }
}

@media (max-width: 768px) {
  .header-container {
    gap: 6px;
  }

  .logo {
    max-width: calc(100vw - 126px);
  }

  .logo-img,
  .logo img {
    width: 36px;
    height: 36px;
  }

  .logo-text {
    font-size: 13px;
    max-width: 118px;
  }

  .logo-text span {
    display: none;
  }

  body.lang-en .logo {
    max-width: calc(100vw - 126px);
  }

  body.lang-en .logo-text {
    font-size: 11px;
    max-width: 112px;
  }

  .lang-switch {
    padding: 3px;
  }

  .lang-btn {
    min-width: 34px;
    padding: 7px 8px;
  }

  #loginButton {
    padding: 9px 10px;
    font-size: 11px;
    gap: 5px;
  }

  .mobile-profile {
    max-width: 116px;
    padding: 7px 8px;
    gap: 6px;
  }

  .mobile-profile .user-avatar {
    width: 32px;
    height: 32px;
  }

  .mobile-profile .user-name {
    font-size: 11px;
  }

  .mobile-profile .user-role {
    font-size: 10px;
  }

  .admin-shell {
    padding-top: 86px;
  }

  .admin-card {
    padding: 20px 16px;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .dashboard-stat {
    padding: 14px;
    border-radius: 18px;
  }

  .dashboard-stat-value {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .logo {
    max-width: calc(100vw - 114px);
  }

  .logo-text {
    font-size: 12px;
    max-width: 102px;
  }

  body.lang-en .logo-text {
    font-size: 10px;
    max-width: 98px;
  }

  .header-actions {
    gap: 4px;
  }

  .lang-btn {
    min-width: 30px;
    padding: 6px 7px;
    font-size: 10px;
  }

  #loginButton {
    padding: 8px 9px;
    font-size: 10px;
  }

  .mobile-profile {
    max-width: 104px;
  }
}


/* === v4 teacher lesson pages === */
.teacher-link{
  color:inherit;
  text-decoration:none;
  display:block;
}
.teacher-link .teacher-body{
  padding-bottom:12px;
}
.teacher-link-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 20px 18px;
  border-top:1px solid rgba(20,38,74,0.08);
  color:#1f57c3;
  font-weight:700;
}
.teacher-link-row i{
  font-size:18px;
}
#teachers .compact{
  max-width:720px;
  margin-bottom:28px;
}
.teacher-page-hero{
  min-height:60vh;
}
.teacher-overview-section{
  margin-top:-40px;
  position:relative;
  z-index:2;
}
.teacher-profile-card{
  display:grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap:32px;
  align-items:center;
}
.teacher-profile-media{
  display:flex;
  justify-content:center;
}
.teacher-profile-photo{
  width:100%;
  max-width:280px;
  aspect-ratio:1/1;
  object-fit:cover;
  border-radius:28px;
  box-shadow:0 24px 50px rgba(12,30,68,0.16);
}
.teacher-profile-content h2{
  margin-bottom:10px;
}
.teacher-page-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 14px;
  border-radius:999px;
  background:rgba(47,124,246,0.12);
  color:#1d4cb0;
  font-weight:700;
  margin-bottom:18px;
}
.teacher-page-subject{
  font-size:18px;
  font-weight:700;
  color:#14386c;
  margin-bottom:12px;
}
.teacher-profile-actions{
  margin-top:18px;
}
.teacher-page .lesson-card video{
  aspect-ratio:16/9;
  object-fit:cover;
}
.teacher-help{
  margin-top:10px;
}
@media (max-width: 992px){
  .teacher-profile-card{
    grid-template-columns:1fr;
    text-align:center;
  }
  .teacher-profile-actions{
    display:flex;
    justify-content:center;
  }
}
@media (max-width: 768px){
  .teacher-link-row{
    padding:12px 16px 16px;
  }
  .teacher-profile-photo{
    max-width:220px;
    border-radius:22px;
  }
  .teacher-overview-section{
    margin-top:-10px;
  }
}


/* =====================================================
   2026-03-31 v5 responsive + admin + teacher polish
   ===================================================== */
:root{
  --header-height-v5: 82px;
}

header{
  padding: 8px 0 !important;
}

.header-container{
  display:grid !important;
  grid-template-columns:auto 1fr auto auto;
  align-items:center;
  gap:14px;
  min-height:64px;
}

.logo{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  max-width:none;
}

.logo-img,
.logo img{
  width:40px;
  height:40px;
  flex:0 0 40px;
}

.logo-text{
  display:block !important;
  font-size:15px !important;
  font-weight:800;
  line-height:1.1;
  max-width:220px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.logo-text span{
  display:none !important;
}

.main-nav{
  justify-self:center;
}

.nav-list{
  gap:8px;
}

.nav-list a,
.dept-toggle{
  min-height:42px;
  padding:10px 14px;
}

.header-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

#loginButton{
  min-height:42px;
  padding:10px 14px;
  font-size:13px;
}

.hero{
  padding:120px 20px 48px;
  min-height:78vh;
}

.hero-content{
  max-width:760px;
  margin-inline:auto;
}

.hero-content h1,
.hero-content h2{
  font-size:clamp(34px, 5.8vw, 66px);
  line-height:1.05;
}

.hero-content p{
  max-width:720px;
  margin-inline:auto;
}

.main-nav .submenu{
  min-width:210px;
}

.teacher-card{
  border-radius:24px;
  overflow:hidden;
}

.teacher-photo{
  width:100%;
  aspect-ratio: 5 / 4;
  height:auto !important;
  min-height:220px;
  object-fit:cover;
  object-position:center top;
  display:block;
  margin:0;
  border:none;
  border-radius:0;
}

.teacher-body{
  min-height:110px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:10px;
}

.teacher-name{
  font-size:18px;
  line-height:1.45;
}

.teacher-meta{
  min-height:32px;
  justify-content:center;
}

.teacher-link-row{
  padding:14px 18px 18px;
}

.admin-shell{
  padding-top:110px;
  padding-bottom:60px;
  background:linear-gradient(180deg,#eef4ff 0%,#f8fbff 48%,#eef3ff 100%);
}

.admin-header{
  gap:18px;
}

.admin-panel{
  display:flex;
  flex-direction:column;
  gap:24px;
}

.admin-card{
  background:rgba(255,255,255,0.96);
  border:1px solid rgba(33,88,184,0.08);
  border-radius:26px;
  box-shadow:0 22px 54px rgba(13,39,88,0.08);
}

.lesson-form-grid{
  gap:18px;
}

.lesson-form-grid input,
.lesson-form-grid select,
.lesson-form-grid textarea{
  min-height:52px;
  border-radius:16px;
}

.lesson-form-grid textarea{
  min-height:140px;
}

.target-preview{
  margin-top:10px;
  padding:14px 16px;
  border-radius:16px;
  background:linear-gradient(180deg, rgba(33,88,184,0.08), rgba(33,88,184,0.03));
  border:1px dashed rgba(33,88,184,0.2);
  color:var(--primary);
  font-weight:700;
  line-height:1.7;
}

.target-preview span{
  display:inline-block;
  margin-top:4px;
  font-weight:600;
  color:var(--muted);
  font-size:13px;
  word-break:break-all;
}

body.has-auth-user #loginButton{
  display:none !important;
}

body.has-auth-user .mobile-profile,
body.has-auth-user .desktop-profile{
  display:flex;
}

.social-links a{
  width:46px;
  height:46px;
}

.map-info-row p,
.footer-section p{
  line-height:1.8;
}

body.lang-en{
  letter-spacing:0;
}

body.lang-en .header-container,
body.lang-en .logo,
body.lang-en .header-actions,
body.lang-en .nav-list,
body.lang-en .main-nav,
body.lang-en .lesson-section-head,
body.lang-en .hero-actions,
body.lang-en .map-info-row,
body.lang-en .social-links{
  direction:rtl !important;
}

body.lang-en .logo-text,
body.lang-en .hero-content,
body.lang-en .section,
body.lang-en .footer-section,
body.lang-en .map-details,
body.lang-en .teacher-body,
body.lang-en .admin-card,
body.lang-en .dashboard-note{
  text-align:left;
}

@media (max-width: 1100px){
  .header-container{
    grid-template-columns:auto 1fr auto;
  }
  .main-nav{
    position:fixed;
    top:78px;
    right:14px;
    left:14px;
    width:auto;
  }
}

@media (max-width: 992px){
  header{
    padding:10px 0 !important;
  }
  .header-container{
    grid-template-columns:minmax(0,1fr) auto auto;
    gap:10px;
  }
  .logo{
    max-width:none;
  }
  .logo-img,
  .logo img{
    width:38px;
    height:38px;
    flex-basis:38px;
  }
  .logo-text{
    max-width:170px;
    font-size:14px !important;
  }
  .header-actions{
    gap:6px;
  }
  .desktop-profile{
    display:none !important;
  }
  .mobile-profile{
    display:none;
    min-width:0;
    max-width:150px;
    padding:8px 10px;
  }
  #loginButton{
    min-height:40px;
    padding:9px 12px;
  }
  .hero{
    min-height:72svh;
    padding-top:118px;
    padding-bottom:34px;
  }
  .hero-content{
    padding:0;
  }
  .hero-actions{
    justify-content:center;
  }
  .section{
    padding:32px 22px;
    margin-bottom:28px;
  }
  .principal-wrap,
  .teacher-profile-card{
    grid-template-columns:1fr;
    gap:22px;
  }
  .teacher-photo{
    min-height:200px;
  }
  .admin-header{
    flex-direction:column;
    align-items:stretch;
  }
  .admin-inline-actions{
    justify-content:space-between;
    flex-wrap:wrap;
  }
}

@media (max-width: 768px){
  .header-container{
    grid-template-columns:minmax(0,1fr) auto auto;
    gap:8px;
    min-height:58px;
  }
  .logo-img,
  .logo img{
    width:34px;
    height:34px;
    flex-basis:34px;
  }
  .logo-text{
    max-width:148px;
    font-size:12.5px !important;
  }
  .lang-switch{
    padding:3px;
  }
  .lang-btn{
    min-width:32px;
    padding:6px 7px;
    font-size:11px;
  }
  #loginButton{
    font-size:11px;
    padding:8px 10px;
  }
  .mobile-profile{
    max-width:122px;
    padding:7px 8px;
    border-radius:14px;
  }
  .mobile-profile .user-avatar{
    width:30px;
    height:30px;
  }
  .mobile-profile .user-name{
    font-size:11px;
  }
  .mobile-profile .user-role{
    font-size:9px;
  }
  .main-nav{
    top:72px;
    right:10px;
    left:10px;
    border-radius:22px;
    max-height:calc(100svh - 90px);
    overflow:auto;
  }
  .nav-list{
    flex-direction:column;
    align-items:stretch;
    padding:14px;
    gap:8px;
  }
  .nav-list a,
  .dept-toggle{
    width:100%;
    justify-content:space-between;
    border-radius:14px;
    padding:12px 14px;
    min-height:46px;
  }
  .hero{
    min-height:70svh;
    padding:108px 18px 30px;
  }
  .hero-content h1,
  .hero-content h2{
    font-size:clamp(28px, 8vw, 42px);
  }
  .hero-content p{
    font-size:15px;
    line-height:1.9;
  }
  .hero-actions{
    flex-direction:column;
    align-items:stretch;
    gap:10px;
  }
  .hero-actions > *{
    width:100%;
    justify-content:center;
  }
  .section-title{
    font-size:24px;
  }
  .media-container,
  .stats-container,
  .departments-grid,
  .quick-grid,
  .teachers-grid,
  .footer-content,
  .map-grid,
  .dashboard-grid{
    grid-template-columns:1fr !important;
  }
  .teacher-card,
  .lesson-card,
  .quick-card,
  .map-card{
    border-radius:20px;
  }
  .teacher-photo{
    min-height:188px;
  }
  .teacher-name{
    font-size:17px;
  }
  .comment-form,
  .map-details,
  .admin-card{
    padding:20px 16px;
  }
  .lesson-form-grid{
    grid-template-columns:1fr !important;
  }
  .admin-inline-actions > *{
    width:100%;
    justify-content:center;
  }
}

@media (max-width: 480px){
  .logo-text{
    max-width:122px;
    font-size:11.5px !important;
  }
  .header-actions{
    gap:4px;
  }
  .hero{
    min-height:66svh;
  }
  .section{
    padding:26px 16px;
    border-radius:18px;
  }
  .section-title{
    font-size:22px;
  }
  .teacher-photo{
    min-height:176px;
  }
}
