/* Mobile-First CSS for Education-Feedback System */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
  /* Primary Colors */
  --primary: #2d3c8e;       /* W&W Navy Blue */
  --primary-light: #5a67a3;
  --primary-dark: #192654;
  --secondary: #e63323;     /* W&W Red */
  --secondary-light: #ff6652;
  --secondary-dark: #b61800;
  
  /* Neutral Colors */
  --neutral-100: #ffffff;
  --neutral-200: #f8f9fa;
  --neutral-300: #e9ecef;
  --neutral-400: #dee2e6;
  --neutral-500: #adb5bd;
  --neutral-600: #6c757d;
  --neutral-700: #495057;
  --neutral-800: #343a40;
  --neutral-900: #212529;
  
  /* Status Colors */
  --success: #28a745;
  --info: #17a2b8;
  --warning: #ffc107;
  --danger: #dc3545;
  
  /* Fonts */
  --font-primary: 'Prompt', sans-serif;
  --font-secondary: 'Sarabun', sans-serif;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 3rem;
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-pill: 50rem;
  --radius-circle: 50%;
  
  /* Shadows */
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 1rem 2rem rgba(0, 0, 0, 0.15);
}

/* Base Styles */
html {
  font-size: 16px;
}

body {
  font-family: var(--font-secondary);
  background-color: var(--neutral-200);
  color: var(--neutral-800);
  line-height: 1.5;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 500;
  margin-bottom: var(--spacing-md);
}

/* Container for Mobile */
.container-fluid, .container {
  padding: 0 var(--spacing-md);
}

/* Card Styles */
.card {
  background: var(--neutral-100);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: none;
  margin-bottom: var(--spacing-lg);
  overflow: hidden;
}

.card-header {
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--neutral-300);
  background-color: var(--neutral-100);
  position: relative;
}

.card-body {
  padding: var(--spacing-lg);
}

.card-footer {
  padding: var(--spacing-md) var(--spacing-lg);
  background-color: var(--neutral-100);
  border-top: 1px solid var(--neutral-300);
}

/* Form Styles */
.form-floating {
  position: relative;
  margin-bottom: var(--spacing-md);
}

.form-control {
  height: 58px;
  padding: 1.2rem 1rem 0.5rem;
  font-size: 1rem;
  border: 2px solid var(--neutral-400);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.1rem rgba(45, 60, 142, 0.25);
}

.form-floating > label {
  position: absolute;
  top: 0;
  left: 0;
  height: 58px;
  padding: 1.2rem 1rem;
  pointer-events: none;
  transform-origin: 0 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  color: var(--neutral-600);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
  opacity: 0.8;
  transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* Rating Scale Styles */
.rating-group {
  display: flex;
  justify-content: center; /* จัดให้อยู่ตรงกลาง */
  align-items: center;
  gap: 10px;
  margin: 0.5rem auto 1rem;
  padding: 10px 0;
  flex-wrap: wrap; /* สำหรับหน้าจอเล็ก */
  width: fit-content; /* ให้กว้างพอดีกับเนื้อหา */
}

.rating-item {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.rating-input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.rating-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--neutral-200);
  color: var(--neutral-700);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid var(--neutral-300);
}

.rating-input:checked + .rating-circle,
.rating-circle.selected {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary-dark);
  transform: scale(1.1);
}

.rating-circle:hover {
  background-color: var(--primary-light);
  color: white;
  transform: scale(1.05);
}

/* ปรับปรุงการแสดงผล label สำหรับสเกลคะแนน */
.rating-scale-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 290px; /* ปรับความกว้างให้ตรงกับปุ่ม */
  margin: 0.25rem auto 0.5rem; /* จัดให้อยู่ตรงกลาง */
  font-size: 0.85rem;
  color: var(--neutral-600);
}

/* Animation Effects */
@keyframes bounce {
  0%, 100% { transform: scale(1.1); }
  50% { transform: scale(1.2); }
}

.bounce {
  animation: bounce 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

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

.slide-up {
  animation: slideUp 0.3s ease forwards;
}

/* Textarea Styles */
.form-textarea {
  margin-bottom: var(--spacing-xl);
}

.form-textarea textarea {
  min-height: 120px;
  padding: var(--spacing-md);
  resize: vertical;
}

/* Button Styles */
.btn {
  font-family: var(--font-primary);
  font-weight: 500;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.5rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  border: none;
  text-transform: none;
  letter-spacing: 0.5px;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

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

.btn-primary:hover {
  background-color: var(--primary-dark);
}

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

.btn-success:hover {
  background-color: #218838;
}

.btn-outline-primary {
  border: 2px solid var(--primary);
  color: var(--primary);
  background-color: transparent;
}

.btn-outline-primary:hover {
  background-color: var(--primary);
  color: white;
}

/* Navigation */
.section-nav {
  display: flex;
  justify-content: center;
  margin: var(--spacing-lg) 0;
}

.section-dots {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
}

.section-dot {
  width: 10px;
  height: 10px;
  background-color: var(--neutral-400);
  border-radius: var(--radius-circle);
  margin: 0 var(--spacing-xs);
  transition: all 0.2s ease;
}

.section-dot.active {
  background-color: var(--primary);
  transform: scale(1.2);
}

/* Question Group Header - แก้ไขสไตล์เพื่อป้องกันการแสดงผิดพลาด */
.question-group-header {
  color: var(--primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
  position: relative;
  text-align: center;
  font-weight: 500;
  padding-bottom: 15px;
}

.question-group-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background-color: var(--primary);
  border-radius: 3px;
}

/* Progress Bar */
.form-progress {
  height: 5px;
  background-color: var(--neutral-300);
  border-radius: var(--radius-pill);
  margin: var(--spacing-md) 0;
  overflow: hidden;
}

.form-progress-bar {
  height: 100%;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

/* Section Header - Updated for centered alignment */
.section-header {
  display: flex;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  flex-direction: column;
  text-align: center;
}

.section-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-circle);
  background-color: var(--primary);
  color: white;
  font-weight: bold;
  margin-right: var(--spacing-md);
  flex-shrink: 0;
}

.section-title {
  margin: 0;
  color: var(--primary);
}

/* Center aligned form controls */
.center-form {
  max-width: 500px;
  margin: 0 auto;
}

/* Form containers with improved spacing */
.form-group-container {
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  background-color: var(--neutral-100);
  box-shadow: var(--shadow-sm);
}

.form-label.centered {
  text-align: center;
  display: block;
  margin-bottom: var(--spacing-md);
  font-weight: 500;
}

/* Improve select dropdown and input fields */
.form-select, .form-control {
  border: 2px solid var(--neutral-400);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.form-select:focus, .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.25rem rgba(45, 60, 142, 0.25);
}

/* Updated Navigation buttons */
.section-nav {
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}

.form-section[data-section="1"] .section-nav {
  margin-top: var(--spacing-xl);
}

/* Buttons with improved mobile styling */
@media (max-width: 575.98px) {
  html {
    font-size: 15px;
  }
  
  .card-body {
    padding: var(--spacing-md);
  }
  
  .rating-item {
    max-width: 50px;
  }
  
  .rating-circle {
    width: 36px;
    height: 36px;
  }
  
  .btn {
    padding: 12px 16px;
    font-size: 1rem;
    margin-bottom: var(--spacing-sm);
    width: 100%;
  }
  
  .section-header {
    margin-bottom: var(--spacing-md);
  }
  
  .section-number {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }
  
  .section-title {
    font-size: 1.25rem;
  }
}

/* Course Info Card - Enhanced styling */
#courseInfo, #employeeInfo {
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  border-radius: var(--radius-md);
  background-color: var(--neutral-100);
}

#courseInfo::before, #employeeInfo::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background-color: var(--primary);
  opacity: 0.8;
}

#courseInfo p, #employeeInfo p {
  position: relative;
  z-index: 1;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px dashed rgba(0,0,0,0.1);
}

#courseInfo p:last-child, #employeeInfo p:last-child {
  border-bottom: none;
}

#courseInfo p strong, #employeeInfo p strong {
  display: inline-block;
  min-width: 100px;
  color: var(--primary-dark);
}

#courseInfo .badge {
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.badge.bg-success {
  background-color: var(--success) !important;
}

.badge.bg-primary {
  background-color: var(--primary) !important;
}

/* Animation for info cards */
@keyframes slideInRight {
  from {
    transform: translateX(30px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

#courseInfo, #employeeInfo {
  animation: slideInRight 0.3s ease forwards;
}

/* Summary Card Styles */
.card-summary {
  background-color: var(--neutral-100);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: all 0.3s ease;
  margin-bottom: var(--spacing-lg);
}

.card-summary:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.card-summary .card-body {
  padding: var(--spacing-lg);
}

.card-summary h5 {
  font-family: var(--font-primary);
  color: var(--primary);
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  display: flex;
  align-items: center;
}

.card-summary h5 i {
  margin-right: 10px;
  font-size: 1.2em;
  opacity: 0.8;
}

.summary-info p {
  margin-bottom: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed rgba(0,0,0,0.07);
  display: flex;
  flex-wrap: wrap;
}

.summary-info p:last-child {
  border-bottom: none;
}

.summary-info p strong {
  display: inline-block;
  min-width: 130px;
  color: var(--neutral-700);
}

/* Animation for summary card */
.form-section[data-section="3"] .card-summary {
  animation: fadeInDown 0.5s ease forwards;
}

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

/* Mobile adjustments for summary card */
@media (max-width: 767.98px) {
  .summary-info p {
    display: block;
  }
  
  .summary-info p strong {
    display: block;
    min-width: 100%;
    margin-bottom: 0.2rem;
    color: var(--primary-dark);
  }
  
  .summary-info p span {
    padding-left: 0.5rem;
  }
  
  .card-summary h5 {
    text-align: center;
    display: block;
  }
  
  .card-summary h5 i {
    margin-right: 5px;
  }
}
