/* ═══════════════════════════════════════════════════════════════
   SK Eval — Main CSS
   โรงเรียนสวนกุหลาบวิทยาลัย | Pink & Blue Theme
   Font: Sarabun (Google Fonts)
═══════════════════════════════════════════════════════════════ */

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

/* ─── CSS Custom Properties ─────────────────────────────────── */
:root {
  /* Brand Colors */
  --pink-50:    #fce4ec;
  --pink-100:   #f8bbd0;
  --pink-200:   #f48fb1;
  --pink-400:   #ec407a;
  --pink-500:   #e91e63;
  --pink-600:   #c2185b;
  --pink-700:   #ad1457;

  --blue-50:    #e3f2fd;
  --blue-100:   #bbdefb;
  --blue-200:   #90caf9;
  --blue-400:   #42a5f5;
  --blue-500:   #2196f3;
  --blue-600:   #1976d2;
  --blue-700:   #1565c0;

  /* UI Tokens */
  --primary:         var(--pink-600);
  --primary-light:   var(--pink-50);
  --secondary:       var(--blue-600);
  --secondary-light: var(--blue-50);
  --accent:          var(--pink-400);

  --bg-page:      #f8f0f6;
  --bg-card:      #ffffff;
  --bg-header:    linear-gradient(135deg, #c2185b 0%, #1565c0 100%);
  --bg-header-soft: linear-gradient(135deg, #f8bbd0 0%, #bbdefb 100%);

  --text-primary:   #1a1a2e;
  --text-secondary: #5c5c7a;
  --text-muted:     #9e9ea8;
  --text-on-pink:   #ffffff;

  --border-radius-sm:  8px;
  --border-radius-md:  12px;
  --border-radius-lg:  20px;
  --border-radius-xl:  28px;

  --shadow-sm:  0 2px 8px rgba(194,24,91,.08);
  --shadow-md:  0 4px 20px rgba(194,24,91,.12);
  --shadow-lg:  0 8px 40px rgba(194,24,91,.16);

  --transition: all .2s cubic-bezier(.4,0,.2,1);
  --transition-slow: all .35s cubic-bezier(.4,0,.2,1);

  /* Score Colors */
  --score-5: #2e7d32;
  --score-4: #66bb6a;
  --score-3: #f57c00;
  --score-2: #e64a19;
  --score-1: #b71c1c;
  --score-na: #78909c;

  /* Grade Colors */
  --grade-excellent:  #1b5e20;
  --grade-verygood:   #2e7d32;
  --grade-good:       #f57c00;
  --grade-develop:    #e64a19;
  --grade-urgent:     #b71c1c;
}

/* ─── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Sarabun', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
}

/* ─── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-family: 'Sarabun', sans-serif; font-weight: 700; line-height: 1.3; }
button, input, select, textarea, label, a {
  font-family: 'Sarabun', sans-serif;
}

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--pink-50); }
::-webkit-scrollbar-thumb { background: var(--pink-200); border-radius: 99px; }

/* ─── Links ──────────────────────────────────────────────────── */
a { color: var(--secondary); text-decoration: none; }
a:hover { color: var(--blue-700); }

/* ─── Cards ──────────────────────────────────────────────────── */
.sk-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: var(--transition);
}
.sk-card:hover { box-shadow: var(--shadow-md); }

/* ─── Gradient Header ────────────────────────────────────────── */
.sk-header {
  background: var(--bg-header);
  color: white;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.sk-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sk-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
}
.sk-header-brand img { width: 36px; height: 36px; border-radius: 50%; }
.sk-header-actions { display: flex; align-items: center; gap: 12px; }

/* ─── Avatar ─────────────────────────────────────────────────── */
.sk-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5);
  object-fit: cover;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn-sk-primary {
  background: linear-gradient(135deg, var(--pink-600), var(--blue-600));
  color: white;
  border: none;
  border-radius: 50px;
  padding: 10px 24px;
  font-family: 'Sarabun', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 3px 12px rgba(194,24,91,.3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-sk-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(194,24,91,.4);
}
.btn-sk-primary:active { transform: translateY(0); }

.btn-sk-secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--pink-200);
  border-radius: 50px;
  padding: 9px 22px;
  font-family: 'Sarabun', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-sk-secondary:hover {
  background: var(--pink-50);
  border-color: var(--primary);
}

.btn-sk-outline {
  background: transparent;
  color: var(--secondary);
  border: 2px solid var(--blue-200);
  border-radius: 50px;
  padding: 8px 20px;
  font-family: 'Sarabun', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-sk-outline:hover { background: var(--blue-50); border-color: var(--secondary); }

.btn-sk-danger {
  background: #b71c1c;
  color: white;
  border: none;
  border-radius: 50px;
  padding: 8px 20px;
  font-family: 'Sarabun', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-sk-danger:hover { background: #c62828; transform: translateY(-1px); }

.btn-sm { padding: 6px 14px; font-size: .85rem; white-space: nowrap; }

/* ─── Form Controls ──────────────────────────────────────────── */
.sk-input, .sk-select, .sk-textarea {
  font-family: 'Sarabun', sans-serif;
  font-size: .95rem;
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: var(--border-radius-md);
  background: white;
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}
.sk-input:focus, .sk-select:focus, .sk-textarea:focus {
  border-color: var(--pink-400);
  box-shadow: 0 0 0 3px rgba(236,64,122,.12);
}
.sk-textarea { resize: vertical; min-height: 100px; }
.sk-label {
  font-family: 'Sarabun', sans-serif;
  font-weight: 600;
  font-size: .9rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 5px;
}

/* ─── Custom Select UI ───────────────────────────────────────── */
.sk-custom-select-wrapper {
  position: relative;
  width: 100%;
}
.sk-custom-select-trigger {
  font-family: 'Sarabun', sans-serif;
  font-size: .95rem;
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: var(--border-radius-md);
  background: white url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='20' height='20'%3E%3Cpath fill='%235c5c7a' d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  display: flex;
  align-items: center;
  user-select: none;
}
.sk-custom-select-trigger:focus, .sk-custom-select-trigger.active {
  border-color: var(--pink-400);
  box-shadow: 0 0 0 3px rgba(236,64,122,.12);
}
.sk-custom-select-trigger.placeholder {
  color: var(--text-muted);
}
.sk-custom-select-trigger.disabled {
  background: #f5f5f5;
  color: #9e9e9e;
  cursor: not-allowed;
  border-color: #eeeeee;
}
.sk-custom-select-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 250px;
  overflow-y: auto;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity .2s, visibility .2s, transform .2s cubic-bezier(.4,0,.2,1);
}
.sk-custom-select-list.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.sk-custom-select-option {
  padding: 12px 14px;
  font-size: .95rem;
  cursor: pointer;
  transition: background .2s;
  border-bottom: 1px solid #f5f5f5;
}
.sk-custom-select-option:last-child { border-bottom: none; }
.sk-custom-select-option:hover { background: var(--pink-50); color: var(--primary); }
.sk-custom-select-option.selected {
  background: var(--pink-100);
  color: var(--pink-700);
  font-weight: 700;
}
.sk-custom-select-backdrop {
  display: none;
}
.sk-custom-select-backdrop.active {
  display: block;
  position: fixed; inset: 0;
  z-index: 1099;
}

@media (max-width: 576px) {
  .sk-custom-select-backdrop.active {
    background: rgba(0,0,0,.6);
    z-index: 1100;
    animation: fadeIn .25s ease;
  }
  .sk-custom-select-list {
    position: fixed;
    top: auto !important;
    bottom: 0;
    left: 0 !important;
    width: 100% !important;
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
    max-height: 50vh;
    z-index: 1101;
    box-shadow: 0 -4px 24px rgba(0,0,0,.15);
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(0.1, 0.9, 0.2, 1), opacity .2s;
  }
  .sk-custom-select-list.open {
    transform: translateY(0);
  }
}


/* ─── Badges ─────────────────────────────────────────────────── */
.badge-pink  { background: var(--pink-100);  color: var(--pink-700);  padding: 3px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; }
.badge-blue  { background: var(--blue-100);  color: var(--blue-700);  padding: 3px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; }
.badge-green { background: #e8f5e9; color: #2e7d32; padding: 3px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; }
.badge-gray  { background: #f5f5f5; color: #616161; padding: 3px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; }

/* ─── Loading Spinner ────────────────────────────────────────── */
.sk-spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 3px solid var(--pink-100);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.sk-loading-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.sk-loading-overlay.active { opacity: 1; pointer-events: all; }

/* ─── Toast Notification ─────────────────────────────────────── */
.sk-toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9998;
  display: flex; flex-direction: column; gap: 8px;
}
.sk-toast {
  background: white;
  border-radius: var(--border-radius-md);
  padding: 14px 20px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  min-width: 280px; max-width: 380px;
  animation: slideInRight .3s ease;
  border-left: 4px solid var(--primary);
  font-size: .95rem;
}
.sk-toast.success { border-color: #2e7d32; }
.sk-toast.error   { border-color: #b71c1c; }
.sk-toast.info    { border-color: var(--blue-600); }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── Modal ──────────────────────────────────────────────────── */
.sk-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  z-index: 1050;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.sk-modal-backdrop.active { opacity: 1; pointer-events: all; }
.sk-modal {
  background: white;
  border-radius: var(--border-radius-xl);
  padding: 32px;
  max-width: 520px;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(.95);
  transition: transform .25s;
}
.sk-modal-backdrop.active .sk-modal { transform: scale(1); }
.sk-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.sk-modal-body { color: var(--text-secondary); font-size: .95rem; line-height: 1.8; }
.sk-modal-footer { margin-top: 24px; display: flex; justify-content: flex-end; gap: 10px; }

/* ─── Section heading ────────────────────────────────────────── */
.sk-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--pink-100);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

/* ─── Score Grades ───────────────────────────────────────────── */
.grade-excellent { color: var(--grade-excellent); font-weight: 700; }
.grade-verygood  { color: var(--grade-verygood);  font-weight: 700; }
.grade-good      { color: var(--grade-good);      font-weight: 700; }
.grade-develop   { color: var(--grade-develop);   font-weight: 700; }
.grade-urgent    { color: var(--grade-urgent);    font-weight: 700; }

/* ─── Table ──────────────────────────────────────────────────── */
.sk-table-wrapper { overflow-x: auto; border-radius: var(--border-radius-md); }
.sk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.sk-table th {
  background: linear-gradient(135deg, var(--pink-50), var(--blue-50));
  color: var(--text-primary);
  font-weight: 700;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 2px solid var(--pink-100);
  white-space: nowrap;
}
.sk-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f5f5f5;
  vertical-align: middle;
}
.sk-table tr:hover td { background: var(--pink-50); }
.sk-table tr:last-child td { border-bottom: none; }

/* ─── Responsive Utility ─────────────────────────────────────── */
@media (max-width: 576px) {
  .sk-header-inner { height: 56px; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 577px) {
  .show-mobile-only { display: none !important; }
}

/* ─── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeIn .4s ease both; }

/* ─── Google Login Button ────────────────────────────────────── */
.btn-google {
  display: inline-flex; align-items: center; gap: 12px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 50px;
  padding: 12px 28px;
  font-family: 'Sarabun', sans-serif;
  font-size: 1rem; font-weight: 700;
  color: #333;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.btn-google:hover {
  border-color: var(--pink-400);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: #111;
}
.btn-google svg { flex-shrink: 0; }

/* ─── Empty State ────────────────────────────────────────────── */
.sk-empty {
  text-align: center; padding: 48px 20px;
  color: var(--text-muted);
}
.sk-empty .emoji { font-size: 3rem; display: block; margin-bottom: 12px; }
.sk-empty p { font-size: 1rem; }
