* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #ffffff;
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --accent-green: #27ae60;
  --accent-orange: #e67e22;
  --accent-red: #e74c3c;
  --easy-bg: #d4f1d4;
  --easy-color: #27ae60;
  --medium-bg: #fce4c5;
  --medium-color: #f39c12;
  --hard-bg: #fdd9d7;
  --hard-color: #e74c3c;
  --border-radius: 12px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 900px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  padding: 3rem;
  min-height: 600px;
}

/* Header Logo */
.header-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-bottom: 0.5rem;
}

.logo-text {
  font-size: 1.8rem;
  font-weight: bold;
  line-height: 1.2;
}

.logo-text.arabic {
  color: var(--text-primary);
  text-align: right;
}

.logo-text.english {
  color: var(--text-primary);
  text-align: left;
}

.logo-divider {
  width: 2px;
  height: 50px;
  background: linear-gradient(
    to bottom,
    var(--accent-red),
    var(--accent-green)
  );
}

.logo-date {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Screen Management */
.screen {
  display: none;
  animation: fadeIn 0.4s ease-in-out;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Welcome Content */
.welcome-content {
  text-align: center;
}

.welcome-content h1 {
  font-size: 2.2rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-weight: 600;
}

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

/* Form Container */
.form-container {
  max-width: 400px;
  margin: 0 auto;
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group input {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent-green);
}

.error-message {
  display: block;
  color: var(--accent-red);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  min-height: 1.25rem;
}

/* Level Buttons */
.level-buttons {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 3rem;
}

.level-btn {
  padding: 1.5rem 3rem;
  font-size: 1.3rem;
  font-weight: 600;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.level-btn.easy {
  background: var(--easy-bg);
  color: var(--easy-color);
}

.level-btn.medium {
  background: var(--medium-bg);
  color: var(--medium-color);
}

.level-btn.hard {
  background: var(--hard-bg);
  color: var(--hard-color);
}

.level-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Challenge Container */
.challenge-container {
  max-width: 800px;
  margin: 0 auto;
}

.challenge-badge {
  text-align: left;
  margin-bottom: 2rem;
}

.difficulty-label {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: capitalize;
}

.difficulty-label.easy {
  background: var(--easy-bg);
  color: var(--easy-color);
}

.difficulty-label.medium {
  background: var(--medium-bg);
  color: var(--medium-color);
}

.difficulty-label.hard {
  background: var(--hard-bg);
  color: var(--hard-color);
}

/* Question Content */
.question-content h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 2rem;
  font-weight: 600;
}

.code-snippet {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 3rem;
}

.code-snippet pre {
  font-family: "Courier New", monospace;
  font-size: 1.4rem;
  color: var(--text-primary);
  margin: 0;
}

.blank-dots {
  color: var(--accent-orange);
  font-weight: bold;
  letter-spacing: 2px;
}

/* Answer Options */
.answer-options {
  margin-bottom: 3rem;
}

.options-container {
  text-align: center;
}

.options-label {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.option-buttons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.option-btn {
  padding: 1.2rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 500;
  background: var(--accent-orange);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.option-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.option-btn.active {
  background: #2980b9;
  transform: scale(1.05);
}

.option-btn.correct {
  background: var(--accent-green);
  animation: pulse 0.6s ease;
}

.option-btn.incorrect {
  background: var(--accent-red);
  animation: shake 0.5s ease;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

/* Challenge Footer */
.challenge-footer {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

/* Buttons */
.btn {
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.btn-start {
  width: 100%;
  background: var(--accent-green);
  color: white;
}

.btn-hint {
  background: #f39c12;
  color: white;
}

.btn-submit {
  background: var(--accent-green);
  color: white;
}

.btn-certificate {
  background: #3498db;
  color: white;
}

.btn-restart {
  background: var(--text-secondary);
  color: white;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Success Container */
.success-container {
  text-align: center;
  padding: 2rem;
}

.success-icon {
  font-size: 5rem;
  margin-bottom: 1rem;
  animation: bounce 0.6s ease;
}

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

.success-container h1 {
  font-size: 2.5rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.success-message {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.completion-time {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: var(--border-radius);
  display: inline-block;
}

.success-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 2rem;
  }

  .welcome-content h1 {
    font-size: 1.8rem;
  }

  .level-buttons {
    flex-direction: column;
    align-items: center;
  }

  .level-btn {
    width: 200px;
  }

  .option-buttons {
    flex-direction: column;
    align-items: center;
  }

  .option-btn {
    width: 250px;
  }

  .challenge-footer,
  .success-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 200px;
  }
}
