/* ========================================
   A World Leader in Education Section
   Inspired by Singapore American School
   ======================================== */

/* Section Container - fits within viewport */
.world-leader-section {
  padding: 3rem 0;
  background: var(--color-white);
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.world-leader-section .container {
  max-width: 1400px;
  overflow: visible;
  position: relative;
  z-index: 2;
}

/* ========================================
   Parallax Floating Elements - AWS Icons
   ======================================== */

.parallax-elements {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.parallax-element {
  position: absolute;
  will-change: transform;
  transition: transform 0.1s ease-out;
}

/* AWS Icon Elements */
.aws-icon {
  opacity: 0.15;
}

.aws-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Lightbulb - top left */
.icon-1 {
  width: 80px;
  height: 80px;
  top: 8%;
  left: 5%;
  animation: float-slow 8s ease-in-out infinite;
}

/* Rocket - left middle */
.icon-2 {
  width: 60px;
  height: 60px;
  top: 45%;
  left: 3%;
  animation: float-medium 6s ease-in-out infinite reverse;
}

/* Globe - bottom left */
.icon-3 {
  width: 70px;
  height: 70px;
  top: 75%;
  left: 8%;
  animation: float-slow 10s ease-in-out infinite;
}

/* Star - top center-left */
.icon-4 {
  width: 50px;
  height: 50px;
  top: 15%;
  left: 20%;
  animation: float-fast 5s ease-in-out infinite reverse;
}

/* Book - bottom center */
.icon-5 {
  width: 55px;
  height: 55px;
  top: 85%;
  left: 35%;
  animation: float-medium 7s ease-in-out infinite;
}

/* Graduation - top right area */
.icon-6 {
  width: 65px;
  height: 65px;
  top: 5%;
  right: 35%;
  animation: float-slow 9s ease-in-out infinite reverse;
}

/* Compass - right side */
.icon-7 {
  width: 45px;
  height: 45px;
  top: 30%;
  left: 12%;
  animation: float-fast 6s ease-in-out infinite;
}

/* Plant - bottom right */
.icon-8 {
  width: 60px;
  height: 60px;
  top: 70%;
  left: 25%;
  animation: float-medium 8s ease-in-out infinite reverse;
}

/* Trophy - middle left */
.icon-9 {
  width: 50px;
  height: 50px;
  top: 55%;
  left: 15%;
  animation: float-slow 7s ease-in-out infinite;
}

/* Pencil - top area */
.icon-10 {
  width: 40px;
  height: 40px;
  top: 25%;
  left: 28%;
  animation: float-fast 5.5s ease-in-out infinite reverse;
}

/* Float Animations */
@keyframes float-slow {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(3deg);
  }
}

@keyframes float-medium {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-15px) translateX(10px);
  }
}

@keyframes float-fast {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.1);
  }
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Section Header */
.world-leader-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.world-leader-title {
  font-family: 'Bebas Neue', var(--font-heading), sans-serif;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 400;
  color: var(--color-navy);
  letter-spacing: 0.03em;
  line-height: 1.05;
  margin: 0;
  will-change: transform, opacity;
}

.world-leader-title .accent {
  color: var(--color-red);
}

/* Tabs Navigation */
.world-leader-tabs {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  will-change: transform, opacity;
}

.world-leader-tab {
  position: relative;
  padding: 1.2rem 2rem 1.5rem;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 1;
}

.world-leader-tab::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 75px;
  height: 65px;
  /* Logo blue shield fill - no stroke */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 358 307'%3E%3Cpath d='M 0 47 C 121 -17 253 -16 358 52 C 341 146 298 245 178 307 C 89 255 16 167 0 47' fill='%231A365E0d'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.world-leader-tab:hover {
  color: var(--color-navy);
}

.world-leader-tab.active {
  color: var(--color-red);
}

.world-leader-tab.active::before {
  opacity: 1;
}

/* Tab Panels Container */
.world-leader-panels {
  position: relative;
  min-height: 420px;
  overflow: visible;
}

/* Individual Tab Panel */
.world-leader-panel {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.world-leader-panel.active {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  opacity: 1;
  position: relative;
  min-height: 420px;
}

/* Panel Content - Left aligned */
.world-leader-content {
  max-width: 550px;
  padding: 0;
  position: relative;
  z-index: 2;
  will-change: transform, opacity;
  text-align: left;
}

.world-leader-subtitle {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-navy);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.world-leader-description {
  font-family: var(--font-primary);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* Highlights List */
.world-leader-highlights {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem 0;
}

.world-leader-highlights li {
  position: relative;
  padding-left: 1.25rem;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-navy);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.world-leader-highlights li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 6px;
  height: 6px;
  background: var(--color-red);
  border-radius: 50%;
}

/* CTA Button */
.world-leader-cta {
  display: inline-block;
  padding: 0.9rem 1.75rem;
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-white);
  background: var(--color-red);
  border: 2px solid var(--color-red);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(200, 32, 53, 0.3);
}

.world-leader-cta:hover {
  background: var(--color-navy);
  border-color: var(--color-navy);
  color: var(--color-white);
  box-shadow: 0 6px 20px rgba(30, 58, 104, 0.35);
  transform: translateY(-2px);
}

/* Panel Image - RIGHT side, decorative background */
.world-leader-image {
  position: absolute;
  right: -40px;
  top: -40px;
  width: 700px;
  z-index: 1;
  will-change: transform, opacity;
}

.shield-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ========================================
   Scroll-Triggered Animation States
   ======================================== */

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

@keyframes fadeOutDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1600px) {
  .world-leader-image {
    right: -20px;
    top: -30px;
    width: 620px;
  }

  .world-leader-panels,
  .world-leader-panel.active {
    min-height: 420px;
  }

  .world-leader-content {
    margin-right: 360px;
  }
}

@media (max-width: 1400px) {
  .world-leader-image {
    right: 0px;
    top: -20px;
    width: 560px;
  }

  .world-leader-panels,
  .world-leader-panel.active {
    min-height: 400px;
  }

  .world-leader-content {
    margin-right: 320px;
  }
}

@media (max-width: 1200px) {
  .world-leader-image {
    right: 20px;
    top: -10px;
    width: 500px;
  }

  .world-leader-panels,
  .world-leader-panel.active {
    min-height: 380px;
  }

  .world-leader-content {
    max-width: 480px;
    margin-right: 280px;
  }
}

@media (max-width: 1024px) {
  .world-leader-section {
    overflow: hidden;
    min-height: auto;
    padding: 2.5rem 0;
  }

  /* Hide floating icons on tablet & mobile */
  .world-leader-section .parallax-elements {
    display: none;
  }

  .world-leader-panel.active {
    flex-direction: column;
    align-items: center;
    min-height: auto;
    gap: 1.5rem;
  }

  .world-leader-content {
    max-width: 100%;
    margin-right: 0;
    margin-left: 0;
    padding: 0 1.5rem;
    text-align: center;
    order: 2;
  }

  .world-leader-highlights {
    display: inline-block;
    text-align: left;
    margin: 0 auto 1.25rem;
  }

  .world-leader-subtitle {
    font-size: 1.3rem;
  }

  .world-leader-description {
    font-size: 0.95rem;
  }

  .world-leader-highlights li {
    font-size: 0.85rem;
  }

  .world-leader-image {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    width: 280px;
    margin: 0 auto;
    order: 1;
    opacity: 1;
  }

  .world-leader-tabs {
    gap: 0.15rem;
  }

  .world-leader-tab {
    padding: 0.6rem 1rem;
    font-size: 0.75rem;
  }

  .world-leader-panels {
    min-height: auto;
  }
}

/* ========================================
   Mobile Redesign — Horizontal pills + Card layout
   ======================================== */
@media (max-width: 640px) {
  .world-leader-section {
    padding: 2.5rem 0 3rem;
    min-height: auto;
    background: #f8fafc;
  }

  .world-leader-header {
    margin-bottom: 1.25rem;
    padding: 0 1.25rem;
  }

  .world-leader-title {
    font-size: 2.25rem;
    line-height: 1.1;
  }

  /* ---- Horizontal scrolling pill tabs ---- */
  .world-leader-tabs {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.25rem 1.25rem;
    justify-content: flex-start;
    scrollbar-width: none;
  }

  .world-leader-tabs::-webkit-scrollbar {
    display: none;
  }

  .world-leader-tab {
    flex-shrink: 0;
    width: auto;
    max-width: none;
    padding: 0.6rem 1.1rem;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    border-radius: 50px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    color: var(--text-secondary);
    scroll-snap-align: start;
    white-space: nowrap;
    line-height: 1.3;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  }

  .world-leader-tab br {
    display: none;
  }

  .world-leader-tab::before {
    display: none;
  }

  .world-leader-tab.active {
    background: var(--color-navy, #1A365E);
    color: #ffffff;
    border-color: var(--color-navy, #1A365E);
    box-shadow: 0 4px 15px rgba(26, 54, 94, 0.3);
  }

  /* ---- Card-style panel ---- */
  .world-leader-panels {
    padding: 0 1rem;
  }

  .world-leader-panel.active {
    flex-direction: column;
    gap: 0;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  }

  /* Full-width banner image — hide shield SVG, show bg image */
  .world-leader-image {
    width: 100%;
    order: 1;
    margin: 0;
    padding: 0;
    height: 200px;
    overflow: hidden;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }

  /* Hide shield SVG on mobile */
  .world-leader-image .shield-svg {
    display: none;
  }

  /* Per-panel background images (same images as SVG sources) */
  .world-leader-panel[data-panel="elc"] .world-leader-image {
    background-image: url('https://images.unsplash.com/photo-1503454537195-1dcabb73ffb9?w=800&h=400&fit=crop');
    background-color: #f5e6d3;
  }
  .world-leader-panel[data-panel="elementary"] .world-leader-image {
    background-image: url('https://images.unsplash.com/photo-1588072432836-e10032774350?w=800&h=400&fit=crop');
    background-color: #dde8f0;
  }
  .world-leader-panel[data-panel="middle"] .world-leader-image {
    background-image: url('https://images.unsplash.com/photo-1509062522246-3755977927d7?w=800&h=400&fit=crop');
    background-color: #e8e3d8;
  }
  .world-leader-panel[data-panel="high"] .world-leader-image {
    background-image: url('https://images.unsplash.com/photo-1427504494785-3a9ca7044f45?w=800&h=400&fit=crop');
    background-color: #d4dce4;
  }

  /* Smooth gradient fade at bottom of image into card content */
  .world-leader-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, #ffffff 0%, transparent 100%);
    pointer-events: none;
  }

  /* Content inside the card */
  .world-leader-content {
    order: 2;
    padding: 1.25rem 1.5rem 1.75rem;
    text-align: center;
  }

  .world-leader-subtitle {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
    color: var(--color-navy, #1A365E);
  }

  .world-leader-description {
    font-size: 0.88rem;
    line-height: 1.65;
    color: #4a5568;
    margin-bottom: 1rem;
  }

  .world-leader-highlights {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 0 auto 1.25rem;
    width: fit-content;
  }

  .world-leader-highlights li {
    font-size: 0.82rem;
    margin-bottom: 0.4rem;
    color: var(--color-navy, #1A365E);
  }

  .world-leader-highlights li::before {
    top: 0.35rem;
    width: 5px;
    height: 5px;
  }

  /* CTA as full-width button in card */
  .world-leader-cta {
    display: block;
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    font-size: 0.75rem;
    text-align: center;
    border-radius: 12px;
    background: var(--color-red, #C82035);
    box-shadow: 0 4px 15px rgba(200, 32, 53, 0.25);
  }
}

/* ---- Small mobile refinements ---- */
@media (max-width: 400px) {
  .world-leader-title {
    font-size: 1.9rem;
  }

  .world-leader-tab {
    padding: 0.5rem 0.9rem;
    font-size: 0.65rem;
  }

  .world-leader-image {
    height: 170px;
  }

  .world-leader-content {
    padding: 1rem 1.25rem 1.5rem;
  }

  .world-leader-subtitle {
    font-size: 1rem;
  }

  .world-leader-description {
    font-size: 0.82rem;
  }

  .world-leader-cta {
    max-width: 220px;
    padding: 0.75rem 1.25rem;
    font-size: 0.7rem;
  }
}

/* Bebas Neue Font Import (if not already included) */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');
