/* ============================================================
   SKYB ACADEMY - ĐIỂM DANH AI
   Dark Mode Theme | Glassmorphism | AI/Tech Style
   ============================================================ */

/* Font chữ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ==================== CSS VARIABLES ==================== */
:root {
  --bg-dark: #050510;
  --bg-darker: #020208;
  --bg-card: rgba(15, 15, 40, 0.7);
  --bg-card-alt: rgba(20, 20, 50, 0.5);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.15);

  --accent-purple: #7c3aed;
  --accent-purple-light: #a78bfa;
  --accent-purple-glow: rgba(124, 58, 237, 0.3);
  --accent-cyan: #06b6d4;
  --accent-cyan-light: #22d3ee;
  --accent-cyan-glow: rgba(6, 182, 212, 0.3);
  --gradient-primary: linear-gradient(135deg, #7c3aed, #06b6d4);
  --gradient-hover: linear-gradient(135deg, #6d28d9, #0891b2);

  --text-primary: #f0f0f8;
  --text-secondary: #a0a0c0;
  --text-muted: #606080;
  --text-accent: #c4b5fd;

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --success-border: rgba(16, 185, 129, 0.25);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --error-border: rgba(239, 68, 68, 0.25);
  --warning: #f59e0b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.12), 0 0 80px rgba(6, 182, 212, 0.08);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 58, 237, 0.5);
}

::selection {
  background: rgba(124, 58, 237, 0.3);
  color: var(--text-primary);
}

/* ==================== ANIMATED BACKGROUND ==================== */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}

body::before {
  width: 500px;
  height: 500px;
  background: var(--accent-purple);
  top: -150px;
  right: -100px;
  animation: floatOrb1 20s ease-in-out infinite;
}

body::after {
  width: 400px;
  height: 400px;
  background: var(--accent-cyan);
  bottom: -120px;
  left: -80px;
  animation: floatOrb2 18s ease-in-out infinite;
}

@keyframes floatOrb1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-40px, 30px) scale(1.05); }
  50% { transform: translate(20px, -20px) scale(0.95); }
  75% { transform: translate(30px, 40px) scale(1.02); }
}

@keyframes floatOrb2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(0.95); }
  50% { transform: translate(-20px, 20px) scale(1.05); }
  75% { transform: translate(-30px, -20px) scale(0.98); }
}

/* ==================== LAYOUT ==================== */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  padding: 20px;
  margin: 20px auto;
}

.container-admin {
  max-width: 960px;
}

/* ==================== CARD ==================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  animation: cardEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-glow);
}

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

/* ==================== BRAND / LOGO ==================== */
.brand {
  text-align: center;
  margin-bottom: 32px;
}

.brand-icon {
  width: 72px;
  height: 72px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 16px;
  box-shadow: 0 4px 24px var(--accent-purple-glow);
  animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.brand h1 {
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 400;
}

/* Nhãn lịch học */
.schedule-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card-alt);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  padding: 8px 18px;
  font-size: 0.85rem;
  color: var(--text-accent);
  margin-top: 14px;
}

.schedule-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  animation: dotPulse 2s ease-in-out infinite;
}

.schedule-badge .dot.inactive {
  background: var(--text-muted);
  animation: none;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* Thông tin trạng thái */
.status-info {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.status-info.active {
  color: var(--success);
}

/* ==================== FORM ==================== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  transition: var(--transition);
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  outline: none;
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-group input:focus {
  border-color: var(--accent-purple);
  background: rgba(124, 58, 237, 0.05);
  box-shadow: 0 0 0 3px var(--accent-purple-glow);
}

.form-group input:focus + label,
.form-group input:focus ~ label {
  color: var(--accent-purple-light);
}

.form-group input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* ==================== BUTTONS ==================== */
.btn-primary {
  width: 100%;
  padding: 15px 24px;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-purple-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary:disabled::before {
  display: none;
}

.btn-secondary {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--glass-border-hover);
}

.btn-export {
  padding: 10px 20px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-md);
  color: var(--success);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-export:hover {
  background: rgba(16, 185, 129, 0.2);
  transform: translateY(-1px);
}

.btn-logout {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--error-border);
  border-radius: var(--radius-md);
  color: var(--error);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.btn-logout:hover {
  background: var(--error-bg);
}

.btn-delete {
  padding: 5px 12px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-zoom {
  display: inline-block;
  padding: 14px 28px;
  background: var(--gradient-primary);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

.btn-zoom:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-purple-glow);
}

/* ==================== SPINNER ==================== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==================== ALERTS ==================== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  margin-bottom: 16px;
  animation: alertEnter 0.3s ease-out;
}

.alert-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error);
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success);
}

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

/* ==================== SUCCESS CARD ==================== */
.success-card {
  text-align: center;
  animation: fadeInUp 0.5s ease-out;
}

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

.success-icon {
  width: 88px;
  height: 88px;
  background: var(--success-bg);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin-bottom: 20px;
  border: 2px solid var(--success-border);
  animation: successBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successBounce {
  0% { transform: scale(0); }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.success-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.success-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

/* Khung link Zoom */
.zoom-link-box {
  background: rgba(6, 182, 212, 0.06);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-top: 24px;
}

.zoom-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.zoom-url {
  color: var(--accent-cyan-light);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  word-break: break-all;
  display: block;
  margin-bottom: 16px;
}

.zoom-url:hover {
  text-decoration: underline;
}

/* ==================== ADMIN DASHBOARD ==================== */

/* Header */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Controls */
.controls {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.controls input[type="date"] {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
  color-scheme: dark;
}

.controls input[type="date"]:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px var(--accent-purple-glow);
}

/* Date chips */
.date-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.date-chip {
  padding: 6px 14px;
  background: var(--bg-card-alt);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.date-chip:hover,
.date-chip.active {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--accent-purple);
  color: var(--accent-purple-light);
}

/* ==================== TABLE ==================== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: rgba(124, 58, 237, 0.08);
}

th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-accent);
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 12px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: var(--transition);
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-text {
  font-size: 0.95rem;
}

/* ==================== FOOTER ==================== */
.footer {
  text-align: center;
  margin-top: 24px;
  padding: 12px;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.footer a {
  color: var(--accent-purple-light);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* ==================== TOAST NOTIFICATION ==================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  color: var(--success);
  font-size: 0.9rem;
  z-index: 1000;
  backdrop-filter: blur(20px);
  animation: toastIn 0.3s ease-out;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.toast.hide {
  animation: toastOut 0.3s ease-in forwards;
}

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

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

/* ==================== UTILITIES ==================== */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 16px;
}

.mt-6 {
  margin-top: 24px;
}

.mb-4 {
  margin-bottom: 16px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 640px) {
  .container {
    padding: 12px;
    margin: 12px auto;
  }

  .card {
    padding: 28px 20px;
    border-radius: var(--radius-lg);
  }

  .brand h1 {
    font-size: 1.35rem;
  }

  .brand-icon {
    width: 60px;
    height: 60px;
    font-size: 28px;
  }

  .controls {
    flex-direction: column;
  }

  .controls > * {
    width: 100%;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

  th, td {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .stat-value {
    font-size: 1.8rem;
  }

  body::before {
    width: 300px;
    height: 300px;
  }

  body::after {
    width: 250px;
    height: 250px;
  }

  .zoom-link-box {
    padding: 18px 14px;
  }

  .success-icon {
    width: 72px;
    height: 72px;
    font-size: 34px;
  }
}

@media (max-width: 380px) {
  .card {
    padding: 24px 16px;
  }

  .brand h1 {
    font-size: 1.2rem;
  }

  .schedule-badge {
    font-size: 0.78rem;
    padding: 6px 14px;
  }
}
