/* =============================================
   S4C – Space for Change | Subpages Premium CSS
   ============================================= */

:root {
  --sub-bg: #050505;
  --sub-card: rgba(20, 20, 20, 0.65);
  --sub-border: rgba(255, 255, 255, 0.06);
  --sub-border-glow: rgba(245, 200, 0, 0.2);
  --yellow: #f5c800;
  --yellow-glow: rgba(245, 200, 0, 0.4);
  --red: #e84040;
  --red-glow: rgba(232, 64, 64, 0.4);
  --white: #ffffff;
  --white-60: rgba(255, 255, 255, 0.6);
  --font-title: 'Outfit', sans-serif;
  --font-serif: 'Playfair Display', serif;
}

/* Global Reset */
body {
  background-color: var(--sub-bg);
  color: var(--white);
  font-family: 'Outfit', sans-serif;
  overflow-x: hidden;
  line-height: 1.8;
  margin: 0;
  padding: 0;
}

/* ─── Navigation Header ─── */
.sub-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  backdrop-filter: blur(15px);
  background: rgba(8, 8, 8, 0.8);
  border-bottom: 1px solid var(--sub-border);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.sub-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}

.sub-logo img {
  height: 40px;
  width: auto;
}

.sub-logo-text {
  display: flex;
  flex-direction: column;
}

.sub-logo-text span:first-child {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--yellow);
}

.sub-logo-text span:last-child {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--white-60);
  letter-spacing: 1px;
}

.sub-nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.btn-back {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--sub-border);
  color: #fff;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-back:hover {
  background: rgba(245, 200, 0, 0.1);
  border-color: var(--yellow);
  color: var(--yellow);
  transform: translateX(-3px);
  box-shadow: 0 0 15px rgba(245, 200, 0, 0.2);
}

body.lang-ar-active .btn-back:hover {
  transform: translateX(3px);
}

/* ─── Hero Section ─── */
.sub-hero {
  position: relative;
  height: 60vh;
  min-height: 400px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-bottom: 1px solid var(--sub-border);
  margin-top: 70px;
}

.sub-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.sub-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
  filter: brightness(0.6) contrast(1.1);
  transform: scale(1.05);
  animation: kenBurns 25s ease-out infinite alternate;
}

.sub-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--sub-bg) 0%, rgba(5,5,5,0.7) 60%, rgba(5,5,5,0.4) 100%);
  z-index: 2;
}

.sub-hero-content {
  position: relative;
  z-index: 3;
  max-width: 900px;
  padding: 0 24px;
}

.sub-hero-title {
  font-family: var(--font-title);
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 15px;
  line-height: 1.1;
  letter-spacing: 1px;
}

.sub-hero-title span.highlight {
  color: var(--yellow);
  position: relative;
  display: inline-block;
}

.sub-hero-title span.highlight::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--yellow);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--yellow);
  opacity: 0.6;
}

.sub-hero-sub {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  font-style: italic;
  color: var(--white-60);
  line-height: 1.5;
  margin-top: 15px;
}

@keyframes kenBurns {
  0% { transform: scale(1.03) translateY(0); }
  100% { transform: scale(1.1) translateY(-10px); }
}

/* ─── Layout Grid & Sections ─── */
.section-wrapper {
  padding: 80px 0;
  position: relative;
  z-index: 5;
}

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

.intro-lead {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: #fff;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 60px;
  line-height: 1.8;
  font-weight: 400;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

/* Glassmorphism Cards */
.sub-card {
  background: var(--sub-card);
  backdrop-filter: blur(15px);
  border: 1px solid var(--sub-border);
  border-radius: 20px;
  padding: 40px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sub-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--sub-border-glow), transparent);
  transition: all 0.5s ease;
}

.sub-card:hover {
  transform: translateY(-8px);
  border-color: var(--yellow-glow);
  box-shadow: 0 15px 35px rgba(245, 200, 0, 0.08), 0 0 25px rgba(245, 200, 0, 0.03);
}

.sub-card:hover::before {
  background: linear-gradient(90deg, transparent, var(--yellow), transparent);
}

.sub-card-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(245, 200, 0, 0.06);
  border: 1px solid rgba(245, 200, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--yellow);
  box-shadow: inset 0 0 10px rgba(245,200,0,0.1);
  transition: all 0.4s ease;
}

.sub-card:hover .sub-card-icon {
  background: var(--yellow);
  color: #000;
  box-shadow: 0 0 20px rgba(245,200,0,0.4);
  transform: rotateY(360deg);
}

.sub-card-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.sub-card-body {
  font-size: 0.95rem;
  color: var(--white-60);
  line-height: 1.7;
}

.sub-card-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sub-card-list li {
  position: relative;
  padding-left: 24px;
  font-size: 0.95rem;
  color: var(--white-60);
  line-height: 1.6;
}

body.lang-ar-active .sub-card-list li {
  padding-left: 0;
  padding-right: 24px;
}

.sub-card-list li::before {
  content: '•';
  color: var(--yellow);
  position: absolute;
  left: 0;
  font-size: 1.2rem;
  line-height: 1;
  top: 2px;
  text-shadow: 0 0 5px var(--yellow);
}

body.lang-ar-active .sub-card-list li::before {
  left: auto;
  right: 0;
}

/* ─── Glowing Elements (وميض) ─── */
.glow-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--yellow);
  background: rgba(245, 200, 0, 0.08);
  border: 1px solid rgba(245, 200, 0, 0.4);
  padding: 6px 14px;
  border-radius: 50px;
  box-shadow: 0 0 15px rgba(245, 200, 0, 0.15);
  animation: pulsingGlow 3s infinite alternate;
}

.glow-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--yellow), #c29d00);
  color: #000;
  border: none;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(245,200,0,0.3);
  text-decoration: none;
}

.glow-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(245,200,0,0.6), 0 0 15px rgba(255,255,255,0.3);
}

@keyframes pulsingGlow {
  0% {
    box-shadow: 0 0 10px rgba(245, 200, 0, 0.1);
    border-color: rgba(245, 200, 0, 0.3);
  }
  100% {
    box-shadow: 0 0 25px rgba(245, 200, 0, 0.35);
    border-color: rgba(245, 200, 0, 0.6);
  }
}

/* ─── Moving Shapes Canvas (أجسام متحركة) ─── */
.canvas-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.floating-object {
  position: absolute;
  background: rgba(255,255,255,0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 50%;
  animation: floatMotion 30s linear infinite;
  transform-style: preserve-3d;
}

.floating-object.yellow-tint {
  border-color: rgba(245, 200, 0, 0.08);
  box-shadow: 0 0 20px rgba(245, 200, 0, 0.02);
}

.floating-object.red-tint {
  border-color: rgba(232, 64, 64, 0.08);
  box-shadow: 0 0 20px rgba(232, 64, 64, 0.02);
}

@keyframes floatMotion {
  0% {
    transform: translateY(110vh) rotate(0deg) scale(0.8);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-10vh) rotate(360deg) scale(1.2);
    opacity: 0;
  }
}

/* Custom categories animations */
.blueprint-line {
  position: absolute;
  background: rgba(245, 200, 0, 0.04);
  animation: scanLine 8s ease-in-out infinite alternate;
}

@keyframes scanLine {
  0% { transform: translateY(0); }
  100% { transform: translateY(100vh); }
}

/* ─── Interactive Bilingual Logic ─── */
.p3-lang-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Outfit', sans-serif;
}

.p3-lang-btn:first-child {
  border-radius: 30px 0 0 30px;
}

.p3-lang-btn:last-child {
  border-radius: 0 30px 30px 0;
  border-left: none;
}

.p3-lang-btn.active {
  background: var(--yellow);
  color: #000;
  border-color: var(--yellow);
}

/* Language display rules */
.lang-en, .lang-ar {
  display: block;
}

.lang-ar {
  display: none !important;
}

body.lang-ar-active .lang-en {
  display: none !important;
}

body.lang-ar-active .lang-ar {
  display: block !important;
}

/* RTL Specifics */
body.lang-ar-active {
  direction: rtl;
  text-align: right;
}

body.lang-ar-active .sub-logo-text {
  align-items: flex-start;
}

/* ─── CTA Footer Section ─── */
.sub-footer-cta {
  background: linear-gradient(135deg, rgba(20,20,20,0.8), rgba(10,10,10,0.9));
  border-top: 1px solid var(--sub-border);
  padding: 80px 0;
  text-align: center;
  position: relative;
  z-index: 5;
}

.cta-box {
  max-width: 600px;
  margin: 0 auto;
}

.cta-box h3 {
  font-size: 2rem;
  color: #fff;
  margin-bottom: 20px;
}

.cta-box p {
  color: var(--white-60);
  margin-bottom: 30px;
}

.sub-footer {
  background: #080808;
  border-top: 1px solid var(--sub-border);
  padding: 30px 0;
  text-align: center;
  color: var(--white-30);
  font-size: 0.8rem;
  position: relative;
  z-index: 5;
}

.sub-footer span {
  color: var(--yellow);
}

/* ─── Responsiveness ─── */
@media (max-width: 768px) {
  .sub-nav {
    padding: 15px 20px;
  }
  .sub-hero {
    height: 50vh;
  }
  .sub-hero-title {
    font-size: 2.3rem;
  }
  .content-grid {
    grid-template-columns: 1fr;
  }
  .sub-card {
    padding: 30px;
  }
}
