:root {
  --ini-navy: #021d49;
  --ini-gold: #c89211;
  --ini-gold-2: #cf8a00;
  --ini-light-gold: #fcd672;
  --ini-brown: #8e5928;
  --ini-white: #ffffff;
  --ini-black: #000000;
  --font-en: Georgia, "Times New Roman", Times, serif;
  --font-ar: 'Tajawal', 'Cairo', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-en);
  background: var(--ini-white);
  color: var(--ini-navy);
  line-height: 1.6;
  font-size: 18px;
}

html[lang="ar"] body {
  font-family: var(--font-ar);
  direction: rtl;
  text-align: right;
}

/* Typography Scale */
h1 {
  font-size: 40px;
  line-height: 44px;
  margin: 0 0 1rem 0;
  font-weight: bold;
}

h2 {
  font-size: 28px;
  line-height: 34px;
  margin: 0 0 1.5rem 0;
  font-weight: bold;
}

h3 {
  font-size: 20px;
  line-height: 26px;
  margin: 0 0 0.5rem 0;
  font-weight: bold;
}

p {
  font-size: 18px;
  line-height: 28px;
  margin: 0 0 1rem 0;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: 24px;
}

/* Passage Card Styling for Reading Comprehension */
.passage-card {
  background: var(--ini-white);
  border: 2px solid var(--ini-gold);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.passage-header {
  border-bottom: 2px solid var(--ini-light-gold);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.passage-title {
  color: var(--ini-navy);
  font-size: 24px;
  font-weight: bold;
  margin: 0 0 8px 0;
}

.passage-range-label {
  color: var(--ini-brown);
  font-size: 16px;
  font-weight: 600;
  background: var(--ini-light-gold);
  padding: 6px 12px;
  border-radius: 6px;
  display: inline-block;
}

.passage-content {
  line-height: 1.8;
}

.passage-text {
  color: var(--ini-navy);
  font-size: 18px;
  text-align: justify;
  padding: 0;
}

.passage-text p {
  margin-bottom: 16px;
}

.range-label {
  background: var(--ini-light-gold);
  color: var(--ini-brown);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
  font-size: 16px;
}

/* Header */
.header {
  background: var(--ini-navy);
  color: var(--ini-white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* Remove all blue space around logo */
  padding-block: 0;
  padding-inline: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  /* Ensure header container is relative for absolute positioning */
  position: relative;
}

/* Header Actions Container */
.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  position: relative;
}

/* Account Buttons */
.account-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.account-btn {
  background: transparent;
  border: 1px solid var(--ini-white);
  color: var(--ini-white);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}

.account-btn:hover,
.account-btn:focus {
  background: #E3B23C;
  color: #0b2a53;
  border-color: #E3B23C;
  outline: 2px solid #E3B23C;
  outline-offset: 2px;
}

.account-btn.signin .user-icon {
  font-size: 12px;
}

/* Mobile Account Dropdown */
.account-dropdown {
  position: relative;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dropdown-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.dropdown-trigger[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--ini-navy);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 0.5rem 0;
  min-width: 120px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 110;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.dropdown-menu[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--ini-white);
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.2s ease;
  font-family: inherit;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(227, 178, 60, 0.2);
  outline: 2px solid rgba(227, 178, 60, 0.8);
  outline-offset: -2px;
}

/* Responsive Behavior */
.desktop-only {
  display: flex;
}

.mobile-only {
  display: none;
}

@media (max-width: 639px) {
  .desktop-only {
    display: none;
  }
  
  .mobile-only {
    display: block;
  }
  
  .header-actions {
    align-items: center;
    gap: 0.75rem;
  }
}

/* INI Top Title */
#ini-top-title {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-family: "Tajawal", "Noto Sans Arabic", sans-serif;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  z-index: 10;
  text-align: center;
  pointer-events: none;
  font-size: clamp(18px, 2.2vw, 32px);
}

@media (max-width: 380px) {
  #ini-top-title { display: none; }
}

/* INI crest sizing */
.logo { height: 168px; width: auto; cursor: pointer; }

/* Tablet */
@media (max-width: 1199px) {
  .logo { height: 120px; }
}

/* Mobile */
@media (max-width: 767px) {
  .logo { height: 100px; }
}

.nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.nav a {
  color: var(--ini-white);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}

.nav a:hover {
  color: var(--ini-light-gold);
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* Language toggle font size increase for better prominence */
  font-size: 16px;
}

.lang-toggle button {
  background: none;
  border: none;
  color: var(--ini-white);
  font-weight: 700;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.3s;
  opacity: 0.8;
}

.lang-toggle button:hover {
  color: var(--ini-light-gold);
  opacity: 1;
}

.lang-toggle button[aria-current="true"] {
  text-decoration: underline;
  opacity: 1;
}

/* Hero Section */
.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  background: linear-gradient(135deg, var(--ini-navy), var(--ini-gold-2));
  color: var(--ini-white);
  padding: 4rem 2rem;
  align-items: center;
  min-height: 60vh;
}

/* EN-only column swap - Assessment teaser section */
html[lang="en"] .hero {
  flex-direction: row-reverse;
}

.hero-text {
  flex: 1;
  min-width: 300px;
}

.hero-text h1 {
  margin-bottom: 1.5rem;
}

.hero-text p {
  margin-bottom: 2rem;
  font-size: 20px;
  opacity: 0.9;
}

.hero-video {
  flex: 1;
  min-width: 280px;
}

.hero-video video {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s;
  font-size: 16px;
  border: 2px solid transparent;
}

.btn.primary {
  background: var(--ini-gold);
  color: var(--ini-navy);
}

.btn.primary:hover {
  background: var(--ini-light-gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(200, 146, 17, 0.3);
}

.btn.secondary {
  background: transparent;
  color: var(--ini-white);
  border-color: var(--ini-white);
}

.btn.secondary:hover {
  background: var(--ini-white);
  color: var(--ini-navy);
}

/* Sections */
.about, .features, .testimonials, .contact {
  padding: 3rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.about {
  background: var(--ini-white);
  position: relative;
  overflow: hidden;
}

.about::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  background-image: url('assets/main-logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.05;
  z-index: -1;
}

.about h2 {
  text-align: center;
  color: var(--ini-navy);
  margin-bottom: 2rem;
}

.about > p {
  text-align: center;
  font-size: 20px;
  margin-bottom: 3rem;
  color: var(--ini-brown);
}

.values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.features h2 {
  text-align: center;
  color: var(--ini-navy);
  margin-bottom: 3rem;
}

/* Cards */
.card {
  background: var(--ini-light-gold);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  text-align: center;
  transition: all 0.3s;
  border: 1px solid rgba(200, 146, 17, 0.2);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.values .card {
  background: var(--ini-navy);
  color: var(--ini-white);
  font-weight: bold;
  font-size: 18px;
  padding: 1.5rem;
}

.features .card img {
  width: 48px;
  height: 120px;
  margin-bottom: 1rem;
}

.features .card h3 {
  color: var(--ini-navy);
  margin-bottom: 1rem;
}

.features .card p {
  color: var(--ini-brown);
  font-size: 16px;
}

.tagline {
  text-align: center;
  font-style: italic;
  font-size: 20px;
  color: var(--ini-gold-2);
  font-weight: bold;
}

/* Testimonials */
.testimonials {
  background: linear-gradient(45deg, var(--ini-navy), var(--ini-brown));
  color: var(--ini-white);
}

.testimonials h2 {
  text-align: center;
  margin-bottom: 3rem;
}

.testimonials blockquote {
  background: rgba(255, 255, 255, 0.1);
  padding: 2rem;
  border-radius: 16px;
  margin: 2rem 0;
  font-size: 18px;
  border-left: 4px solid var(--ini-light-gold);
  backdrop-filter: blur(10px);
}

html[lang="ar"] .testimonials blockquote {
  border-left: none;
  border-right: 4px solid var(--ini-light-gold);
}

/* Contact */
.contact {
  background: var(--ini-white);
}

.contact h2 {
  text-align: center;
  color: var(--ini-navy);
  margin-bottom: 2rem;
}

.contact p {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 18px;
}

.contact a {
  color: var(--ini-gold);
  text-decoration: none;
  font-weight: bold;
}

.contact a:hover {
  color: var(--ini-gold-2);
  text-decoration: underline;
}

/* Footer */
.footer {
  background: var(--ini-navy);
  color: var(--ini-white);
  text-align: center;
  padding: 2rem;
}

/* ===== Hamburger Menu (Mobile Only) ===== */
/* Hamburger button - hidden on desktop */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  position: relative;
  z-index: 1001;
}

.hamburger-line {
  width: 100%;
  height: 3px;
  background: var(--ini-white);
  border-radius: 10px;
  transition: all 0.3s ease;
}

/* Hamburger animation when menu is open */
.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Navigation overlay (dark background) */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-overlay.active {
  opacity: 1;
}

/* Close button inside nav menu (mobile) */
.nav-close-btn {
  display: none;
  position: absolute;
  top: 15px;
  left: 15px;
  background: transparent;
  border: none;
  color: var(--ini-white);
  font-size: 36px;
  font-weight: 300;
  cursor: pointer;
  width: 40px;
  height: 40px;
  padding: 0;
  line-height: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
  }
  
  /* Show hamburger button on mobile */
  .hamburger-btn {
    display: flex;
  }
  
  /* Hide and transform nav into slide-in sidebar */
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--ini-navy);
    padding: 60px 20px 20px;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
  }
  
  /* Show nav when active */
  .nav.active {
    right: 0;
  }
  
  /* Show close button on mobile */
  .nav-close-btn {
    display: block;
  }
  
  /* Show overlay when active */
  .nav-overlay.active {
    display: block;
  }
  
  .nav ul {
    flex-direction: column;
    gap: 0rem;
    text-align: right;
    margin-top: 20px;
  }
  
  .nav ul li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .nav ul li a {
    display: block;
    padding: 1rem 0.5rem;
    font-size: 18px;
  }
  
  .hero {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1rem;
  }
  
  h1 {
    font-size: 32px;
    line-height: 38px;
  }
  
  h2 {
    font-size: 24px;
    line-height: 30px;
  }
  
  .values {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .values {
    grid-template-columns: 1fr;
  }
  
  h1 {
    font-size: 28px;
    line-height: 34px;
  }
  
  .about, .features, .testimonials, .contact {
    padding: 2rem 1rem;
  }
}

/* Animation for section reveals */
.card, .testimonials blockquote {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* RTL specific adjustments */
html[lang="ar"] .hero {
  text-align: right;
}

html[lang="ar"] .about > p,
html[lang="ar"] .tagline,
html[lang="ar"] .contact p,
html[lang="ar"] .features h2,
html[lang="ar"] .testimonials h2 {
  text-align: right;
}

html[lang="ar"] .card {
  text-align: right;
}

html[lang="ar"] .features .card {
  text-align: center;
}

/* Cache control for development */
video, img {
  cache-control: no-cache;
}