:root {
  --primary-color: #0a0a0a;
  --secondary-color: #00ff88;
  --accent-color: #8a2be2;
  --light-color: #ffffff;
  --dark-color: #121212;
  --shadow: 0 4px 15px rgba(0, 255, 136, 0.2);
  --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --gradient: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
  --gradient-reverse: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
  --card-bg: rgba(255, 255, 255, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Tajawal', sans-serif;
}

body {
  background-color: var(--primary-color);
  color: var(--light-color);
  line-height: 1.6;
  overflow-x: hidden;
  font-size: 0.9rem;
}

/* شريط التنقل */
header {
  background: rgba(10, 10, 10, 0.98);
  color: white;
  padding: 0.6rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(0, 255, 136, 0.3);
}

.container {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
}

.logo {
  font-size: 1.4rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  color: var(--light-color);
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.7);
}

.logo i {
  margin-left: 8px;
  color: var(--secondary-color);
  font-size: 1.2rem;
}

/* القائمة الرئيسية */
.nav-links {
  display: flex;
  list-style: none;
  gap: 20px;
}

.nav-links li {
  margin: 0;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  padding: 8px 15px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
}

.nav-links a::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient);
  z-index: -1;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.nav-links a:hover::before {
  transform: translateX(0);
}

.nav-links a:hover {
  color: var(--primary-color);
}

.menu-toggle {
  display: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--secondary-color);
}

/* Loader */
.pyramid-loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotateX(-20deg);
  width: 150px;
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  z-index: 10000;
}

.pyramid-loader .loading-text {
  color: var(--secondary-color);
  font-size: 1.5rem;
  margin-top: 1rem;
  font-family: 'Tajawal', sans-serif;
  text-shadow: 0 0 10px var(--secondary-color), 0 0 20px var(--secondary-color);
}

.loading-text::after {
  content: '...';
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0%,
  20% {
    content: '.';
  }
  40% {
    content: '..';
  }
  60%,
  100% {
    content: '...';
  }
}

.wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: spin 4s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotateY(360deg);
  }
}

.pyramid-loader .wrapper .side {
  width: 50px;
  height: 50px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  transform-origin: center top;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.pyramid-loader .wrapper .side1 {
  transform: rotateZ(-30deg) rotateY(90deg);
  background: conic-gradient(var(--secondary-color), var(--accent-color), #D8CCE6, #2F2585);
}

.pyramid-loader .wrapper .side2 {
  transform: rotateZ(30deg) rotateY(90deg);
  background: conic-gradient(#2F2585, #D8CCE6, var(--accent-color), var(--secondary-color));
}

.pyramid-loader .wrapper .side3 {
  transform: rotateX(30deg);
  background: conic-gradient(#2F2585, #D8CCE6, var(--accent-color), var(--secondary-color));
}

.pyramid-loader .wrapper .side4 {
  transform: rotateX(-30deg);
  background: conic-gradient(var(--secondary-color), var(--accent-color), #D8CCE6, #2F2585);
}

.pyramid-loader .wrapper .shadow {
  width: 40px;
  height: 40px;
  background: #8B5AD5;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  transform: rotateX(90deg) translateZ(-30px);
  filter: blur(8px);
}

body.loaded .pyramid-loader {
  display: none;
}

/* الأقسام الرئيسية */
section {
  padding: 80px 0;
  position: relative;
}

.section-title {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}

.section-title h2 {
  font-size: 2.2rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  padding-bottom: 10px;
  position: relative;
}

.section-title h2::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 3px;
  background: var(--gradient);
  bottom: 0;
  right: 50%;
  transform: translateX(50%);
  border-radius: 2px;
}

/* قسم التعريف */
#intro {
  background: 
    radial-gradient(circle at 90% 30%, rgba(0, 255, 136, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 10% 70%, rgba(138, 43, 226, 0.15) 0%, transparent 50%),
    linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
  margin-top: 60px;
  min-height: 600px;
  display: flex;
  align-items: center;
  position: relative;
}

.intro-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  padding: 0 20px;
}

.intro-badge {
  background: var(--gradient);
  color: var(--primary-color);
  padding: 10px 25px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 30px;
  box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(0, 255, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

.intro-title {
  font-size: 3.2rem;
  font-weight: 800;
  margin-bottom: 25px;
  background: linear-gradient(135deg, #ffffff 0%, var(--secondary-color) 50%, var(--accent-color) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
  line-height: 1.2;
  position: relative;
}

.intro-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 50%;
  transform: translateX(50%);
  width: 150px;
  height: 4px;
  background: var(--gradient);
  border-radius: 2px;
}

.intro-subtitle {
  font-size: 1.4rem;
  color: var(--secondary-color);
  margin-bottom: 30px;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
}

.intro-description {
  background: rgba(18, 18, 18, 0.7);
  border-radius: 20px;
  padding: 35px;
  margin-bottom: 30px;
  border: 2px solid rgba(0, 255, 136, 0.3);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  max-width: 900px;
}

.intro-description::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  background: var(--gradient);
}

.intro-description p {
  font-size: 1.1rem;
  color: #e0e0e0;
  margin-bottom: 20px;
  line-height: 1.8;
  text-align: center;
}

/* قسم الرتب - البطاقات بالعرض الأصلي */
#ranks, #ranks2, #ranks3, #ranks4 {
  background: radial-gradient(circle at top left, rgba(138, 43, 226, 0.15), transparent 40%),
              radial-gradient(circle at bottom right, rgba(0, 255, 136, 0.15), transparent 40%),
              var(--primary-color);
  position: relative;
  overflow: hidden;
}

/* حاوية البطاقات - عرض الأصلي (شبكة 3 أعمدة) */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

/* بطاقات النقابات - التصميم المعدل */
.feature-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 20px;
  text-align: center;
  cursor: pointer;
  transform: translateY(0);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(5px);
  border: 1px solid var(--secondary-color);
  transition: all 0.4s ease;
  background-size: cover;
  background-position: center;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* خلفية موحدة لجميع الكروت */
  background-image: url('https://i.postimg.cc/2SW8L5fq/Gemini-Generated-Image-92iu4692iu4692iu-(1).png');
}

.feature-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 100%);
  z-index: 1;
}

.feature-card:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 0 20px var(--secondary-color), 0 0 40px var(--secondary-color);
  z-index: 10;
}

.feature-card:hover::after {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.3) 100%);
}

.feature-card i,
.feature-card h3,
.feature-card p {
  position: relative;
  z-index: 2;
}

/* حذف الصورة الدائرية */
.feature-card img {
  display: none;
}

/* شارات الرتب */
.rank-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: linear-gradient(135deg, #ff0000, #cc0000);
  color: white;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  z-index: 3;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 5px;
}

.lord-badge {
  background: linear-gradient(135deg, #8B0000, #FF0000);
}

.duke-badge {
  background: linear-gradient(135deg, #4B0082, #800080);
}

.feature-card h3 {
  font-size: 1.3rem;
  margin: 15px 0 10px;
  color: var(--light-color);
  position: relative;
  z-index: 2;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.feature-card p {
  font-size: 1rem;
  color: #e0e0e0;
  line-height: 1.5;
  margin: 10px 0;
  padding: 0 10px;
  position: relative;
  z-index: 2;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.special-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  color: gold;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 5px;
}

.special-card {
  animation: specialGlow 2s infinite alternate;
  border: 2px solid gold;
}

@keyframes specialGlow {
  0% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
  100% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.9), 0 0 40px rgba(255, 215, 0, 0.6); }
}

/* الفواصل بين الأقسام */
.section-divider {
  height: 3px;
  background: var(--gradient);
  margin: 2rem auto;
  max-width: 800px;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.section-divider::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shine 3s infinite;
}

@keyframes shine {
  100% {
    transform: translateX(100%);
  }
}

/* Floating particles */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--secondary-color);
  box-shadow: 0 0 10px var(--secondary-color), 0 0 20px var(--secondary-color);
  opacity: 0;
  animation: floatParticle linear infinite;
}

@keyframes floatParticle {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  20% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(-100vh) translateX(calc(var(--random-x) * 100px));
    opacity: 0;
  }
}

/* Theme and sound controls */
.theme-switch {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: rgba(18, 18, 18, 0.8);
  padding: 0.75rem;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  transition: var(--transition);
}

.sound-button {
  position: fixed;
  top: 1rem;
  right: 5rem;
  background: rgba(18, 18, 18, 0.8);
  color: var(--light-color);
  padding: 0.75rem;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  transition: var(--transition);
}

.sound-button i {
  font-size: 1.2rem;
}

.sound-button:hover,
.theme-switch:hover {
  transform: scale(1.1);
  background: rgba(0, 255, 136, 0.2);
}

.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--gradient);
  color: var(--light-color);
  padding: 1rem;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.scroll-top:hover {
  box-shadow: 0 0 25px rgba(0, 255, 136, 0.8);
  transform: translateY(-5px) scale(1.1);
}

/* التذييل */
footer {
  background: var(--dark-color);
  color: white;
  padding: 40px 0 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-top: 1px solid rgba(0, 255, 136, 0.25);
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 2px;
  background: var(--gradient);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-logo {
  font-size: 1.8rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  color: var(--light-color);
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.7);
  margin-bottom: 15px;
}

.footer-logo i {
  margin-left: 8px;
  color: var(--secondary-color);
}

.social-links {
  display: flex;
  margin: 20px 0;
  gap: 15px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.social-links a:hover {
  background: var(--gradient);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 15px 0;
  gap: 20px;
}

.footer-links a {
  color: #cccccc;
  text-decoration: none;
  transition: var(--transition);
  position: relative;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--secondary-color);
}

.copyright {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  font-size: 0.85rem;
  color: #aaaaaa;
}

/* تصميم متجاوب */
@media (max-width: 1200px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 992px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.98);
    flex-direction: column;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    padding: 20px 0;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li {
    margin: 0;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .menu-toggle {
    display: block;
  }
  
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }
  
  .feature-card {
    min-height: 280px;
  }
}

@media (max-width: 768px) {
  section {
    padding: 60px 0;
  }
  
  .section-title h2 {
    font-size: 1.8rem;
  }

  .intro-title {
    font-size: 2.5rem;
  }

  .intro-subtitle {
    font-size: 1.2rem;
  }

  .intro-description {
    padding: 25px;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .feature-card {
    min-height: 260px;
  }
  
  .sound-button {
    right: 4rem;
  }
}

@media (max-width: 480px) {
  .container {
    width: 95%;
  }
  
  .section-title h2 {
    font-size: 1.6rem;
  }

  .intro-title {
    font-size: 2rem;
  }

  .intro-subtitle {
    font-size: 1rem;
  }

  .intro-description {
    padding: 20px;
  }
  
  .features-grid {
    gap: 1rem;
  }
  
  .feature-card {
    min-height: 240px;
    padding: 1.2rem;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 10px;
  }
  
  .sound-button {
    right: 3.5rem;
  }
}