@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;600;700&family=Poppins:wght@300;400;500;600;700&family=Montserrat:wght@300;400;500;600;700;800&family=Open+Sans:wght@300;400;600&family=Roboto:wght@300;400;500;700&display=swap');

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

body {
  font-family: var(--font-body, 'Inter', sans-serif);
  background: var(--bg-primary, #f8f9fa);
  color: var(--text-primary, #1a1a2e);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading, 'Inter', sans-serif);
  font-weight: 600;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 260px;
  height: 100vh;
  background: var(--bg-secondary, #fff);
  border-right: 1px solid var(--border, #e8e8f0);
  z-index: 1000;
  overflow-y: auto;
  transition: all 0.3s;
}

.sidebar-brand {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.sidebar-brand h4 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--primary);
}

.sidebar-nav { padding: 15px 0; }

.sidebar-nav .nav-item {
  padding: 0 15px;
  margin-bottom: 4px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  gap: 12px;
}

.sidebar-nav .nav-link:hover {
  background: var(--bg-primary);
  color: var(--primary);
}

.sidebar-nav .nav-link.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.sidebar-nav .nav-link i { width: 20px; text-align: center; }

.main-content {
  margin-left: 260px;
  min-height: 100vh;
  transition: margin-left 0.3s;
}

.topbar {
  background: var(--bg-card, #fff);
  border-bottom: 1px solid var(--border);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 999;
}

.card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,0.04));
  transition: all 0.3s;
  overflow: hidden;
}

.card:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.08); }

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  font-weight: 600;
}

.btn {
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
}

.form-control, .form-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 0,0,0), 0.1);
  outline: none;
}

.table { color: var(--text-primary); }

.table thead th {
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  padding: 14px;
}

.table tbody td { padding: 14px; vertical-align: middle; }

.table-hover tbody tr:hover { background: var(--bg-secondary); }

.badge {
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.75rem;
}

.progress {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar {
  background: var(--primary);
  border-radius: 10px;
}

.alert {
  border: none;
  border-radius: var(--radius, 12px);
  padding: 16px 20px;
}

.modal-content {
  border: none;
  border-radius: var(--radius, 16px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  padding: 8px;
}

.dropdown-item {
  border-radius: 8px;
  padding: 10px 16px;
}

.dropdown-item:hover, .dropdown-item.active {
  background: var(--bg-secondary);
  color: var(--primary);
}

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

.card { animation: fadeIn 0.4s ease; }

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.auth-card {
  width: 100%;
  max-width: 450px;
  padding: 40px;
}

.auth-card .logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: var(--primary);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
}

.course-card {
  border: none;
  overflow: hidden;
  transition: all 0.3s ease;
}

.course-card .course-image {
  height: 180px;
  object-fit: cover;
  transition: transform 0.3s;
}

.course-card:hover .course-image { transform: scale(1.05); }

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: #000;
}

.video-container video,
.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
}

.cert-preview-img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  transition: transform 0.3s;
}

.cert-preview-img:hover { transform: scale(1.02); }

.stat-card {
  padding: 25px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 15px;
}

.stat-value { font-size: 2rem; font-weight: 700; margin-bottom: 5px; }
.stat-label { color: var(--text-muted); font-size: 0.9rem; }

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s;
  margin-bottom: 10px;
}

.quick-action-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateX(5px);
}

.quick-action-btn i { font-size: 1.2rem; width: 24px; text-align: center; }

.hero-section {
  padding: 100px 0;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  position: relative;
  overflow: hidden;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-primary);
  padding: 5px;
}

@media (max-width: 991px) { .mobile-toggle { display: block; } }

@media print {
  .sidebar, .topbar, .btn, .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.border-primary { border-color: var(--primary) !important; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

.rounded-xl { border-radius: 16px; }
.rounded-2xl { border-radius: 24px; }

.shadow-soft { box-shadow: 0 4px 20px rgba(0,0,0,0.06); }

.hover-lift {
  transition: transform 0.3s, box-shadow 0.3s;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}
