/* STEM Grade Portal Stylesheet */

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

:root {
  --stem-main: #0b0f19;
  --stem-card: rgba(17, 28, 51, 0.65);
  --stem-border: rgba(255, 255, 255, 0.08);
  --stem-accent: #0d9488;
  --stem-accent-glow: rgba(13, 148, 136, 0.15);
  --stem-text-title: #f8fafc;
  --stem-text-body: #cbd5e1;
  --stem-gold: #f59e0b;
}

.stem-grade-wrapper {
  color: var(--stem-text-body);
  font-family: "Poppins", sans-serif;
  padding-top: 90px;
  padding-bottom: 70px;
  overflow-x: hidden;
  position: relative;
}

.stem-grade-wrapper[dir="rtl"] {
  font-family: "Cairo", sans-serif;
  direction: rtl;
  text-align: right;
}

.stem-grade-wrapper h1,
.stem-grade-wrapper h2,
.stem-grade-wrapper h3,
.stem-grade-wrapper h4 {
  font-family: "Outfit", sans-serif;
  color: var(--stem-text-title);
  letter-spacing: -0.02em;
}

.stem-grade-wrapper[dir="rtl"] h1,
.stem-grade-wrapper[dir="rtl"] h2,
.stem-grade-wrapper[dir="rtl"] h3,
.stem-grade-wrapper[dir="rtl"] h4,
.stem-grade-wrapper[dir="rtl"] p,
.stem-grade-wrapper[dir="rtl"] span,
.stem-grade-wrapper[dir="rtl"] a {
  font-family: "Cairo", sans-serif;
}

/* Background Glowing Blobs */
.stem-glow-blob {
  position: absolute;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.08) 0%, rgba(13, 148, 136, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.blob-1 {
  top: 5%;
  left: -200px;
}

.blob-2 {
  top: 45%;
  right: -200px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.04) 0%, rgba(245, 158, 11, 0) 70%);
}

.stem-container {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Quick Navigator Back Button */
.stem-quick-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 6px 16px;
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.84rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 36px;
}

.stem-quick-back:hover {
  background: rgba(13, 148, 136, 0.15);
  border-color: rgba(13, 148, 136, 0.35);
  color: #5eead4;
  transform: translateX(-3px);
  box-shadow: 0 0 15px rgba(13, 148, 136, 0.25);
}

.stem-grade-wrapper[dir="rtl"] .stem-quick-back i {
  transform: scaleX(-1);
}

/* Hero Section */
.stem-grade-hero {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 55px auto;
  position: relative;
}

.stem-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(13, 148, 136, 0.1);
  border: 1px solid rgba(13, 148, 136, 0.25);
  color: var(--stem-accent);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

.stem-grade-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin: 14px 0;
  background: linear-gradient(135deg, #ffffff 50%, var(--stem-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stem-grade-hero p {
  font-size: 0.96rem;
  line-height: 1.65;
  color: #94a3b8;
}

/* Info Grid */
.stem-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 65px;
}

.stem-info-card {
  background: var(--stem-card);
  border: 1px solid var(--stem-border);
  border-radius: 16px;
  padding: 24px 20px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.stem-info-card:hover {
  transform: translateY(-4px);
  border-color: rgba(13, 148, 136, 0.4);
  box-shadow: 0 15px 35px rgba(13, 148, 136, 0.08);
}

.stem-info-icon {
  font-size: 2rem;
  color: var(--stem-accent);
  margin-bottom: 16px;
  display: inline-block;
  filter: drop-shadow(0 0 10px rgba(13, 148, 136, 0.3));
}

.stem-info-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--stem-text-title);
}

.stem-info-card p {
  font-size: 0.86rem;
  line-height: 1.6;
  color: #94a3b8;
}

/* Section Header */
.stem-section-header {
  text-align: center;
  margin-bottom: 45px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stem-section-header h2 {
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 60%, var(--stem-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.stem-section-header::after {
  content: '';
  display: block;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--stem-accent), transparent);
  margin-bottom: 12px;
  box-shadow: 0 0 8px rgba(13, 148, 136, 0.4);
}

.stem-section-header p {
  font-size: 0.9rem;
  color: #94a3b8;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Subjects Grid */
.stem-subjects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 60px;
}

.stem-subject-card {
  background: var(--stem-card);
  border: 1px solid var(--stem-border);
  border-radius: 16px;
  padding: 24px 20px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.stem-subject-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--stem-accent);
  opacity: 0.8;
  transition: all 0.3s ease;
}

.stem-grade-wrapper[dir="rtl"] .stem-subject-card::before {
  left: auto;
  right: 0;
}

.stem-subject-card:hover {
  border-color: rgba(13, 148, 136, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

.stem-subject-card:hover::before {
  width: 5px;
  box-shadow: 0 0 12px var(--stem-accent);
}

.stem-subject-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.stem-subject-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--stem-text-title);
}

.stem-subject-icon {
  font-size: 1.35rem;
  color: var(--stem-accent);
  filter: drop-shadow(0 0 6px rgba(13, 148, 136, 0.25));
}

.stem-subject-card p {
  font-size: 0.86rem;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 20px;
  flex-grow: 1;
}

.stem-materials-hub {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 16px;
}

.stem-materials-hub h5 {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 10px;
  font-weight: 600;
}

.stem-materials-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stem-material-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 9px 8px;
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.stem-material-btn:hover {
  background: rgba(13, 148, 136, 0.15);
  border-color: rgba(13, 148, 136, 0.35);
  color: #5eead4;
  box-shadow: 0 0 10px rgba(13, 148, 136, 0.15);
}

.stem-material-btn i {
  font-size: 0.82rem;
}

/* Call to Action Box */
.stem-cta-box {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.15) 0%, rgba(17, 28, 51, 0.45) 100%);
  border: 1px solid rgba(13, 148, 136, 0.3);
  border-radius: 20px;
  padding: 36px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  margin-bottom: 30px;
}

.stem-cta-box h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--stem-text-title);
}

.stem-cta-box p {
  font-size: 0.92rem;
  color: #cbd5e1;
  max-width: 580px;
  margin: 0 auto 22px auto;
  line-height: 1.6;
}

.stem-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 24px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.stem-btn-primary {
  background: var(--stem-accent);
  color: #ffffff;
  border: none;
  box-shadow: 0 0 18px rgba(13, 148, 136, 0.3);
}

.stem-btn-primary:hover {
  background: #14b8a6;
  box-shadow: 0 0 25px rgba(13, 148, 136, 0.45);
  transform: translateY(-2px);
}

/* Responsiveness */
@media screen and (max-width: 1024px) {
  .stem-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stem-subjects-grid {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 640px) {
  .stem-grade-wrapper {
    padding-top: 75px;
    padding-bottom: 40px;
  }

  .stem-grade-hero h1 {
    font-size: 1.85rem;
  }

  .stem-grade-hero p {
    font-size: 0.88rem;
  }

  .stem-section-header h2 {
    font-size: 1.4rem;
  }

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

  .stem-info-card {
    padding: 20px;
  }

  .stem-subject-card {
    padding: 20px;
  }

  .stem-materials-links {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .stem-material-btn {
    padding: 8px 4px;
    font-size: 0.72rem;
    gap: 4px;
  }

  .stem-cta-box {
    padding: 28px 18px;
  }

  .stem-cta-box h3 {
    font-size: 1.25rem;
  }

  .stem-cta-box p {
    font-size: 0.85rem;
  }

  .stem-btn {
    width: 100%;
  }
}