/* =========================================
   Prime Teach Studio - Main Stylesheet
   ========================================= */

/* 🔹 CSS Variables */
:root {
  --bg-dark: #0a0a0f;
  --bg-card: #151520;
  --primary: #8b5cf6;
  --primary-glow: rgba(139, 92, 246, 0.5);
  --gold: #fbbf24;
  --gold-glow: rgba(251, 191, 36, 0.4);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #2a2a40;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 🔹 Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
}

/* 🔹 Stars Background */
#stars-bg {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: -2;
  background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0f0a1a 100%);
  animation: gradientShift 15s ease infinite;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.star {
  position: absolute; background: #fff; border-radius: 50%;
  animation: twinkle var(--duration, 3s) ease-in-out infinite var(--delay, 0s);
  opacity: var(--opacity, 0.8);
}
@keyframes twinkle {
  0%, 100% { opacity: var(--opacity, 0.8); transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* 🔹 Loader */
#loader {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: var(--bg-dark);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 9999; transition: opacity 0.5s, visibility 0.5s;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-logo {
  width: 280px; height: 280px; max-width: 85vw;
  margin-bottom: 20px; animation: pulse 2s infinite;
  filter: drop-shadow(0 0 25px var(--gold-glow));
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.loader-text { font-size: 1.2rem; color: var(--gold); font-weight: 600; letter-spacing: 2px; }
.loader-bar { width: 200px; height: 4px; background: var(--border); border-radius: 2px; margin-top: 15px; overflow: hidden; }
.loader-progress { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--gold)); border-radius: 2px; animation: loading 2s ease-in-out forwards; }
@keyframes loading { to { width: 100%; } }

/* 🔹 Navigation */
.navbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 30px; background: rgba(21, 21, 32, 0.9);
  backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--border);
}
.nav-logo .logo { width: 50px; height: 50px; object-fit: contain; }
.nav-menu {
  display: flex; list-style: none; gap: 25px;
}
.nav-menu a {
  color: var(--text); text-decoration: none; font-weight: 500;
  padding: 8px 12px; border-radius: 8px; transition: var(--transition);
}
.nav-menu a:hover, .nav-menu a.active {
  color: var(--gold); background: rgba(251, 191, 36, 0.1);
}
.nav-toggle {
  display: none; background: none; border: none; color: var(--text);
  font-size: 1.5rem; cursor: pointer;
}

/* 🔹 Header */
header { text-align: center; padding: 40px 20px 20px; position: relative; }
.site-title {
  margin-top: 15px; font-size: 2.2rem; font-weight: 700;
  background: linear-gradient(90deg, var(--gold), var(--primary), var(--gold));
  background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: shine 3s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }
.site-subtitle { color: var(--text-muted); font-size: 1rem; margin-top: 5px; }

/* 🔹 Hero Section */
.hero-section {
  padding: 60px 20px; text-align: center;
  background: radial-gradient(ellipse at bottom, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
}
.hero-content h2 {
  font-size: 1.8rem; margin-bottom: 15px; line-height: 1.4;
}
.hero-content .highlight {
  color: var(--gold); text-shadow: 0 0 20px var(--gold-glow);
}
.hero-content p {
  color: var(--text-muted); margin-bottom: 25px; font-size: 1.1rem;
}
.cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff; padding: 12px 30px; border-radius: 50px;
  text-decoration: none; font-weight: 600; transition: var(--transition);
  border: none; cursor: pointer; box-shadow: 0 10px 30px var(--primary-glow);
}
.cta-btn:hover { transform: translateY(-3px); box-shadow: 0 15px 40px var(--primary-glow); }

/* 🔹 Section Titles */
.section-title {
  display: block; text-align: center; width: 100%;
  font-size: 1.5rem; margin: 40px auto 30px;
  color: var(--gold); position: relative; padding: 0 15px;
}
.section-title::after {
  content: ''; position: absolute; bottom: -10px; left: 50%;
  transform: translateX(-50%); width: 70px; height: 3px;
  background: var(--primary); border-radius: 2px;
}

/* 🔹 Services Grid */
.services-preview { padding: 20px; max-width: 1200px; margin: 0 auto; }
.services-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px; padding: 10px;
}
.service-card {
  background: var(--bg-card); border: 2px solid var(--border);
  border-radius: 16px; padding: 25px; text-align: center;
  transition: var(--transition); cursor: default;
}
.service-card:hover {
  transform: translateY(-5px); border-color: var(--primary);
  box-shadow: 0 20px 40px var(--primary-glow);
}
.service-card i {
  font-size: 2.5rem; color: var(--gold); margin-bottom: 15px;
}
.service-card h4 { font-size: 1.2rem; margin-bottom: 10px; color: var(--text); }
.service-card p { color: var(--text-muted); font-size: 0.95rem; }

/* 🔹 Team Preview */
.team-preview { padding: 20px; max-width: 1200px; margin: 0 auto; }
.members-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px; padding: 10px;
}
.member-card {
  background: var(--bg-card); border: 2px solid var(--border);
  border-radius: 16px; display: flex; flex-direction: column;
  cursor: pointer; transition: var(--transition);
  position: relative; overflow: hidden;
  opacity: 0; transform: translateY(30px); animation: fadeInSlide 0.6s ease forwards;
}
.member-card:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: var(--primary);
  box-shadow: 0 20px 40px var(--primary-glow), 0 0 30px var(--primary-glow);
}
.member-card.leader { border-color: var(--gold); box-shadow: 0 0 30px var(--gold-glow); }
.member-card.leader::before {
  content: ''; position: absolute; top: -2px; left: -2px; right: -2px; bottom: -2px;
  background: linear-gradient(45deg, var(--gold), var(--primary), var(--gold));
  border-radius: 18px; z-index: -1; animation: borderGlow 3s linear infinite; opacity: 0.7;
}
@keyframes borderGlow { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
@keyframes fadeInSlide { to { opacity: 1; transform: translateY(0); } }

.member-avatar {
  width: 100%; height: auto; object-fit: cover;
  border: none; border-radius: 16px 16px 0 0;
  margin: 0; aspect-ratio: 1/1; transition: transform 0.4s ease;
}
.member-card:hover .member-avatar { transform: scale(1.03); }
.member-card.leader .member-avatar { aspect-ratio: 9/16; max-height: 450px; }

.member-info { padding: 20px; text-align: center; }
.member-name { font-size: 1.3rem; font-weight: 700; margin-bottom: 5px; color: var(--text); }
.member-card.leader .member-name { color: var(--gold); text-shadow: 0 0 10px var(--gold-glow); }
.member-role { color: var(--primary); font-size: 0.95rem; font-weight: 600; margin-bottom: 12px; }
.member-card.leader .member-role { color: var(--gold); }
.member-phone { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 15px; direction: ltr; display: inline-block; }

/* 🔹 Skill Bar */
.skill-container { margin: 15px 0; text-align: right; }
.skill-label { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 5px; color: var(--text-muted); }
.skill-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.skill-progress {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--gold));
  border-radius: 4px; width: 0; transition: width 1.5s ease-out; position: relative;
}
.skill-progress::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* 🔹 WhatsApp Button */
.whatsapp-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #25d366, #128c7e); color: #fff;
  padding: 10px 20px; border-radius: 50px; text-decoration: none;
  font-weight: 600; font-size: 0.9rem; margin-top: 10px; transition: var(--transition);
  border: none; cursor: pointer; box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}
.whatsapp-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(37, 211, 102, 0.5); }
.whatsapp-btn.large { padding: 14px 35px; font-size: 1.1rem; }

/* 🔹 CTA Section */
.cta-section {
  padding: 50px 20px; text-align: center;
  background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(251,191,36,0.1));
  margin: 40px 0;
}
.cta-section h3 { font-size: 1.5rem; margin-bottom: 10px; color: var(--gold); }
.cta-section p { color: var(--text-muted); margin-bottom: 25px; }

/* 🔹 Footer */
footer {
  background: var(--bg-card); border-top: 1px solid var(--border);
  padding: 40px 20px 20px; margin-top: 60px;
}
.footer-content {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px; max-width: 1200px; margin: 0 auto; text-align: center;
}
.footer-brand .footer-logo { width: 80px; height: 80px; margin-bottom: 15px; }
.footer-brand p { color: var(--text-muted); font-size: 0.9rem; }
.footer-links h4, .footer-social h4 { color: var(--gold); margin-bottom: 15px; font-size: 1.1rem; }
.footer-links ul { list-style: none; }
.footer-links li { margin: 8px 0; }
.footer-links a {
  color: var(--text-muted); text-decoration: none; transition: var(--transition);
}
.footer-links a:hover { color: var(--primary); }
.footer-social { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.footer-social a {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--border); display: flex; align-items: center; justify-content: center;
  color: var(--text); text-decoration: none; transition: var(--transition);
}
.footer-social a:hover { background: var(--primary); transform: translateY(-3px); }
.footer-bottom {
  text-align: center; padding-top: 20px; margin-top: 30px;
  border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.9rem;
}
.footer-bottom a { color: var(--gold); text-decoration: none; }

/* 🔹 Back to Top */
#back-to-top {
  position: fixed; bottom: 30px; left: 30px; width: 50px; height: 50px;
  border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--gold));
  color: #fff; border: none; font-size: 1.3rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: var(--transition);
  box-shadow: 0 5px 20px rgba(0,0,0,0.3); z-index: 999;
}
#back-to-top.visible { opacity: 1; visibility: visible; }
#back-to-top:hover { transform: translateY(-5px); box-shadow: 0 10px 30px var(--primary-glow); }

/* 🔹 Modals */
.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(10, 10, 15, 0.95);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; visibility: hidden; transition: var(--transition); padding: 20px;
}
.modal.active { opacity: 1; visibility: visible; }
.modal-content {
  background: var(--bg-card); border: 2px solid var(--primary); border-radius: 20px;
  max-width: 550px; width: 100%; padding: 0; text-align: center; position: relative;
  transform: scale(0.9); transition: transform 0.3s;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5); max-height: 90vh; overflow-y: auto;
}
.modal.active .modal-content { transform: scale(1); }
.modal.leader-modal .modal-content { border-color: var(--gold); box-shadow: 0 0 40px var(--gold-glow); }

.modal-close {
  position: absolute; top: 15px; left: 15px; width: 35px; height: 35px;
  border-radius: 50%; background: var(--border); border: none; color: var(--text);
  font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--transition); z-index: 10;
}
.modal-close:hover { background: var(--primary); transform: rotate(90deg); }

.modal-avatar {
  width: 100%; height: auto; object-fit: cover; display: block;
  border: none; margin: 0 0 15px 0; border-radius: 20px 20px 0 0;
  animation: zoomIn 0.4s ease-out;
}
.modal-avatar.ratio-square { aspect-ratio: 1/1; }
.modal-avatar.ratio-portrait { aspect-ratio: 9/16; }
@keyframes zoomIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-body { padding: 20px 25px 30px; }
.modal-name { font-size: 1.5rem; font-weight: 700; margin-bottom: 5px; }
.modal.leader-modal .modal-name { color: var(--gold); }
.modal-role { color: var(--primary); font-weight: 600; margin-bottom: 15px; font-size: 1.1rem; }
.modal.leader-modal .modal-role { color: var(--gold); }
.modal-phone { color: var(--text-muted); margin-bottom: 20px; direction: ltr; display: block; font-size: 1.05rem; }
.modal-bio {
  background: rgba(139, 92, 246, 0.1); border-right: 3px solid var(--primary);
  padding: 15px; border-radius: 0 10px 10px 0; margin: 20px 0;
  text-align: right; font-size: 0.95rem; line-height: 1.7;
}
.modal.leader-modal .modal-bio { background: rgba(251, 191, 36, 0.1); border-color: var(--gold); }
.modal-skill { margin: 20px 0; }
.modal-whatsapp { margin-top: 15px; padding: 12px 30px; font-size: 1rem; }

/* 🔹 About Modal */
.about-modal .modal-content { max-width: 600px; }
.about-title {
  font-size: 1.6rem; color: var(--gold); margin-bottom: 15px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.about-text { text-align: right; line-height: 1.8; margin-bottom: 20px; color: var(--text-muted); }
.about-fields { text-align: right; margin: 20px 0; }
.about-fields h4 { color: var(--primary); margin-bottom: 10px; font-size: 1.1rem; }
.about-fields ul { list-style: none; padding-right: 10px; }
.about-fields li {
  padding: 5px 0; color: var(--text-muted); position: relative; padding-right: 20px;
}
.about-fields li::before {
  content: '▹'; position: absolute; right: 0; color: var(--gold); font-weight: bold;
}
.about-footer {
  margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--border);
  color: var(--gold); font-weight: 600; font-size: 1.05rem;
}

/* 🔹 Responsive */
@media (max-width: 768px) {
  .nav-menu {
    position: fixed; top: 70px; left: 0; right: 0;
    background: var(--bg-card); flex-direction: column;
    padding: 20px; gap: 15px; transform: translateY(-150%);
    transition: var(--transition); border-bottom: 1px solid var(--border);
  }
  .nav-menu.active { transform: translateY(0); }
  .nav-toggle { display: block; }
  
  .site-title { font-size: 1.6rem; }
  .logo, .loader-logo { width: 220px; height: 220px; }
  .members-grid { grid-template-columns: 1fr; gap: 20px; }
  .modal-avatar { max-height: 60vh; }
  .hero-content h2 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .site-title { font-size: 1.4rem; }
  .logo, .loader-logo { width: 180px; height: 180px; }
  .member-name { font-size: 1.15rem; }
  .whatsapp-btn { padding: 8px 16px; font-size: 0.85rem; }
  .footer-content { grid-template-columns: 1fr; }
}

/* 🔹 Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }
.modal-content::-webkit-scrollbar-thumb { background: var(--gold); }

/* 🔹 Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* 🔹 Print */
@media print {
  #loader, #stars-bg, .navbar, #back-to-top { display: none !important; }
  body { background: #fff; color: #000; }
}