/* styles.css - نسخة متجاوبة مع دعم اللغة */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  direction: rtl;
  padding: 10px;
}

/* دعم اللغة الإنجليزية */
body.en {
  direction: ltr;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  max-width: 1100px;
  width: 100%;
  margin: 10px auto;
  padding: 20px;
  border-radius: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.header {
  text-align: center;
  margin-bottom: 20px;
  position: relative;
}

.lang-switcher {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  gap: 5px;
}

body.en .lang-switcher {
  left: auto;
  right: 0;
}

.lang-btn {
  background: white;
  border: 1px solid #bae6fd;
  padding: 5px 10px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.3s;
  color: #0369a1;
}

.lang-btn.active {
  background: #0284c7;
  color: white;
  border-color: #0284c7;
}

.header h1 {
  color: #0369a1;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 5px;
  letter-spacing: -0.5px;
}

.subtitle {
  color: #0284c7;
  font-size: 1rem;
  font-weight: 300;
  margin-bottom: 5px;
}

.developer {
  color: #38bdf8;
  font-size: 0.8rem;
  font-weight: 300;
  border-top: 1px solid #bae6fd;
  padding-top: 8px;
  margin-top: 8px;
}

.question-row {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.question-field {
  flex: 3;
  min-width: 200px;
}

.question-field label {
  display: block;
  font-weight: 600;
  color: #0369a1;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.question-field textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #bae6fd;
  border-radius: 15px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  background: white;
  transition: border-color 0.3s;
}

.counter-field {
  flex: 1;
  min-width: 100px;
}

.counter-field label {
  display: block;
  font-weight: 600;
  color: #0369a1;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.question-number-input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #bae6fd;
  border-radius: 15px;
  font-size: 1rem;
  background: #f0f9ff;
  text-align: center;
  min-height: 60px;
  box-sizing: border-box;
  cursor: default;
  color: #0369a1;
  font-weight: 600;
}

.options-label {
  text-align: right;
  margin-bottom: 10px;
  font-weight: 600;
  color: #0369a1;
}

body.en .options-label {
  text-align: left;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 15px 0 25px;
  background: #f0f9ff;
  padding: 15px;
  border-radius: 50px;
  border: 1px solid #bae6fd;
}

.radio-group label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  border-radius: 40px;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  color: #0369a1;
  font-weight: 600;
  border: 2px solid #bae6fd;
  padding: 0 8px;
}

.radio-group label:hover {
  background: #38bdf8;
  color: white;
  border-color: #38bdf8;
}

.radio-group input[type="radio"] {
  accent-color: #0284c7;
  width: 16px;
  height: 16px;
  margin-left: 3px;
  margin-right: 3px;
}

/* حاوية الخيارات */
#choices-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.form-element {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: #f0f9ff;
  padding: 15px;
  border-radius: 20px;
  border: 1px solid #bae6fd;
}

.form-element label {
  font-weight: 600;
  color: #0369a1;
  min-width: 60px;
}

.choice-input {
  flex: 1 1 200px;
  padding: 12px 15px;
  border: 2px solid #bae6fd;
  border-radius: 15px;
  font-size: 1rem;
  transition: border-color 0.3s;
  min-width: 150px;
}

.choice-input:focus {
  outline: none;
  border-color: #38bdf8;
}

.correct-answer-radio {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #0284c7;
}

.answer-indicator {
  color: #be123c;
  font-weight: 600;
  font-size: 0.85rem;
  background: #ffe4e6;
  padding: 5px 10px;
  border-radius: 30px;
  white-space: nowrap;
}

.checkbox-group {
  margin: 20px 0;
  text-align: center;
}

.checkbox-group label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f0f9ff;
  padding: 10px 20px;
  border-radius: 40px;
  border: 1px solid #bae6fd;
  color: #0369a1;
  cursor: pointer;
  transition: background 0.3s;
  font-size: 0.95rem;
}

button, .button-link {
  display: inline-block;
  width: 100%;
  padding: 15px 20px;
  border: none;
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 40px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  text-decoration: none;
  margin: 8px 0;
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.3);
}

button:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.6;
}

.form-result-message {
  text-align: center;
  padding: 12px;
  margin-top: 15px;
  border-radius: 40px;
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
  display: none;
}

.form-result-message.error {
  background: #fee2e2;
  color: #991b1b;
}

.footer {
  width: 100%;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(5px);
  padding: 15px 0;
  margin-top: 20px;
  border-top: 1px solid #bae6fd;
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  color: #0369a1;
  font-size: 0.9rem;
  flex-wrap: wrap;
  gap: 10px;
}

/* تحسينات للجوال */
@media (max-width: 768px) {
  body {
    padding: 5px;
  }

  .container {
    padding: 15px;
    border-radius: 20px;
  }

  .lang-switcher {
    position: static;
    justify-content: center;
    margin-bottom: 10px;
  }

  .header h1 {
    font-size: 1.8rem;
  }

  .question-row {
    flex-direction: column;
    gap: 10px;
  }

  .question-field, .counter-field {
    width: 100%;
  }

  .radio-group {
    border-radius: 30px;
    padding: 10px;
    gap: 5px;
  }

  .radio-group label {
    min-width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }

  .form-element {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  .form-element label {
    margin-bottom: 5px;
  }

  .choice-input {
    width: 100%;
  }

  .correct-answer-radio {
    align-self: flex-start;
  }

  .answer-indicator {
    align-self: flex-start;
    font-size: 0.8rem;
  }

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

/* تحسينات للشاشات الصغيرة جداً */
@media (max-width: 480px) {
  .radio-group label {
    min-width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .checkbox-group label {
    font-size: 0.85rem;
    padding: 8px 15px;
  }

  button, .button-link {
    font-size: 1rem;
    padding: 12px;
  }
}