:root {
  --primary-color: #3498db;
  --primary-dark: #2980b9;
  --secondary-color: #f39c12;
  --text-color: #333;
  --light-gray: #f8f9fa;
  --border-color: #e0e0e0;
  --success-color: #2ecc71;
  --warning-color: #f1c40f;
  --danger-color: #e74c3c;
  --shadow: 0 4px 6px rgba(0,0,0,0.1);
  --card-radius: 8px;
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #f5f7fa;
  padding: 0;
  margin: 0;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

header {
  background-color: var(--primary-color);
  color: white;
  padding: 20px 0;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 {
  margin: 0;
  font-size: 1.8rem;
}

.progress-container {
  width: 100%;
  background-color: rgba(255,255,255,0.3);
  border-radius: 10px;
  margin-top: 10px;
  height: 8px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  width: 10%;
  background-color: white;
  border-radius: 10px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.8rem;
  margin-top: 5px;
  color: rgba(255,255,255,0.9);
}

nav {
  background-color: white;
  padding: 12px 0;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  position: sticky;
  top: 100px;
  z-index: 90;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.nav-btn {
  padding: 10px 18px;
  background-color: white;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
  font-weight: 500;
  outline: none;
}

.nav-btn:hover, .nav-btn.active {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.question-card {
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  padding: 25px;
  margin-bottom: 25px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.question-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.invalid {
  border: 2px solid var(--danger-color) !important;
  background-color: rgba(231, 76, 60, 0.05) !important;
}

.error-message {
  color: var(--danger-color);
  font-size: 0.9rem;
  margin-top: 5px;
  font-weight: 500;
}

.success-message {
  background-color: var(--success-color);
  color: white;
  padding: 15px;
  border-radius: var(--card-radius);
  margin-bottom: 20px;
  text-align: center;
  font-weight: 500;
  animation: fadeIn 0.3s ease;
}

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

.section-title {
  color: var(--primary-color);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-color);
  font-size: 1.5rem;
}

.question-title {
  color: var(--text-color);
  margin-bottom: 15px;
  font-size: 1.2rem;
  font-weight: 600;
}

.question-content {
  margin-bottom: 20px;
}

label {
  font-weight: 600;
  display: block;
  margin-top: 15px;
  margin-bottom: 5px;
  color: var(--text-color);
}

input[type="text"],
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 15px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  background-color: var(--light-gray);
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  margin-top: 20px;
}

.btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

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

.btn-secondary:hover {
  background-color: #e67e22;
}

.btn-block {
  display: block;
  width: 100%;
}

.radio-group {
  margin-top: 10px;
}

.radio-option {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  transition: var(--transition);
  cursor: pointer;
  background-color: white;
}

.radio-option:hover {
  background-color: var(--light-gray);
}

/* 인용문 박스 스타일 */
.quote-box {
  background-color: var(--light-gray);
  border-left: 4px solid var(--primary-color);
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 0 6px 6px 0;
}

.quote-text {
  font-style: italic;
  color: #555;
  margin-bottom: 10px;
}

.quote-source {
  font-size: 0.9rem;
  text-align: right;
  color: #777;
}

/* 별점 스타일 */
.star-rating {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  margin-top: 10px;
}

.star-rating input {
  display: none;
}

.star-rating label {
  cursor: pointer;
  width: 40px;
  height: 40px;
  background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23ddd" d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 36px;
  transition: var(--transition);
  margin: 0;
  padding: 0;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
  background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23f39c12" d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>');
}

/* 슬라이더 스타일 */
.slider-container {
  margin-top: 15px;
  padding: 0 10px;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.slider-label {
  font-size: 0.9rem;
  color: #666;
}

.range-slider {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: #ddd;
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  transition: var(--transition);
}

.range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  transition: var(--transition);
}

.range-slider::-webkit-slider-thumb:hover {
  background: var(--primary-dark);
  transform: scale(1.2);
}

.range-slider::-moz-range-thumb:hover {
  background: var(--primary-dark);
  transform: scale(1.2);
}

.slider-value {
  text-align: center;
  margin-top: 10px;
  font-weight: 600;
  color: var(--primary-color);
}

/* 신호등 스타일 */
.traffic-light-container {
  display: flex;
  justify-content: space-around;
  margin: 20px 0;
}

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

.traffic-light {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-bottom: 10px;
  transition: var(--transition);
  border: 3px solid transparent;
}

.traffic-light.red {
  background-color: #e74c3c;
}

.traffic-light.yellow {
  background-color: #f1c40f;
}

.traffic-light.green {
  background-color: #2ecc71;
}

.traffic-light-option input {
  display: none;
}

.traffic-light-option input:checked + .traffic-light {
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
  border-color: #333;
}

.traffic-light-label {
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
}

/* 반응형 스타일 */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  
  header h1 {
    font-size: 1.5rem;
  }
  
  .question-card {
    padding: 15px;
  }
  
  .nav-btn {
    padding: 8px 15px;
    font-size: 0.8rem;
  }
  
  .traffic-light {
    width: 50px;
    height: 50px;
  }
}

/* 책 관련 스타일 */
.book-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-bottom: 30px;
  background-color: white;
  border-radius: var(--card-radius);
  padding: 25px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.book-cover-large {
  flex: 0 0 200px;
}

.cover-image-large {
  width: 100%;
  box-shadow: var(--shadow);
  border-radius: 5px;
}

.book-info-detail {
  flex: 1;
  min-width: 300px;
}

.book-info-detail h2 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 1.8rem;
}

.author, .publisher, .publish-date {
  margin-bottom: 10px;
  color: #555;
}

.book-description {
  margin-top: 20px;
}

.book-description h3 {
  margin-bottom: 10px;
  color: var(--text-color);
  font-size: 1.2rem;
}

.activity-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 30px;
}

.activity-button {
  flex: 1;
  min-width: 200px;
  padding: 15px;
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  border-radius: var(--card-radius);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.activity-button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.back-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.back-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* 도서 목록 스타일 */
.simple-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}

.book-item {
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s ease;
  background-color: white;
  border-radius: var(--card-radius);
  padding: 20px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.book-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.book-cover-simple {
  margin-bottom: 15px;
  background-color: #f8f8f8;
  padding: 10px;
  border-radius: 5px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-cover-simple img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.book-title {
  font-size: 1.2rem;
  margin-bottom: 5px;
  color: var(--primary-color);
}

.book-author {
  color: #666;
  font-size: 0.9rem;
}

.header {
  text-align: center;
  margin-bottom: 40px;
}

.header h1 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 10px;
}

/* Unified submit button styles */
.submit-button {
  display: block;
  margin: 0 auto;
  padding: 15px 40px;
  background-color: var(--success-color);
  color: white;
  border: none;
  border-radius: 30px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  min-width: 160px;
}

.submit-button:hover {
  background-color: #27ae60;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.submit-button:active {
  transform: translateY(0);
}

.submit-button:disabled {
  background-color: #95a5a6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Unified form-actions container */
.form-actions {
  display: flex;
  justify-content: center;
  margin: 40px 0 60px;
}
