@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&family=Marcellus&display=swap');
@import "tailwindcss";

/* ─── Design Tokens (Light Theme) ───────────────────────────────────────────── */
:root {
  --bg-primary:    hsl(220, 20%, 97%);
  --bg-secondary:  hsl(0, 0%, 100%);
  --bg-tertiary:   hsl(220, 14%, 94%);
  --bg-card:       hsl(0, 0%, 100%);

  --accent-primary:   hsl(258, 90%, 66%);
  --accent-secondary: hsl(199, 89%, 48%);
  --accent-success:   hsl(152, 69%, 38%);
  --accent-warning:   hsl(38, 92%, 50%);
  --accent-danger:    hsl(0, 84%, 60%);

  --text-primary:   hsl(222, 47%, 11%);
  --text-secondary: hsl(215, 16%, 42%);
  --text-muted:     hsl(215, 13%, 62%);

  --border:         hsl(220, 13%, 88%);
  --border-subtle:  hsl(220, 13%, 93%);

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.10);
  --shadow-glow: 0 0 24px rgba(139, 92, 246, 0.12);
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Marcellus', Georgia, 'Times New Roman', serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-tertiary); }
::-webkit-scrollbar-thumb { background: hsl(220, 13%, 80%); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-primary); }

/* ─── Typography ────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Roboto', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

/* ─── Glass Cards ───────────────────────────────────────────────────────────── */
.glass-card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.glass-card:hover {
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: var(--shadow-glow), var(--shadow-md);
  transform: translateY(-2px);
}

/* ─── Gradient Text ─────────────────────────────────────────────────────────── */
.gradient-text {
  font-family: 'Roboto', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, hsl(258,90%,56%) 0%, hsl(199,89%,45%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Gradient Buttons ──────────────────────────────────────────────────────── */
.btn-primary {
  font-family: 'Roboto', system-ui, sans-serif;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0.625rem 1.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25);
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
}

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

.btn-secondary {
  font-family: 'Roboto', system-ui, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.625rem 1.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.1);
}

.btn-danger {
  font-family: 'Roboto', system-ui, sans-serif;
  background: rgba(239, 68, 68, 0.08);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--accent-danger);
}

/* ─── Input Fields ───────────────────────────────────────────────────────────── */
.input-field {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
  transition: all 0.2s ease;
  outline: none;
}

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

.input-field:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* ─── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  flex: 1;
  overflow-y: auto;
}

.nav-section-label {
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0.75rem 0.75rem 0.25rem;
}

.nav-item {
  font-family: 'Roboto', system-ui, sans-serif;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  margin-bottom: 2px;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(139,92,246,0.1) 0%, rgba(14,165,233,0.08) 100%);
  color: var(--text-primary);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.nav-item.active svg { color: var(--accent-primary); }

/* ─── Main Layout ───────────────────────────────────────────────────────────── */
.main-layout {
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  background: rgba(255,255,255,0.85);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(12px);
}

.page-content {
  padding: 1.5rem;
  flex: 1;
}

/* ─── Stats Cards ───────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.07;
}

/* ─── Badge ─────────────────────────────────────────────────────────────────── */
.badge {
  font-family: 'Roboto', system-ui, sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: rgba(34,197,94,0.1); color: var(--accent-success); border: 1px solid rgba(34,197,94,0.25); }
.badge-warning { background: rgba(234,179,8,0.1); color: var(--accent-warning); border: 1px solid rgba(234,179,8,0.25); }
.badge-danger  { background: rgba(239,68,68,0.1); color: var(--accent-danger);  border: 1px solid rgba(239,68,68,0.25); }
.badge-info    { background: rgba(14,165,233,0.08); color: var(--accent-secondary); border: 1px solid rgba(14,165,233,0.2); }
.badge-purple  { background: rgba(139,92,246,0.08); color: var(--accent-primary); border: 1px solid rgba(139,92,246,0.2); }

/* ─── Table ─────────────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  font-family: 'Roboto', system-ui, sans-serif;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.875rem 1rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:hover td { background: rgba(139, 92, 246, 0.02); }
.data-table tr:last-child td { border-bottom: none; }

/* ─── Progress Bar ──────────────────────────────────────────────────────────── */
.progress-bar-container {
  background: var(--bg-tertiary);
  border-radius: 999px;
  overflow: hidden;
  height: 6px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* ─── Video Player ──────────────────────────────────────────────────────────── */
.video-player-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.video-player-iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; 
  height: 100%; 
  border: none;
}

/* ─── Toast / Alert ─────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  font-family: 'Roboto', system-ui, sans-serif;
  padding: 0.875rem 1.25rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  animation: slideInRight 0.3s ease;
  min-width: 260px;
  max-width: 400px;
  box-shadow: var(--shadow-md);
  color: white;
}

.toast-success { background: hsl(152, 69%, 32%); border: 1px solid rgba(34,197,94,0.4); }
.toast-error   { background: hsl(0, 72%, 45%);   border: 1px solid rgba(239,68,68,0.4); }
.toast-warning { background: hsl(38, 80%, 42%);  border: 1px solid rgba(234,179,8,0.4); }

/* ─── Animations ────────────────────────────────────────────────────────────── */
@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(139,92,246,0.08); }
  50%       { box-shadow: 0 0 24px rgba(139,92,246,0.2); }
}

.fade-in  { animation: fadeIn 0.4s ease forwards; }
.fade-in-delay-1 { animation: fadeIn 0.4s 0.1s ease both; }
.fade-in-delay-2 { animation: fadeIn 0.4s 0.2s ease both; }
.fade-in-delay-3 { animation: fadeIn 0.4s 0.3s ease both; }

/* ─── Skeleton Loader ───────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, hsl(220,14%,92%) 25%, hsl(220,14%,88%) 50%, hsl(220,14%,92%) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ─── Modal ─────────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.2s ease;
}

/* ─── Checkbox ──────────────────────────────────────────────────────────────── */
.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  accent-color: var(--accent-primary);
  transition: all 0.15s ease;
}

.checkbox-custom:checked {
  border-color: var(--accent-primary);
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-layout {
    margin-left: 0;
  }
}
