/* Main Styles for Survey - Preschool Children Theme */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Comic Sans MS", "Chalkboard SE", "Arial", sans-serif;
  background-color: #e9f5ff;
  color: #333;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="20" cy="20" r="8" fill="%23FFD700" opacity="0.3"/><circle cx="60" cy="40" r="12" fill="%23FF6B6B" opacity="0.2"/><circle cx="80" cy="80" r="10" fill="%2387CEEB" opacity="0.3"/><circle cx="40" cy="70" r="7" fill="%2398FB98" opacity="0.3"/></svg>');
  background-repeat: repeat;
}

.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 15px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.survey-box {
  background-color: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  padding: 25px;
  width: 100%;
  border: 5px solid #ffd700;
  position: relative;
}

/* Add decorative elements */
.survey-box::before {
  content: "★";
  position: absolute;
  top: -15px;
  left: 20px;
  font-size: 30px;
  color: #ff6b6b;
  z-index: 1;
}

.survey-box::after {
  content: "♥";
  position: absolute;
  top: -15px;
  right: 20px;
  font-size: 30px;
  color: #ff6b6b;
  z-index: 1;
}

h1 {
  text-align: center;
  margin-bottom: 20px;
  color: #ff6b6b;
  font-size: 1.5rem;
  line-height: 1.3;
  text-shadow: 1px 1px 0 #ffc0cb;
}

h2 {
  text-align: center;
  margin-bottom: 15px;
  color: #5dade2;
  font-size: 1.3rem;
  background-color: #f8f9fa;
  padding: 8px;
  border-radius: 10px;
}

p {
  margin-bottom: 20px;
  text-align: center;
  font-size: 1.1rem;
}

.question {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 25px;
  line-height: 1.4;
  color: #6a0dad;
  background-color: #f0f8ff;
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  border: 2px dashed #87ceeb;
}

.replay-button {
  background-color: #ff9800;
  color: white;
  border: 2px solid #e68a00;
  border-radius: 30px;
  padding: 10px 15px;
  font-size: 1rem;
  cursor: pointer;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  max-width: 200px;
}

.replay-button .sound-icon {
  margin-right: 8px;
  font-size: 1.2rem;
}

.replay-button:hover {
  background-color: #e68a00;
  transform: scale(1.05);
}

.replay-button:active {
  transform: scale(0.98);
}

.replay-button.speaking {
  background-color: #e68a00;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 152, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 152, 0, 0);
  }
}

.gender-selection {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 25px 0;
}

.gender-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.gender-option input[type="radio"] {
  margin-bottom: 10px;
  transform: scale(1.5);
  cursor: pointer;
}

.gender-option label {
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  color: #ff6b6b;
  padding: 5px 15px;
  background-color: #fff9c4;
  border-radius: 15px;
  transition: all 0.3s;
}

.gender-option label:hover {
  background-color: #ffe082;
}

.answer-options {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}

.answer-option {
  width: 100%;
  max-width: 250px;
  text-align: center;
  cursor: pointer;
  position: relative;
}

.answer-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.answer-option label {
  display: block;
  padding: 12px;
  border: 3px solid #87ceeb;
  border-radius: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
  background-color: #f8f9fa;
}

.answer-option img {
  max-width: 100%;
  height: auto;
  border-radius: 15px;
  display: block;
}

.answer-option input[type="radio"]:checked + label {
  border-color: #ff6b6b;
  box-shadow: 0 0 15px rgba(255, 107, 107, 0.5);
  transform: scale(1.05);
  background-color: #fff9c4;
}

.btn {
  display: block;
  width: 100%;
  max-width: 250px;
  margin: 0 auto;
  padding: 15px 20px;
  background-color: #5dade2;
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s ease;
  -webkit-appearance: none; /* Remove default styling on iOS */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
  border: 3px solid #3498db;
}

.btn:hover,
.btn:active {
  background-color: #3498db;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.progress-bar {
  width: 100%;
  height: 15px;
  background-color: #f8f9fa;
  border-radius: 50px;
  margin-bottom: 20px;
  overflow: hidden;
  border: 2px solid #87ceeb;
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, #87ceeb, #5dade2);
  border-radius: 50px;
  transition: width 0.3s ease;
}

.completion-message {
  background-color: #e8f8f5;
  color: #27ae60;
  padding: 20px;
  border-radius: 15px;
  margin: 25px 0;
  text-align: center;
  border: 3px solid #a3e4d7;
  font-weight: bold;
  font-size: 1.2rem;
}

/* Responsive adjustments for mobile */
@media (min-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  .answer-options {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }

  .answer-option {
    flex: 1;
    min-width: 150px;
    max-width: 200px;
  }
}

@media (max-width: 767px) {
  .survey-box {
    padding: 20px;
  }

  .btn {
    padding: 15px;
    font-size: 1.1rem;
  }

  .gender-selection {
    gap: 30px;
  }

  /* Make radio buttons easier to tap on mobile */
  .gender-option input[type="radio"],
  .answer-option input[type="radio"] {
    transform: scale(1.8);
  }

  /* Increase tap target size */
  .answer-option label {
    padding: 10px;
  }
}

/* Fix for iOS input styling */
input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  background-color: #fff;
  margin: 0;
  width: 25px;
  height: 25px;
  border: 3px solid #5dade2;
  border-radius: 50%;
  display: grid;
  place-content: center;
}

input[type="radio"]::before {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 50%;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em #ff6b6b;
  background-color: #ff6b6b;
}

input[type="radio"]:checked::before {
  transform: scale(1);
}

/* Animation effects */
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

.survey-box {
  animation: float 6s ease-in-out infinite;
}

/* Teacher button styling */
.teacher-info-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
}

.teacher-btn {
  background-color: #ff9800;
  border: 3px solid #e68a00;
  color: white;
  padding: 10px 15px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  -webkit-appearance: none;
}

.teacher-btn:hover {
  background-color: #e68a00;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

/* Modal styling */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-content {
  background-color: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 25px;
  border: 5px solid #ffd700;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #ff6b6b;
  cursor: pointer;
  transition: all 0.3s;
}

.close-btn:hover {
  color: #e74c3c;
  transform: scale(1.2);
}

.modal-body {
  margin: 20px 0;
  line-height: 1.6;
}

.modal-content h2 {
  color: #ff6b6b;
  text-align: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px dashed #87ceeb;
}

.modal-content h3 {
  color: #5dade2;
  margin: 15px 0;
  font-size: 1.2rem;
}

.modal-content p {
  margin-bottom: 15px;
  text-align: left;
  font-size: 1rem;
}

.close-modal-btn {
  margin: 15px auto 0;
  background-color: #5dade2;
  max-width: 150px;
}

/* Responsive adjustments for modal */
@media (max-width: 767px) {
  .teacher-info-container {
    top: 10px;
    right: 10px;
  }

  .teacher-btn {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .modal-content {
    padding: 15px;
    max-height: 85vh;
  }

  .modal-content h2 {
    font-size: 1.3rem;
  }

  .modal-content h3 {
    font-size: 1.1rem;
  }

  .modal-content p {
    font-size: 0.95rem;
  }
}

