:root {
  --primary-teal: #006B7D;
  --secondary-emerald: #00A693;
  --electric-blue: #00D9FF;
  --accent-coral: #FF6B6B;
  --accent-amber: #FFB627;
  --deep-navy: #0F1419;
  --pearl-white: #FDFEFE;
  --sage-green: #95B8A3;
  --aurora-gradient: linear-gradient(45deg, var(--primary-teal), var(--secondary-emerald), var(--electric-blue), var(--accent-coral));
  --midnight-gradient: linear-gradient(135deg, var(--deep-navy), var(--primary-teal));
  --ocean-depth: radial-gradient(circle at center, var(--secondary-emerald), var(--primary-teal));
  --sunset-gradient: linear-gradient(90deg, var(--accent-coral), var(--accent-amber));
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--midnight-gradient);
  color: var(--pearl-white);
  overflow-x: hidden;
  position: relative;
}

.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.1;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--electric-blue);
  animation: float 20s infinite linear;
}

@keyframes float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    transform: translateY(-100vh) rotate(360deg);
    opacity: 0;
  }
}

.header {
  background: rgba(15, 20, 25, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 217, 255, 0.2);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 2rem;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.logo:hover {
  transform: scale(1.05);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--aurora-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rotate-glow 6s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
}

@keyframes rotate-glow {

  0%,
  100% {
    transform: rotate(0deg);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
  }

  50% {
    transform: rotate(180deg);
    box-shadow: 0 0 30px rgba(0, 166, 147, 0.5);
  }
}

.logo-text {
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--aurora-gradient);
  background-size: 400% 400%;
  animation: aurora-flow 8s ease-in-out infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes aurora-flow {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1rem;
  align-items: center;
}

.nav-links a {
  color: var(--pearl-white);
  text-decoration: none;
  font-weight: 500;
  /* font-size: 14px; */
  padding: 0.5rem .7rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  border: 1px solid transparent;
}

.nav-links a.progress-tab {
  background: rgba(0, 217, 255, 0.1);
  border: 1px solid rgba(0, 217, 255, 0.3);
  border-radius: 8px;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--electric-blue);
  border-color: var(--electric-blue);
  box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
}

.nav-links a.progress-tab {
  background: rgba(0, 217, 255, 0.1);
  border: 1px solid rgba(0, 217, 255, 0.3);
  border-radius: 8px;
}

.nav-links a.progress-tab:hover {
  background: rgba(0, 217, 255, 0.2);
  box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
}

.progress-modal .modal-content {
  max-width: 900px;
}

.progress-section {
  margin-bottom: 2rem;
}

.progress-section h3 {
  color: var(--electric-blue);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.progress-bar {
  background: rgba(15, 20, 25, 0.6);
  border-radius: 20px;
  height: 20px;
  margin: 0.5rem 0;
  overflow: hidden;
  border: 1px solid rgba(0, 217, 255, 0.2);
}

.progress-fill {
  height: 100%;
  border-radius: 20px;
  background: var(--aurora-gradient);
  transition: width 1s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 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%);
  }
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  color: var(--sage-green);
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.achievement-badge {
  background: rgba(0, 166, 147, 0.1);
  border: 1px solid rgba(0, 217, 255, 0.3);
  border-radius: 15px;
  padding: 1rem;
  text-align: center;
  transition: all 0.3s ease;
}

.achievement-badge.earned {
  background: rgba(255, 182, 39, 0.2);
  border-color: var(--accent-amber);
  box-shadow: 0 5px 20px rgba(255, 182, 39, 0.3);
}

.achievement-badge:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 217, 255, 0.2);
}

.achievement-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--sage-green);
}

.achievement-badge.earned .achievement-icon {
  color: var(--accent-amber);
}

.achievement-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.weekly-goals {
  background: rgba(15, 20, 25, 0.4);
  border: 1px solid rgba(0, 217, 255, 0.2);
  border-radius: 15px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.goal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.8rem;
  background: rgba(0, 166, 147, 0.05);
  border-radius: 10px;
  border: 1px solid rgba(0, 217, 255, 0.1);
}

.goal-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.goal-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--sage-green);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.goal-check.completed {
  background: var(--secondary-emerald);
  border-color: var(--secondary-emerald);
  color: white;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.icon-btn {
  background: rgba(0, 217, 255, 0.1);
  border: 1px solid rgba(0, 217, 255, 0.3);
  color: var(--electric-blue);
  padding: 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.icon-btn:hover {
  background: rgba(0, 217, 255, 0.2);
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(0, 217, 255, 0.4);
}

.main-content {
  margin-top: 80px;
  padding: 2rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.hero-section {
  text-align: center;
  padding: 4rem 0;
  position: relative;
}

.hero-title {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: var(--aurora-gradient);
  background-size: 400% 400%;
  animation: aurora-flow 8s ease-in-out infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.4rem;
  margin-bottom: 2rem;
  color: var(--sage-green);
  font-weight: 400;
}

.cta-button {
  background: var(--aurora-gradient);
  border: none;
  padding: 1rem 2rem;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 166, 147, 0.3);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(0, 166, 147, 0.4);
}

.learning-cubes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  margin: 4rem 0;
  padding: 2rem 0;
}

.cube-container {
  perspective: 1000px;
  height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cube {
  width: 200px;
  height: 200px;
  position: relative;
  transform-style: preserve-3d;
  animation: float-rotate 20s infinite linear;
  cursor: pointer;
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cube:hover {
  animation-play-state: paused;
  transform: scale(1.1);
}

.cube.interactive {
  animation: none;
  transform: scale(1.1);
}

.cube.interactive:hover {
  transform: scale(1.15);
  box-shadow: 0 0 30px rgba(0, 217, 255, 0.5);
}

/* Face rotation states */
.cube.show-front {
  transform: scale(1.1) rotateX(0deg) rotateY(0deg);
}

.cube.show-back {
  transform: scale(1.1) rotateX(0deg) rotateY(180deg);
}

.cube.show-right {
  transform: scale(1.1) rotateX(0deg) rotateY(-90deg);
}

.cube.show-left {
  transform: scale(1.1) rotateX(0deg) rotateY(90deg);
}

.cube.show-top {
  transform: scale(1.1) rotateX(-90deg) rotateY(0deg);
}

.cube.show-bottom {
  transform: scale(1.1) rotateX(90deg) rotateY(0deg);
}

@keyframes float-rotate {
  0% {
    transform: rotateX(0deg) rotateY(0deg) translateY(0px);
  }

  25% {
    transform: rotateX(90deg) rotateY(90deg) translateY(-10px);
  }

  50% {
    transform: rotateX(180deg) rotateY(180deg) translateY(0px);
  }

  75% {
    transform: rotateX(270deg) rotateY(270deg) translateY(-10px);
  }

  100% {
    transform: rotateX(360deg) rotateY(360deg) translateY(0px);
  }
}

.cube-face {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 217, 255, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  padding: 1rem;
  font-family: 'Amiri', serif;
  transition: all 0.3s ease;
}

.cube-face:hover {
  border-color: rgba(255, 182, 39, 0.6);
  box-shadow: 0 15px 40px rgba(255, 182, 39, 0.2);
}

.cube-face.front {
  background: rgba(0, 107, 125, 0.8);
  transform: translateZ(100px);
}

.cube-face.back {
  background: rgba(0, 166, 147, 0.8);
  transform: translateZ(-100px) rotateY(180deg);
}

.cube-face.right {
  background: rgba(0, 217, 255, 0.8);
  transform: rotateY(90deg) translateZ(100px);
}

.cube-face.left {
  background: rgba(255, 107, 107, 0.8);
  transform: rotateY(-90deg) translateZ(100px);
}

.cube-face.top {
  background: rgba(255, 182, 39, 0.8);
  transform: rotateX(90deg) translateZ(100px);
}

.cube-face.bottom {
  background: rgba(149, 184, 163, 0.8);
  transform: rotateX(-90deg) translateZ(100px);
}

.cube-arabic {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--pearl-white);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.cube-english {
  font-size: 1.2rem;
  font-weight: 500;
  color: rgba(253, 254, 254, 0.9);
  font-family: 'Inter', sans-serif;
}

.cube-info-panel {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 20, 25, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 217, 255, 0.3);
  border-radius: 15px;
  padding: 1rem 1.5rem;
  color: var(--pearl-white);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
  pointer-events: none;
}

.cube-container:hover .cube-info-panel {
  opacity: 1;
  visibility: visible;
  bottom: -60px;
}

.face-indicator {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--aurora-gradient);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 101;
}

.cube.interactive .face-indicator {
  opacity: 1;
}

.level-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 15px 40px rgba(0, 217, 255, 0.3);
  border-color: var(--electric-blue);
}

.competition-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(0, 217, 255, 0.2);
  border-color: var(--electric-blue);
}

.tool-card:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 20px 50px rgba(0, 217, 255, 0.3);
  border-color: var(--accent-amber);
}

.leaderboard-entry:hover {
  transform: translateX(5px);
  box-shadow: 0 10px 30px rgba(0, 217, 255, 0.2);
}

.overview-card:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 20px 50px rgba(0, 217, 255, 0.3);
  border-color: var(--electric-blue);
}

.footer-cta-card {
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.footer-cta-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.footer-cta-card button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.search-filter {
  transition: all 0.3s ease;
}

.search-filter:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 217, 255, 0.3);
}

.search-filter.active {
  background: var(--aurora-gradient) !important;
  color: white !important;
}

#waveformCanvas {
  border-radius: 10px;
}

.ayah-display {
  transition: all 0.5s ease;
}

.reading-controls button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 217, 255, 0.2);
}

.memorization-tools button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 182, 39, 0.3);
}

#wordCloudContainer span {
  transition: all 0.3s ease;
  display: inline-block;
  margin: 0.5rem;
}

#wordCloudContainer span:hover {
  transform: scale(1.2);
  text-shadow: 0 0 10px currentColor;
}

.social-panel button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 217, 255, 0.3);
}

.academic-disciplines {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 4rem 0;
}

.discipline-card {
  background: rgba(15, 20, 25, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 217, 255, 0.2);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.discipline-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 50px rgba(0, 217, 255, 0.2);
  border-color: var(--electric-blue);
}

.discipline-icon {
  font-size: 3rem;
  color: var(--accent-amber);
  margin-bottom: 1rem;
  /* animation: rotate-glow 4s ease-in-out infinite; */
}

.stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 4rem 0;
}

.stat-card {
  background: rgba(15, 20, 25, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 217, 255, 0.2);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 217, 255, 0.2);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--sunset-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--sage-green);
  font-weight: 500;
}

.footer {
  background: rgba(15, 20, 25, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 217, 255, 0.2);
  padding: 3rem 2rem 1rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: var(--electric-blue);
  margin-bottom: 1rem;
  font-weight: 600;
}

.footer-section p {
  color: var(--sage-green);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: var(--sage-green);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: var(--electric-blue);
}

.footer-bottom {
  border-top: 1px solid rgba(0, 217, 255, 0.1);
  padding-top: 1rem;
  text-align: center;
  color: var(--sage-green);
}

.chat-widget {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 1000;
}

.chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--aurora-gradient);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 166, 147, 0.3);
  transition: all 0.3s ease;
}

.chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 15px 40px rgba(0, 166, 147, 0.4);
}

.fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--aurora-gradient);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 166, 147, 0.3);
  transition: all 0.3s ease;
  z-index: 1000;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 15px 40px rgba(0, 166, 147, 0.4);
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.modal-content {
  background: rgba(15, 20, 25, 0.95);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(0, 217, 255, 0.3);
  border-radius: 20px;
  padding: 2rem;
  max-width: 800px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal h2 {
  color: var(--electric-blue);
  margin-bottom: 1rem;
  background: var(--aurora-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--electric-blue);
  font-size: 1.5rem;
  cursor: pointer;
}

.notification {
  position: fixed;
  top: 100px;
  right: 2rem;
  background: rgba(0, 166, 147, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 217, 255, 0.3);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  color: white;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 166, 147, 0.3);
  transform: translateX(400px);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 3000;
  max-width: 350px;
}

.notification.show {
  transform: translateX(0);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .learning-cubes {
    grid-template-columns: 1fr;
  }

  .mobile-nav {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 20, 25, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 217, 255, 0.2);
    padding: 1rem;
    z-index: 1001;
  }

  .mobile-nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    max-width: 400px;
    margin: 0 auto;
  }

  .mobile-nav-btn {
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 10px;
    padding: 0.8rem 0.5rem;
    color: var(--electric-blue);
    text-align: center;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .mobile-nav-btn:hover {
    background: rgba(0, 217, 255, 0.2);
    transform: translateY(-2px);
  }

  .mobile-nav-btn i {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
  }

  .main-content {
    padding-bottom: 100px;
  }
}

.mobile-nav {
  display: none;
}