/* ============================================================
   MAIN.CSS — سنتر الأستاذ
   Base styles, variables, typography, layout
   ============================================================ */

/* ---- CSS Custom Properties ---- */
:root {
  /* Colors */
  --clr-primary:       #047857;
  --clr-primary-dark:  #065f46;
  --clr-primary-light: #059669;
  --clr-accent:        #d97706;
  --clr-accent-light:  #f59e0b;

  --clr-bg:            #f4fbf8;
  --clr-bg-alt:        #eaf7f2;
  --clr-surface:       #ffffff;

  --clr-text:          #062017;
  --clr-text-muted:    #374151;
  --clr-text-light:    #6b7280;

  --clr-border:        #d1d5db;
  --clr-border-light:  #e5e7eb;

  /* Typography */
  --font-primary: 'Cairo', 'Tajawal', sans-serif;
  --font-size-xs:   0.75rem;
  --font-size-sm:   0.875rem;
  --font-size-base: 1rem;
  --font-size-md:   1.125rem;
  --font-size-lg:   1.25rem;
  --font-size-xl:   1.5rem;
  --font-size-2xl:  1.875rem;
  --font-size-3xl:  2.25rem;
  --font-size-4xl:  3rem;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs:  0 1px 3px rgba(4, 120, 87,0.06);
  --shadow-sm:  0 2px 8px rgba(4, 120, 87,0.08);
  --shadow-md:  0 4px 16px rgba(4, 120, 87,0.10);
  --shadow-lg:  0 8px 32px rgba(4, 120, 87,0.12);
  --shadow-xl:  0 16px 48px rgba(4, 120, 87,0.14);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;

  /* Layout */
  --container-max: 1200px;
  --navbar-h:      72px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth !important;
  scroll-padding-top: var(--navbar-h);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  max-width: 100vw;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  color: var(--clr-text);
  background-color: var(--clr-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  max-width: 100vw;
}

/* انيميشن ناعم وبسيط للعناصر الأساسية */
a, button, input, select, textarea {
  transition: all var(--transition-base) !important;
}

/* منع double-tap zoom على الموبايل */
button, [role="button"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, select, textarea {
  font-family: inherit;
}

/* ---- Container ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* ---- Section Base ---- */
.section {
  padding-block: var(--space-24);
}

.section--alt {
  background-color: var(--clr-bg-alt);
}

/* ---- Section Header ---- */
.section-header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.section-label {
  display: inline-block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--clr-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
  position: relative;
  padding-inline: var(--space-4);
}

.section-label::before,
.section-label::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 24px;
  height: 1.5px;
  background: var(--clr-primary);
  opacity: 0.4;
}

.section-label::before { right: 100%; margin-right: -var(--space-2); }
.section-label::after  { left: 100%; margin-left: -var(--space-2); }

.section-title {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: var(--clr-text);
  line-height: 1.25;
  margin-bottom: var(--space-4);
}

.section-desc {
  font-size: var(--font-size-md);
  color: var(--clr-text-muted);
  max-width: 560px;
  margin-inline: auto;
  line-height: 1.8;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: 600;
  font-family: var(--font-primary);
  transition: all var(--transition-base);
  cursor: pointer;
  border: 2px solid transparent;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition-fast);
}

.btn:hover::after {
  background: rgba(255,255,255,0.08);
}

.btn--primary {
  background: var(--clr-primary);
  color: #fff;
  border-color: var(--clr-primary);
  box-shadow: 0 2px 12px rgba(4, 120, 87,0.25);
}

.btn--primary:hover {
  background: var(--clr-primary-dark);
  border-color: var(--clr-primary-dark);
  box-shadow: 0 4px 20px rgba(4, 120, 87,0.35);
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(4, 120, 87,0.2);
}

.btn--outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.6);
}

.btn--outline:hover {
  background: rgba(255,255,255,0.12);
  border-color: #fff;
}

.btn--outline-dark {
  background: transparent;
  color: var(--clr-primary);
  border-color: var(--clr-primary);
}

.btn--outline-dark:hover {
  background: var(--clr-primary);
  color: #fff;
}

.btn--lg {
  padding: 0.85rem 2rem;
  font-size: var(--font-size-md);
}

.btn--full {
  width: 100%;
  justify-content: center;
}

/* ---- Navbar ---- */
.navbar {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 1000;
  height: var(--navbar-h);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: all 0.4s ease-in-out !important;
}

.navbar.scrolled {
  border-bottom-color: var(--clr-border);
  box-shadow: var(--shadow-sm);
  background: rgba(255, 255, 255, 0.98);
}

.navbar__inner {
  display: flex;
  align-items: center;
  height: var(--navbar-h);
  gap: var(--space-8);
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.logo-mark {
  width: 42px;
  height: 42px;
  background: var(--clr-primary);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  flex-shrink: 0;
  transition: transform var(--transition-base);
}

.navbar__logo:hover .logo-mark {
  transform: rotate(-5deg) scale(1.05);
}

.logo-text strong {
  display: block;
  font-size: var(--font-size-base);
  font-weight: 800;
  color: var(--clr-text);
  line-height: 1.2;
}

.logo-text small {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--clr-text-muted);
  font-weight: 400;
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-inline-start: auto;
}

.navbar__links a {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--clr-text-muted);
  transition: color var(--transition-fast);
  position: relative;
  padding-bottom: 2px;
}

.navbar__links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--clr-primary);
  border-radius: 2px;
  transition: width var(--transition-base);
}

.navbar__links a:hover {
  color: var(--clr-primary);
  transform: translateY(-2px);
}

.navbar__links a:hover::after {
  width: 100%;
}

.navbar__cta {
  margin-inline-start: var(--space-4);
  flex-shrink: 0;
}

.navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  margin-inline-start: auto;
}

.navbar__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--clr-text);
  border-radius: 2px;
  transition: all var(--transition-base);
}

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  will-change: transform;
}

/* overlay متوازن — يغطي الصورة بالكامل بشكل متساوٍ */
.hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 30, 20, 0.72);
}

.hero .container {
  position: relative;
  z-index: 1;
  padding-top: calc(var(--navbar-h) + var(--space-20));
  padding-bottom: var(--space-20);
}

.hero__content {
  max-width: 700px;
  margin-inline: auto;
  text-align: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.88);
  font-size: var(--font-size-sm);
  font-weight: 500;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
  backdrop-filter: blur(8px);
  letter-spacing: 0.02em;
}

.hero__title {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.35;
  margin-bottom: var(--space-5);
  letter-spacing: -0.01em;
}

.hero__title em {
  font-style: normal;
  color: var(--clr-accent-light);
}

.hero__desc {
  font-size: var(--font-size-md);
  color: rgba(255,255,255,0.78);
  line-height: 1.9;
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

.hero__actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: var(--space-10);
}

.hero__stats {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  flex-wrap: wrap;
  justify-content: center;
  padding: var(--space-5) var(--space-10);
  background: var(--clr-surface) !important;
  border: none !important;
  border-radius: var(--radius-lg) !important;
  backdrop-filter: none;
  box-shadow: var(--shadow-xl) !important;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat strong {
  font-size: var(--font-size-3xl);
  font-weight: 900;
  color: var(--clr-primary) !important;
  line-height: 1;
  text-shadow: none !important;
}

.stat span {
  font-size: var(--font-size-sm);
  color: var(--clr-text-muted) !important;
  margin-top: var(--space-2);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.stat__divider {
  width: 1.5px;
  height: 45px;
  background: var(--clr-border) !important;
}

.hero__scroll-hint {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: rgba(255,255,255,0.45);
  font-size: var(--font-size-xs);
  animation: fadeInUp 1s ease 1.5s both;
  letter-spacing: 0.05em;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid rgba(255,255,255,0.4);
  border-bottom: 2px solid rgba(255,255,255,0.4);
  transform: rotate(45deg);
  animation: scrollBounce 1.5s ease infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50%       { transform: rotate(45deg) translateY(4px); }
}

/* ---- About ---- */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

.about__visual {
  position: relative;
}

.about__img-wrap {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  aspect-ratio: 4/3;
  animation: floatImage 4s ease-in-out infinite !important;
}

@keyframes floatImage {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0px); }
}

.about__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.5s ease-in-out !important;
}

.about__img-wrap:hover img {
  transform: scale(1.05) !important;
}

.about__badge-float {
  position: absolute;
  bottom: -var(--space-6);
  left: -var(--space-6);
  background: var(--clr-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--clr-border-light);
}

.badge-num {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--clr-primary);
  line-height: 1;
}

.badge-label {
  font-size: var(--font-size-sm);
  color: var(--clr-text-muted);
  margin-top: var(--space-1);
}

.about__content .section-label {
  padding-inline-start: 0;
}

.about__content .section-label::before {
  display: none;
}

.about__content .section-title {
  text-align: start;
  margin-bottom: var(--space-5);
}

.about__content p {
  color: var(--clr-text-muted);
  margin-bottom: var(--space-4);
  line-height: 1.85;
}

.about__features {
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.about__features li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.feature-icon {
  width: 40px;
  height: 40px;
  background: rgba(4, 120, 87,0.08);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--clr-primary);
}

.feature-icon svg {
  width: 18px;
  height: 18px;
}

.about__features li strong {
  display: block;
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: 2px;
}

.about__features li span {
  font-size: var(--font-size-sm);
  color: var(--clr-text-muted);
}

/* ---- Animations ---- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Simplified animations requested by user */

/* ============================================================
   HERO — entrance animations
   ============================================================ */
.hero__badge {
  animation: fadeInUp 0.7s ease 0.2s both;
}

.hero__title {
  animation: fadeInUp 0.7s ease 0.4s both;
}

.hero__desc {
  animation: fadeInUp 0.7s ease 0.55s both;
}

.hero__actions {
  animation: fadeInUp 0.7s ease 0.7s both;
}

.hero__stats {
  animation: fadeInUp 0.7s ease 0.85s both;
}

/* ============================================================
   SECTION LABEL — decorative lines fix (CSS custom property in calc)
   ============================================================ */
.section-label::before {
  right: calc(100% + 8px);
  margin-right: 0;
}

.section-label::after {
  left: calc(100% + 8px);
  margin-left: 0;
}

/* ============================================================
   ABOUT — floating badge position fix
   ============================================================ */
.about__badge-float {
  bottom: -24px;
  left: -24px;
}

/* ============================================================
   TEACHERS — Grid layout
   ============================================================ */
.teachers__list {
  max-width: 1100px;
  margin-inline: auto;
}

/* ============================================================
   GALLERY — masonry feel
   ============================================================ */
.gallery__grid {
  border-radius: var(--radius-xl);
  overflow: hidden;
}

/* ============================================================
   TOP STUDENTS — podium effect for top 3
   ============================================================ */
.student-card--gold {
  border-top: 3px solid #f5b942;
}

.student-card--silver {
  border-top: 3px solid #b0bec5;
}

.student-card--bronze {
  border-top: 3px solid #cd7f32;
}

/* ============================================================
   BOOKING — form focus ring accessibility
   ============================================================ */
.btn:focus-visible,
.tab-btn:focus-visible,
.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible {
  outline: 3px solid rgba(4, 120, 87, 0.4);
  outline-offset: 2px;
}

/* ============================================================
   UTILITY — visually hidden (accessibility)
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ============================================================
   SCALE UP BADGE
   ============================================================ */
.scale-up-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--clr-text-muted) !important;
  font-weight: 500;
  font-size: var(--font-size-sm);
  text-decoration: none;
  transition: color 0.3s ease, transform 0.3s ease !important;
  margin-top: var(--space-2);
}

.scale-up-badge:hover {
  transform: translateY(-2px);
  color: var(--clr-primary) !important;
}

.scale-up-badge span {
  color: var(--clr-primary);
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* ============================================================
   PRINT — hide interactive elements
   ============================================================ */
@media print {
  .navbar,
  .hero__scroll-hint,
  .scroll-top,
  .lightbox,
  .modal,
  .toast {
    display: none !important;
  }
}

/* ============================================================
   ACTIVE NAV LINK — يضاف من قبل main.js
   ============================================================ */
.navbar__links a.active {
  color: var(--clr-primary);
}

.navbar__links a.active::after {
  width: 100%;
}

/* ============================================================
   PAGINATION HINT
   ============================================================ */
.pagination-hint {
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--clr-text-muted);
  margin-bottom: var(--space-4);
  font-weight: 500;
  animation: fadeIn 0.5s ease;
}

.pagination-hint span {
  color: var(--clr-primary);
  font-weight: 800;
  padding-inline: 4px;
}
