/**
 * ==============================================================================
 * ระบบห้องเรียนออนไลน์ครูแซมแซม (Krusamsam Online Classroom)
 * Custom Stylesheet (assets/css/custom.css)
 * ==============================================================================
 */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Prompt:wght@400;500;600;700&display=swap');

:root {
  --font-primary: 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Prompt', 'Sarabun', sans-serif;
  --classroom-blue: #1967d2;
  --classroom-blue-dark: #1557b0;
  --classroom-green: #137333;
  --classroom-purple: #7627bb;
  --classroom-yellow: #e37400;
  --classroom-rose: #d93025;
}

body {
  font-family: var(--font-primary);
  background-color: #f8fafc;
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-heading);
}

/* Scrollbar สวยงาม */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Card สไตล์ Google Classroom */
.classroom-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 1rem;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.classroom-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08), 0 10px 10px rgba(0, 0, 0, 0.04);
  border-color: #cbd5e1;
}

/* Header แบนเนอร์หัววิชา */
.classroom-banner {
  border-radius: 1rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.classroom-banner::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.25), transparent 70%);
  pointer-events: none;
}

/* ธีมสีห้องเรียน */
.theme-indigo {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
}
.theme-blue {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}
.theme-emerald {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}
.theme-purple {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}
.theme-rose {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
}
.theme-amber {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}
.theme-cyan {
  background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
}

/* Badge สถานะภาระงาน */
.badge-pending {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.badge-submitted {
  background-color: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.badge-graded {
  background-color: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

/* Item กิจกรรมแบบ Google Classroom */
.classwork-item {
  transition: all 0.2s ease-in-out;
  border-left: 4px solid transparent;
}

.classwork-item:hover {
  background-color: #f8fafc;
  border-left-color: #4f46e5;
}

/* กล่องคะแนนไฮไลท์ */
.score-pill {
  font-family: var(--font-heading);
  letter-spacing: -0.025em;
}

/* Tab Navigation สไตล์ Google Classroom */
.classroom-tab {
  position: relative;
  font-family: var(--font-heading);
  font-weight: 500;
  color: #64748b;
  transition: color 0.2s ease;
}

.classroom-tab.active {
  color: #4f46e5;
  font-weight: 600;
}

.classroom-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background-color: #4f46e5;
  border-radius: 3px 3px 0 0;
}

/* แอนิเมชัน Pulse นุ่มนวลสำหรับงานด่วน */
@keyframes softPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

.urgent-task-card {
  animation: softPulse 2.5s infinite ease-in-out;
}

/* ปรับแต่ง Modal ให้ดูหรูหรา */
.modal-backdrop {
  backdrop-filter: blur(4px);
  background-color: rgba(15, 23, 42, 0.6);
}

/* ป้ายแสดงคะแนนจิตพิสัย */
.affective-input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* SweetAlert2 Compact & Clean Modal (ลบช่องว่างส่วนเกินด้านบนและขอบ) */
.swal2-popup.compact-modal {
  padding: 1.5rem !important;
  border-radius: 1.5rem !important;
}

.swal2-popup.compact-modal .swal2-html-container {
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

.swal2-popup.compact-modal .swal2-header {
  display: none !important;
}

/* Modal ตรวจงาน / รายชื่อนักเรียน (กระชับ ไม่ห่างเกินไป) */
.swal2-popup.compact-submissions-modal {
  padding: 1.25rem 1.5rem !important;
  border-radius: 1.5rem !important;
}

.swal2-popup.compact-submissions-modal .swal2-title {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.swal2-popup.compact-submissions-modal .swal2-header {
  display: none !important;
}

.swal2-popup.compact-submissions-modal .swal2-html-container {
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

.swal2-popup.compact-submissions-modal .swal2-close {
  top: 0.75rem !important;
  right: 0.75rem !important;
  z-index: 50 !important;
}

/* แผนที่ผจญภัย 50 ด่าน (Adventure Map) */
@keyframes gold-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7), 0 0 15px rgba(245, 158, 11, 0.5);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0), 0 0 25px rgba(245, 158, 11, 0.8);
  }
}

.map-avatar-current {
  animation: gold-pulse 2s infinite;
}

