@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;900&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #131b2e;
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  
  /* Vibrant, playful colors for diseases/symptoms */
  --color-flu: linear-gradient(135deg, #ff6b6b, #ff8787);
  --color-cold: linear-gradient(135deg, #4dabf7, #3bc9db);
  --color-allergy: linear-gradient(135deg, #51cf66, #94d82d);
  --color-headache: linear-gradient(135deg, #cc5de8, #da77f2);
  --color-fatigue: linear-gradient(135deg, #fcc419, #ffd43b);
  --color-runny: linear-gradient(135deg, #ff922b, #ffa94d);
  --color-cough: linear-gradient(135deg, #ee5253, #ff6b6b);
  --color-joint: linear-gradient(135deg, #20c997, #12b886);
  --color-nausea: linear-gradient(135deg, #845ef7, #7048e8);
  
  --primary-accent: #3b82f6;
  --primary-accent-glow: rgba(59, 130, 246, 0.5);
  --success: #10b981;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Tajawal', 'Outfit', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  direction: rtl;
}

/* Background Glowing Blobs */
.blob {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(15, 23, 42, 0) 70%);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}
.blob-1 { top: -100px; right: -100px; }
.blob-2 { bottom: -100px; left: -100px; }

/* Main Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
}

/* Welcome Overlay / Start Screen */
.welcome-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.welcome-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome-card {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3rem;
  border-radius: 2rem;
  text-align: center;
  max-width: 550px;
  width: 90%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: translateY(0);
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.welcome-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
}

.welcome-card h1 {
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-card p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1.1rem;
  line-height: 1.6;
}

.btn-start {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
  transition: all 0.3s ease;
}

.btn-start:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 30px rgba(37, 99, 235, 0.5);
}

/* Header Section */
header {
  text-align: center;
  margin-bottom: 3rem;
}

.logo-area {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  margin-bottom: 1rem;
}

.logo-badge {
  font-size: 1.5rem;
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  color: var(--text-secondary);
  font-size: 0.9rem;
  letter-spacing: 1px;
}

h1.main-title {
  font-size: 2.8rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.2rem;
}

.welcome-pronounce-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 1.5rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1.5px solid var(--primary-accent);
  color: #60a5fa;
  padding: 0.6rem 1.5rem;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.3s ease;
}

.welcome-pronounce-btn:hover {
  background: var(--primary-accent);
  color: white;
  box-shadow: 0 0 15px var(--primary-accent-glow);
}

/* Grid layout for Diseases */
.diseases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.disease-card {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1.5rem;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.disease-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--card-accent);
}

.disease-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.card-image-wrapper {
  width: 100%;
  height: 220px;
  border-radius: 1.2rem;
  overflow: hidden;
  margin-bottom: 1.2rem;
  background: rgba(0, 0, 0, 0.2);
  position: relative;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.33, 1, 0.68, 1);
}

.disease-card:hover .card-image {
  transform: scale(1.07);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.card-titles {
  display: flex;
  flex-direction: column;
}

.disease-ar {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.disease-en {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.disease-desc {
  color: #cbd5e1;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-play-audio {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-play-audio:hover {
  background: var(--card-accent);
  border-color: transparent;
  transform: scale(1.05);
}

.btn-play-audio svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.tips-indicator {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
  transition: color 0.2s;
}

.disease-card:hover .tips-indicator {
  color: white;
}

/* Modal Styling for Details */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  z-index: 110;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 2rem;
  width: 90%;
  max-width: 600px;
  padding: 2.5rem;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.btn-close-modal {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  transition: background 0.2s;
}

.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.15);
}

.modal-header {
  margin-bottom: 1.5rem;
}

.modal-titles {
  display: flex;
  flex-direction: column;
}

.modal-ar {
  font-size: 2rem;
  font-weight: 900;
}

.modal-en {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 0.2rem;
}

.modal-body {
  margin-top: 1.5rem;
}

.modal-desc-box {
  background: rgba(255, 255, 255, 0.02);
  border-right: 4px solid var(--modal-accent);
  padding: 1.2rem;
  border-radius: 0.5rem;
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.tips-section h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #3b82f6;
}

.tips-list {
  list-style: none;
}

.tips-list li {
  position: relative;
  padding-right: 1.8rem;
  margin-bottom: 0.8rem;
  font-size: 1rem;
  line-height: 1.6;
}

.tips-list li::before {
  content: '✦';
  position: absolute;
  right: 0;
  color: var(--modal-accent);
  font-size: 1.1rem;
}

/* Quiz Section */
.quiz-section {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.5), rgba(15, 23, 42, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 2rem;
  padding: 3rem 2rem;
  margin-top: 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.quiz-badge {
  display: inline-block;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid #a78bfa;
  color: #c084fc;
  padding: 0.4rem 1.2rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.quiz-section h2 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
}

.quiz-container {
  max-width: 600px;
  margin: 0 auto;
}

.quiz-question-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 2rem;
  border-radius: 1.5rem;
  margin-bottom: 2rem;
}

.quiz-question-desc {
  font-size: 1.2rem;
  line-height: 1.6;
  color: #e2e8f0;
  margin-bottom: 1rem;
}

.btn-quiz-audio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 130, 246, 0.15);
  border: 1.5px solid #3b82f6;
  color: #60a5fa;
  padding: 0.6rem 1.5rem;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.3s ease;
}

.btn-quiz-audio:hover {
  background: #3b82f6;
  color: white;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 480px) {
  .quiz-options {
    grid-template-columns: 1fr;
  }
}

.btn-option {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 1rem;
  border-radius: 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-option:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.btn-option.correct {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: var(--success) !important;
  color: #34d399 !important;
}

.btn-option.wrong {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: var(--danger) !important;
  color: #f87171 !important;
}

.quiz-feedback {
  margin-top: 1.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  min-height: 28px;
}

.feedback-correct { color: #34d399; }
.feedback-wrong { color: #f87171; }

.quiz-score-container {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.quiz-score span {
  font-weight: 700;
  color: white;
}

/* Footer Section */
footer {
  text-align: center;
  padding: 3rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 5rem;
}

footer p {
  margin-bottom: 0.5rem;
}

footer a {
  color: #60a5fa;
  text-decoration: none;
}
