/*
  TEDx NewCairoSTEM Youth – Sponsors page styles
  - Uses only existing HTML structure
  - Replicates the black theme with red waves, sponsor circles, and contact card
*/

:root {
  --bg: #000;
  --panel: #0b0b0b;
  --panel-2: #111;
  --text: #ffffff;
  --muted: #bdbdbd;
  --line: #1d1d1d;
  --brand: #e62b1e;
  --cta-overhang: 120px;
  --attach-overlap: 8px; /* slight overlap so card covers any seam */
}

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

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.5;
  overflow-x: hidden;
}

/* Red animated glow background using images */
.red-glow-background {
  position: fixed;
  inset: 0;
  z-index: -4;
  pointer-events: none;
  overflow: hidden;
}

.glow-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.7;
}

.glow-1 {
  background-image: url('images/red-glow1.png');
  animation: glowPulse1 4s ease-in-out infinite alternate;
  filter: blur(2px) saturate(1.3);
}

.glow-2 {
  background-image: url('images/red-glow2.png');
  animation: glowPulse2 6s ease-in-out infinite alternate;
  filter: blur(3px) saturate(1.2);
  opacity: 0.6;
}

/* Glow pulse animations */
@keyframes glowPulse1 {
  0% { 
    transform: scale(1) rotate(0deg);
    opacity: 0.7;
    filter: blur(2px) saturate(1.3) brightness(1.1);
  }
  100% { 
    transform: scale(1.05) rotate(2deg);
    opacity: 0.9;
    filter: blur(1px) saturate(1.5) brightness(1.3);
  }
}

@keyframes glowPulse2 {
  0% { 
    transform: scale(1.02) rotate(-1deg);
    opacity: 0.6;
    filter: blur(3px) saturate(1.2) brightness(1.0);
  }
  100% { 
    transform: scale(0.98) rotate(1deg);
    opacity: 0.8;
    filter: blur(2px) saturate(1.4) brightness(1.2);
  }
}

/* Red wave background using provided assets */
body::before,
body::after {
  content: "";
  position: fixed;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: -2;
  background-repeat: no-repeat;
  background-size: cover;
  filter: saturate(1.15) contrast(1.05);
}

/* Enhanced top waves with stronger glow */
body::before {
  top: 0;
  height: 56vh;
  background:
    radial-gradient(closest-side at 15% 25%, rgba(255, 84, 60, 0.8), rgba(255,84,60,0.0) 62%),
    radial-gradient(closest-side at 65% 0%, rgba(255, 36, 0, 0.7), rgba(255,36,0,0.0) 68%),
    radial-gradient(closest-side at -10% 80%, rgba(255, 120, 90, 0.5), rgba(255,120,90,0.0) 74%);
  filter: blur(32px) saturate(1.4) contrast(1.1) brightness(1.2);
  opacity: 0.95;
  animation: glowDriftTop 8s ease-in-out infinite alternate, pulseGlowTop 3s ease-in-out infinite;
}

/* Enhanced bottom waves with stronger glow */
body::after {
  bottom: 0;
  height: 56vh;
  background:
    radial-gradient(closest-side at 85% 75%, rgba(255, 72, 48, 0.75), rgba(255,72,48,0.0) 60%),
    radial-gradient(closest-side at 30% 100%, rgba(255, 30, 0, 0.65), rgba(255,30,0,0.0) 66%),
    radial-gradient(closest-side at 110% 20%, rgba(255, 120, 90, 0.45), rgba(255,120,90,0.0) 72%);
  filter: blur(32px) saturate(1.4) contrast(1.1) brightness(1.2);
  opacity: 0.95;
  animation: glowDriftBottom 10s ease-in-out infinite alternate, pulseGlowBottom 4s ease-in-out infinite;
}

/* Optional animated ribbons already in HTML – keep very subtle behind waves */
.ribbons {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -3;
  pointer-events: none;
}
.ribbons svg { width: 100%; height: 100%; }
.ribbon { opacity: 0.14; }
.r1 { fill: rgba(255, 0, 0, 0.22); animation: slide 22s linear infinite; }
.r2 { fill: rgba(200, 0, 0, 0.18); animation: slide 28s linear infinite reverse; }
.r3 { fill: rgba(255, 40, 0, 0.14); animation: slide 34s linear infinite; }
@keyframes slide { 0% { transform: translateX(0); } 100% { transform: translateX(-8%); } }

/* Header styles are provided by css/nav.css for consistency */

/* Main: Sponsors section */
.sponsors-section {
  position: relative;
  padding: clamp(60px, 8vw, 110px) 6vw 260px;
}

.sponsors-section h1 {
  text-align: right;
  font-size: clamp(32px, 5.2vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.2px;
  text-shadow: 0 2px 0 rgba(0,0,0,0.25);
}

.sponsors-section h1 span { color: inherit; }
/* Red underline accent under the last line ("& Sponsors") */
.sponsors-section h1 span:last-child { position: relative; display: inline-block; }
.sponsors-section h1 span:last-child::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -10px;
  height: 8px;
  width: 44%;
  background: var(--brand);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(230,43,30,0.6);
}

.sponsors-section p {
  color: #ffffff;
  font-weight: 600;
  font-size: clamp(14px, 1.1vw, 16px);
  margin: 16px 0 52px auto;
  max-width: 520px;
  text-align: right;
  line-height: 1.6;
  text-shadow: 0 1px 0 rgba(0,0,0,0.35);
}

/* Sponsor badges canvas */
.sponsor-layer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(120px, 12vw, 160px), 1fr));
  gap: clamp(18px, 2.4vw, 28px) clamp(18px, 2.4vw, 28px);
  justify-items: center;
  align-items: start;
  max-width: 1200px;
  margin: 0 0 0 auto;
  position: relative;
}

.sponsor-item {
  position: static;
  left: auto;
  top: auto;
  transform: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.circle {
  --size: clamp(88px, 10vw, 130px);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background:
    radial-gradient(120% 120% at 50% 20%, #1c1c1c 0 30%, #0f0f0f 58%, #0b0b0b 100%);
  border: 2px solid #2a2a2a;
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.03),
    0 10px 30px rgba(0,0,0,0.35);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.circle svg {
  width: 56%;
  height: 56%;
  opacity: 0.95;
}

.circle:hover {
  transform: translateZ(0) scale(1.06);
  border-color: rgba(230, 43, 30, 0.55);
  box-shadow:
    0 0 0 6px rgba(230, 43, 30, 0.1),
    0 18px 48px rgba(230, 43, 30, 0.22),
    0 8px 22px rgba(0,0,0,0.55);
  animation: circleGlow 2s ease-in-out infinite alternate;
}

/* Pulsing glow for sponsor circles */
@keyframes circleGlow {
  0% {
    box-shadow:
      0 0 0 6px rgba(230, 43, 30, 0.1),
      0 18px 48px rgba(230, 43, 30, 0.22),
      0 8px 22px rgba(0,0,0,0.55);
  }
  100% {
    box-shadow:
      0 0 0 12px rgba(230, 43, 30, 0.2),
      0 25px 60px rgba(230, 43, 30, 0.35),
      0 12px 30px rgba(0,0,0,0.6);
  }
}

/* Contact CTA card */
.contact-box {
  position: absolute;
  right: 6vw;
  bottom: 0;
  width: clamp(300px, 40vw, 520px);
  background: #ffffff;
  color: #080808;
  border-radius: 24px 24px 0 0;
  padding: clamp(18px, 2.6vw, 28px);
  box-shadow: 0 16px 36px rgba(0,0,0,0.32);
  z-index: 2; /* ensure it overlaps footer top border */
}

.contact-box p {
  margin: 0 0 14px 0;
  color: #111;
  text-align: left;
}

.contact-box b { color: #000; }

.contact-box button {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: 0 6px 18px rgba(230, 43, 30, 0.35);
}

.contact-box button:hover { background: #c42216; transform: translateY(-1px); }
.contact-box button:active { transform: translateY(0); }

/* Footer */
footer {
  background: var(--panel-2);
  border-top: none; /* remove line so card visually attaches */
  margin-top: 0; /* flush with card bottom */
  padding: 42px 6vw 48px;
  color: var(--muted);
}

footer .footer-logo h2 {
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 700;
}

footer .footer-logo p {
  margin-top: 6px;
  font-size: 12px;
}

footer nav {
  margin: 18px 0 10px;
}

footer nav a {
  text-decoration: none;
  color: #e5e5e5;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.6px;
  margin: 0 16px;
  opacity: 0.85;
  transition: color .2s ease, opacity .2s ease;
}

footer nav a:hover { color: var(--brand); opacity: 1; }

/* Footer layout and styling to match reference */
.footer-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(24px, 6vw, 80px);
}

.footer-left { flex: 1 1 46%; }
.footer-right { flex: 1 1 46%; text-align: right; }

.footer-brand {
  font-size: clamp(28px, 4.6vw, 46px);
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,0.25);
}
.footer-sub {
  margin-top: 8px;
  color: #e6e6e6;
  font-weight: 600;
}
.footer-sub .tedx { 
  color: var(--brand); 
  font-weight: 800; 
  animation: brandGlow 4s ease-in-out infinite alternate;
  text-shadow: 0 0 10px rgba(230, 43, 30, 0.3);
}

.footer-nav a {
  text-decoration: none;
  color: #e5e5e5;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.6px;
  margin-left: 22px;
  opacity: 0.9;
  transition: color .2s ease, opacity .2s ease;
}
.footer-nav a:first-child { margin-left: 0; }
.footer-nav a:hover { color: var(--brand); opacity: 1; }

.footer-divider {
  display: block;
  width: 62%;
  height: 1px;
  background: rgba(255,255,255,0.32);
  margin: 12px 0 12px auto;
  border-radius: 1px;
}

.footer-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  list-style: none;
  padding: 0;
  margin: 8px 0 0 auto;
  width: 62%;
}
.footer-social li { display: inline-flex; }
.footer-social a { color: #cfcfcf; opacity: 0.95; transition: color .2s ease, opacity .2s ease, transform .15s ease; }
.footer-social a:hover { color: #ffffff; opacity: 1; transform: translateY(-1px); }

footer .license {
  margin-top: 8px;
  font-size: 12px;
  color: #b3b3b3;
  text-align: center;
  width: 62%;
  margin-left: auto;
}

@media (max-width: 900px) {
  .footer-wrap { flex-direction: column; gap: 20px; }
  .footer-right { text-align: center; }
  .footer-divider, .footer-social, footer .license { width: 100%; margin-left: 0; }
  .footer-right .social-icons {
    width: 100%;
    margin: 10px auto 0;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
  }
}

/* Enhanced procedural glow animations */
@keyframes glowDriftTop {
  0%   { transform: translate3d(0,0,0) rotate(0deg) scale(1.02); }
  100% { transform: translate3d(-1.5%, 2%, 0) rotate(-3deg) scale(1.06); }
}
@keyframes glowDriftBottom {
  0%   { transform: translate3d(0,0,0) rotate(0deg) scale(1.02); }
  100% { transform: translate3d(1.6%, -2%, 0) rotate(3deg) scale(1.05); }
}

/* New pulse glow animations */
@keyframes pulseGlowTop {
  0%   { 
    opacity: 0.95; 
    filter: blur(32px) saturate(1.4) contrast(1.1) brightness(1.2);
  }
  50%  { 
    opacity: 1.0; 
    filter: blur(28px) saturate(1.6) contrast(1.2) brightness(1.4);
  }
  100% { 
    opacity: 0.95; 
    filter: blur(32px) saturate(1.4) contrast(1.1) brightness(1.2);
  }
}

@keyframes pulseGlowBottom {
  0%   { 
    opacity: 0.95; 
    filter: blur(32px) saturate(1.4) contrast(1.1) brightness(1.2);
  }
  50%  { 
    opacity: 1.0; 
    filter: blur(26px) saturate(1.5) contrast(1.15) brightness(1.3);
  }
  100% { 
    opacity: 0.95; 
    filter: blur(32px) saturate(1.4) contrast(1.1) brightness(1.2);
  }
}

@media (min-width: 1400px) {
  body::before { height: 52vh; }
  body::after  { height: 52vh; }
}
@media (max-width: 1200px) {
  body::before { height: 58vh; }
  body::after  { height: 58vh; }
}
@media (max-width: 700px) {
  body::before { height: 46vh; filter: blur(24px) saturate(1.25); }
  body::after  { height: 46vh; filter: blur(24px) saturate(1.25); }
}

@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
}

/* Responsive tuning */
@media (max-width: 900px) {
  .sponsor-layer { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin: 0 auto; }
  .sponsors-section h1, .sponsors-section p { text-align: center; }
  .sponsors-section p { margin: 14px auto 48px; }
  .sponsors-section { padding-bottom: 80px; }
  .contact-box { position: relative; right: auto; bottom: auto; margin: 60px auto calc(-1 * (var(--attach-overlap) + 24px)); display: block; }
  footer { margin-top: 0; padding-top: 24px; }
}

/* Extra tuning for narrow portrait phones */
@media (max-width: 480px) and (orientation: portrait) {
  .sponsors-section { padding-bottom: 40px; }
  footer { padding-top: 20px; }
}

@media (max-width: 640px) {
  header { padding: 14px 18px; }
  header nav a { margin-left: 14px; }
  .sponsor-layer { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
}

/* Social icons styling */
.social-icons {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cfcfcf;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
  opacity: 0.8;
}

.social-icons a:hover {
  background: rgba(230, 43, 30, 0.2);
  border-color: rgba(230, 43, 30, 0.4);
  color: #ffffff;
  opacity: 1;
  transform: translateY(-1px);
}

.footer-right .social-icons {
  gap: 22px;
  justify-content: center;
  margin: 8px 0 0 auto;
  width: 62%;
}

.footer-right .social-icons a {
  width: 34px;
  height: 34px;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.22);
}

.footer-right .social-icons a:hover {
  background: rgba(230, 43, 30, 0.18);
  border-color: rgba(230, 43, 30, 0.5);
}

.social-icons svg {
  width: 14px;
  height: 14px;
}

