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

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #10b981;
  --success-light: #ecfdf5;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --late: #f97316;
  --late-light: #fff7ed;
  --activity: #6366f1;
  --activity-light: #eef2ff;
  --dark: #1e293b;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --font-family: 'Prompt', 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: #f1f5f9;
  color: var(--gray-800);
  line-height: 1.5;
  min-height: 100vh;
}

/* Header & Nav */
.header-gradient {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
}

.nav-tab-btn {
  transition: all 0.2s ease-in-out;
  border-bottom: 3px solid transparent;
}

.nav-tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  background-color: #eff6ff;
  font-weight: 600;
}

/* Status Pill Buttons */
.status-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 0.85rem;
  border: 1.5px solid var(--gray-300);
  background-color: #ffffff;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.status-btn:hover {
  border-color: var(--gray-400);
  background-color: var(--gray-50);
}

/* Present (มา) */
.status-btn[data-status="present"].active,
.status-badge.present {
  background-color: #10b981 !important;
  color: #ffffff !important;
  border-color: #059669 !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

/* Absent (ขาด) */
.status-btn[data-status="absent"].active,
.status-badge.absent {
  background-color: #ef4444 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

/* Leave (ลา) */
.status-btn[data-status="leave"].active,
.status-badge.leave {
  background-color: #f59e0b !important;
  color: #ffffff !important;
  border-color: #d97706 !important;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
}

/* Late (มาสาย) */
.status-btn[data-status="late"].active,
.status-badge.late {
  background-color: #f97316 !important;
  color: #ffffff !important;
  border-color: #ea580c !important;
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.35);
}

/* Activity (กิจกรรม) */
.status-btn[data-status="activity"].active,
.status-badge.activity {
  background-color: #6366f1 !important;
  color: #ffffff !important;
  border-color: #4f46e5 !important;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
}

/* Status Badge Generic */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
}

/* Card & Table Styling */
.student-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  border: 1px solid var(--gray-200);
}

.student-card:hover {
  border-color: #93c5fd;
  box-shadow: var(--shadow-md);
}

.student-card.status-present-active {
  border-left: 4px solid var(--success);
}
.student-card.status-absent-active {
  border-left: 4px solid var(--danger);
  background-color: #fef2f2;
}
.student-card.status-leave-active {
  border-left: 4px solid var(--warning);
  background-color: #fffbeb;
}
.student-card.status-late-active {
  border-left: 4px solid var(--late);
  background-color: #fff7ed;
}
.student-card.status-activity-active {
  border-left: 4px solid var(--activity);
  background-color: #eef2ff;
}

/* Drag and Drop Zone */
.dropzone {
  border: 2px dashed #93c5fd;
  border-radius: var(--radius-lg);
  background-color: #f8fafc;
  transition: all 0.2s ease;
}

.dropzone.dragover {
  border-color: #2563eb;
  background-color: #eff6ff;
  transform: scale(1.01);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  animation: slideIn 0.3s ease forwards;
}

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

/* Print Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt !important;
  }
  .no-print, header, nav, #toast-container, .sticky-bottom-bar, button {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  .tab-pane {
    display: block !important;
  }
  .shadow-md, .shadow-lg, .shadow-sm {
    box-shadow: none !important;
  }
  .border {
    border: 1px solid #000 !important;
  }
}
