@import url('https://fonts.googleapis.com/css2?family=Changa:wght@700&display=swap');

/* ===================== نظام الألوان الجديد ===================== */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --bg-gradient-start: #1a2a3a;
    --bg-gradient-end: #2c3e50;
    --card-bg: rgba(44, 62, 80, 0.95);
    --header-bg: rgba(52, 73, 94, 0.95);
    --text-primary: #ecf0f1;
    --text-secondary: #bdc3c7;
    --text-accent: #3498db;
    --border-color: #3498db;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --btn-primary: #3498db;
    --btn-hover: #2980b9;
    --btn-text: white;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Changa', sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
  color: var(--text-primary);
  direction: rtl;
  text-align: center;
  min-height: 50vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 15px 10px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  color: var(--btn-text);
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.logo {
  height: 200px;
  width: auto;
  user-select: none;
}

h1 {
  font-size: 1.3rem;
  color: var(--text-accent);
  user-select: none;
}

nav {
  background-color: var(--primary-color);
  box-shadow: 0 0 12px rgba(52, 152, 219, 0.5);
}

.nav-links {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 25px;
  padding: 10px 0;
  flex-wrap: wrap;
}

.nav-links li a {
  text-decoration: none;
  color: var(--text-accent);
  font-weight: 500;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.nav-links li a:hover,
.nav-links li a:focus {
  color: var(--btn-text);
  transform: translateY(-2px);
}

.content-section {
  padding: 10px 15px;
  max-width: 1060px;
  margin: 30px auto;
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(52, 152, 219, 0.3);
  border: 1px solid var(--border-color);
}

.content-section h2 {
  color: var(--text-accent);
  margin-bottom: 15px;
  user-select: none;
}

.game-link {
  color: var(--text-accent);
  font-weight: 700;
  font-size: 1.0rem;
  text-decoration: underline;
  transition: all 0.3s ease;
}

.game-link:hover,
.game-link:focus {
  color: var(--text-primary);
  text-decoration: none;
  transform: translateY(-1px);
}

/* الفوتر مع النص المتحرك */
footer {
  margin-top: auto;
  padding: 20px 10px;
  background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
  box-shadow: 0 -2px 15px rgba(52, 152, 219, 0.8);
  color: var(--text-accent);
  user-select: none;
  border-top: 2px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent, 
    var(--secondary-color), 
    var(--btn-primary), 
    var(--secondary-color), 
    transparent
  );
}

.fancy-text-container {
  font-size: 1.6rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 600;
}

.prefix,
.suffix {
  white-space: nowrap;
  color: var(--text-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.fancy-text-lists {
  width: 215px;
  height: 45px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(52, 152, 219, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(52, 152, 219, 0.3);
  backdrop-filter: blur(5px);
}

.fancy-text-lists span {
  opacity: 0;
  position: absolute;
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  color: #87CEEB; /* أزرق فاتح - Sky Blue */
  white-space: nowrap;
  transform: translateY(50px);
  user-select: none;
  font-weight: 700;
  text-shadow: 
    0 0 10px rgba(135, 206, 235, 0.5),
    0 0 20px rgba(135, 206, 235, 0.3);
  background: linear-gradient(135deg, #87CEEB, #B0E2FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fancy-text-lists .visible {
  opacity: 1;
  transform: translateY(0);
  animation: text-glow 2s ease-in-out infinite alternate;
}

@keyframes text-glow {
  from {
    text-shadow: 
      0 0 10px rgba(135, 206, 235, 0.5),
      0 0 20px rgba(135, 206, 235, 0.3),
      0 0 30px rgba(135, 206, 235, 0.2);
  }
  to {
    text-shadow: 
      0 0 15px rgba(135, 206, 235, 0.7),
      0 0 25px rgba(135, 206, 235, 0.5),
      0 0 35px rgba(135, 206, 235, 0.3);
  }
}

/* تأثيرات إضافية للفائدة البصرية */
.fancy-text-lists::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(52, 152, 219, 0.2),
    transparent
  );
  transition: left 0.6s ease;
}

.fancy-text-container:hover .fancy-text-lists::before {
  left: 100%;
}

/* تحسينات للجوال */
@media (max-width: 768px) {
  .fancy-text-container {
    font-size: 1.4rem;
  }
  
  .fancy-text-lists {
    width: 160px;
    height: 32px;
  }
  
  .fancy-text-lists span {
    font-size: 1.1rem;
  }
}

/* الخلفية التفاعلية */
body {
  background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
  overflow-x: hidden;
  position: relative;
}

#interactive-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
}

.cell {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--secondary-color), var(--btn-hover));
  box-shadow: 0 0 10px var(--secondary-color);
  opacity: 0.2;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#section2, #section2 h2 {
  color: var(--text-secondary);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.social-icons a img {
  cursor: pointer;
  transition: transform 0.3s ease;
}

.social-icons a:hover img {
  animation: shake 0.5s;
  transform: scale(1.1);
}

/* أزرار إضافية */
.btn {
  background: var(--btn-primary);
  color: var(--btn-text);
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: 'Changa', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  margin: 5px;
}

.btn:hover {
  background: var(--btn-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

/* تجاوب الصفحة للجوال */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 15px;
    padding: 15px 10px;
  }

  .logo {
    height: 120px;
    width: auto;
    margin: 0 auto;
  }

  h1 {
    font-size: 1.4rem;
    margin-bottom: 5px;
  }

  nav {
    background-color: var(--primary-color);
    padding: 10px 0;
  }

  .nav-links {
    flex-direction: column;
    gap: 15px;
    padding: 0 20px;
  }

  .nav-links li a {
    font-size: 1.2rem;
    display: block;
    padding: 8px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
  }

  .nav-links li a:hover,
  .nav-links li a:focus {
    color: var(--btn-text);
    background: var(--btn-primary);
    transform: translateX(-5px);
  }

  .content-section {
    margin: 20px 15px;
    padding: 20px 15px;
    max-width: 100%;
    border-radius: 10px;
  }

  footer {
    font-size: 1rem;
    padding: 12px 10px;
    line-height: 1.3;
  }

  .fancy-text-container {
    font-size: 1.4rem;
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .fancy-text-lists {
    width: 130px;
    height: 28px;
    overflow: hidden;
    font-size: 1.1rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  .fancy-text-lists span {
    font-size: 0.9rem;
  }
}

/* تأثيرات إضافية */
.content-section {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content-section:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

/* تحسينات للوصول */
*:focus {
  outline: 2px solid var(--text-accent);
  outline-offset: 2px;
}

/* شريط التمرير المخصص */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--primary-color);
}

::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--btn-hover);
}