/* SutraCore LMS - Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  --primary      : #1e3a8a;
  --primary-light: #2563eb;
  --primary-dark : #1e2d6b;
  --secondary    : #f59e0b;
  --secondary-dark:#d97706;
  --success      : #10b981;
  --danger       : #ef4444;
  --warning      : #f59e0b;
  --info         : #3b82f6;
  --dark         : #111827;
  --gray-900     : #111827;
  --gray-800     : #1f2937;
  --gray-700     : #374151;
  --gray-600     : #4b5563;
  --gray-500     : #6b7280;
  --gray-400     : #9ca3af;
  --gray-300     : #d1d5db;
  --gray-200     : #e5e7eb;
  --gray-100     : #f3f4f6;
  --white        : #ffffff;
  --radius       : 12px;
  --radius-sm    : 8px;
  --radius-lg    : 20px;
  --shadow       : 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg    : 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --shadow-xl    : 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
  --transition   : all 0.3s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  color: var(--gray-800);
  background: var(--gray-100);
  line-height: 1.6;
}

a { color: var(--primary-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ─── Utilities ──────────────────────────────────── */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 960px; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-primary{ color: var(--primary); }
.text-secondary{ color: var(--secondary); }
.text-success{ color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted  { color: var(--gray-500); }
.text-white  { color: var(--white); }
.fw-bold    { font-weight: 700; }
.fw-semibold{ font-weight: 600; }
.d-flex     { display: flex; }
.d-grid     { display: grid; }
.align-center{ align-items: center; }
.justify-center{ justify-content: center; }
.justify-between{ justify-content: space-between; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }
.mt-1{margin-top:.5rem;} .mt-2{margin-top:1rem;} .mt-3{margin-top:1.5rem;} .mt-4{margin-top:2rem;} .mt-5{margin-top:3rem;}
.mb-1{margin-bottom:.5rem;} .mb-2{margin-bottom:1rem;} .mb-3{margin-bottom:1.5rem;} .mb-4{margin-bottom:2rem;}
.p-2{padding:1rem;} .p-3{padding:1.5rem;} .p-4{padding:2rem;}
.rounded { border-radius: var(--radius); }
.rounded-lg{ border-radius: var(--radius-lg); }
.shadow  { box-shadow: var(--shadow); }
.shadow-lg{ box-shadow: var(--shadow-lg); }
.w-100  { width: 100%; }
.hidden { display: none !important; }
.sr-only{ position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0; }

/* ─── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .625rem 1.5rem; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600; border: 2px solid transparent;
  transition: var(--transition); white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); color: var(--white); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-secondary { background: var(--secondary); color: var(--white); }
.btn-secondary:hover { background: var(--secondary-dark); color: var(--white); transform: translateY(-2px); }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-outline-white { background: transparent; border-color: var(--white); color: var(--white); }
.btn-outline-white:hover { background: var(--white); color: var(--primary); }
.btn-success { background: var(--success); color: var(--white); }
.btn-danger  { background: var(--danger);  color: var(--white); }
.btn-light   { background: var(--gray-100); color: var(--gray-800); }
.btn-light:hover { background: var(--gray-200); }
.btn-sm      { padding: .375rem 1rem; font-size: .8rem; }
.btn-lg      { padding: .875rem 2rem; font-size: 1rem; }
.btn-xl      { padding: 1rem 2.5rem; font-size: 1.1rem; }
.btn:disabled{ opacity: .6; cursor: not-allowed; transform: none !important; }

/* ─── Cards ──────────────────────────────────────── */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.card-body  { padding: 1.5rem; }
.card-header{ padding: 1rem 1.5rem; border-bottom: 1px solid var(--gray-200); }
.card-footer{ padding: 1rem 1.5rem; border-top: 1px solid var(--gray-200); background: var(--gray-100); }
.card-img   { width: 100%; height: 200px; object-fit: cover; }

/* ─── Badges ─────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .2rem .6rem; border-radius: 20px;
  font-size: .75rem; font-weight: 600; letter-spacing: .02em;
}
.badge-primary   { background: #dbeafe; color: var(--primary); }
.badge-success   { background: #d1fae5; color: #065f46; }
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-danger    { background: #fee2e2; color: #991b1b; }
.badge-secondary { background: #fef9c3; color: #92400e; }
.badge-gray      { background: var(--gray-200); color: var(--gray-700); }

/* ─── Forms ──────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .875rem; font-weight: 600; color: var(--gray-700); margin-bottom: .4rem; }
.form-control {
  width: 100%; padding: .625rem 1rem;
  border: 1.5px solid var(--gray-300); border-radius: var(--radius-sm);
  font-size: .9rem; font-family: inherit; color: var(--gray-800);
  background: var(--white); transition: var(--transition);
}
.form-control:focus {
  outline: none; border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.form-control.error { border-color: var(--danger); }
.form-control::placeholder { color: var(--gray-400); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right .75rem center; background-size: 16px 12px; padding-right: 2.5rem; }
.form-check { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.form-check input { width: 1rem; height: 1rem; accent-color: var(--primary); cursor: pointer; }
.form-error { color: var(--danger); font-size: .8rem; margin-top: .25rem; }

/* Upload Area */
.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  background: var(--gray-100);
  padding: 2rem 1.25rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}
.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary-light);
  background: #eff6ff;
}
.upload-area i {
  font-size: 2rem;
  color: var(--gray-400);
  margin-bottom: .75rem;
}
.upload-area p {
  color: var(--gray-500);
  font-size: .875rem;
}

/* ─── Navbar ─────────────────────────────────────── */
.navbar {
  background: var(--white); box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 1000;
  padding: 0 0; border-bottom: 3px solid var(--primary);
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.5rem; max-width: 1280px; margin: 0 auto;
}
.navbar-brand {
  display: flex; align-items: center; gap: .75rem;
  font-family: 'Poppins', sans-serif; font-weight: 800;
  font-size: 1.4rem; color: var(--primary); text-decoration: none;
}
.navbar-brand .logo-icon {
  width: 44px; height: 44px; background: var(--primary);
  border-radius: 12px; display: grid; place-items: center;
  color: var(--white); font-size: 1.2rem;
}
.navbar-brand .logo-text span { color: var(--secondary); }
.navbar-nav {
  display: flex; align-items: center; gap: .25rem;
}
.nav-link {
  padding: .5rem .875rem; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500; color: var(--gray-700);
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active { background: var(--gray-100); color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: .75rem; }
.hamburger { display: none; background: none; border: none; font-size: 1.5rem; color: var(--gray-700); }

/* ─── Hero Section ───────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 50%, #1d4ed8 100%);
  color: var(--white); padding: 5rem 0 4rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; right: -20%;
  width: 700px; height: 700px; border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.hero::after {
  content: ''; position: absolute; bottom: -30%; left: -10%;
  width: 500px; height: 500px; border-radius: 50%;
  background: rgba(255,255,255,.04);
}
.hero-content { position: relative; z-index: 1; }
.hero-title {
  font-family: 'Poppins', sans-serif; font-weight: 800;
  font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.15; margin-bottom: 1.25rem;
}
.hero-title span { color: var(--secondary); }
.hero-subtitle { font-size: 1.1rem; opacity: .9; max-width: 560px; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem; margin-top: 3rem; max-width: 500px;
}
.hero-stat-num {
  font-family: 'Poppins', sans-serif; font-size: 1.8rem;
  font-weight: 800; color: var(--secondary);
}
.hero-stat-label { font-size: .8rem; opacity: .85; }

/* ─── Section Titles ─────────────────────────────── */
.section-title {
  font-family: 'Poppins', sans-serif; font-size: 2rem;
  font-weight: 700; color: var(--gray-900); margin-bottom: .5rem;
}
.section-subtitle { color: var(--gray-500); font-size: 1.05rem; margin-bottom: 2.5rem; }
.section-tag {
  display: inline-block; background: #dbeafe; color: var(--primary);
  padding: .25rem .875rem; border-radius: 20px; font-size: .8rem;
  font-weight: 600; margin-bottom: .75rem; letter-spacing: .05em; text-transform: uppercase;
}

/* ─── Course Cards ───────────────────────────────── */
.course-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.course-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: var(--transition); }
.course-card:hover { box-shadow: var(--shadow-xl); transform: translateY(-6px); }
.course-card-img { width: 100%; height: 180px; object-fit: cover; background: linear-gradient(135deg,#1e3a8a,#2563eb); position: relative; }
.course-card-img .course-badge { position: absolute; top: .75rem; left: .75rem; }
.course-card-body { padding: 1.25rem; }
.course-card-category { font-size: .75rem; color: var(--primary-light); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.course-card-title { font-size: 1rem; font-weight: 700; color: var(--gray-900); margin: .35rem 0 .5rem; line-height: 1.4; }
.course-card-teacher { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--gray-500); }
.course-card-teacher img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.course-card-meta { display: flex; gap: 1rem; font-size: .78rem; color: var(--gray-500); margin: .75rem 0; }
.course-card-meta span { display: flex; align-items: center; gap: .25rem; }
.course-card-price { display: flex; align-items: center; gap: .75rem; }
.price-current { font-size: 1.1rem; font-weight: 800; color: var(--primary); }
.price-original{ font-size: .85rem; text-decoration: line-through; color: var(--gray-400); }
.price-free    { font-size: 1rem; font-weight: 700; color: var(--success); }
.course-rating { display: flex; align-items: center; gap: .25rem; font-size: .8rem; }
.rating-stars  { color: var(--secondary); }

/* ─── Stats Section ──────────────────────────────── */
.stats-section { background: var(--primary); padding: 3rem 0; color: var(--white); }
.stats-grid    { display: grid; grid-template-columns: repeat(4,1fr); gap: 2rem; text-align: center; }
.stat-number   { font-family: 'Poppins',sans-serif; font-size: 2.5rem; font-weight: 800; color: var(--secondary); }
.stat-label    { font-size: .9rem; opacity: .85; margin-top: .25rem; }

/* ─── Features ───────────────────────────────────── */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(250px,1fr)); gap: 1.5rem; }
.feature-card  { background: var(--white); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); text-align: center; transition: var(--transition); }
.feature-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.feature-icon  { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-size: 1.5rem; margin: 0 auto 1.25rem; }

/* ─── Category Cards ─────────────────────────────── */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(160px,1fr)); gap: 1rem; }
.category-card {
  background: var(--white); border-radius: var(--radius); padding: 1.25rem;
  text-align: center; box-shadow: var(--shadow); transition: var(--transition);
  cursor: pointer; border: 2px solid transparent;
}
.category-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.category-card.active{ border-color: var(--primary); background: #eff6ff; }
.category-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; margin: 0 auto .75rem; }
.category-name { font-size: .85rem; font-weight: 600; color: var(--gray-800); }
.category-count{ font-size: .75rem; color: var(--gray-500); margin-top: .2rem; }

/* ─── Alert / Toast ──────────────────────────────── */
.alert {
  padding: .875rem 1.25rem; border-radius: var(--radius-sm);
  margin-bottom: 1rem; display: flex; align-items: center; gap: .75rem;
  font-size: .9rem; font-weight: 500;
}
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--success); }
.alert-danger  { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid var(--warning); }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid var(--info); }

/* Toast Notifications */
#toast-container { position: fixed; top: 1.25rem; right: 1.25rem; z-index: 9999; display: flex; flex-direction: column; gap: .75rem; }
.toast {
  background: var(--white); border-radius: var(--radius); padding: 1rem 1.5rem;
  box-shadow: var(--shadow-xl); border-left: 4px solid var(--primary);
  min-width: 280px; display: flex; align-items: center; gap: .75rem;
  animation: slideIn .3s ease; font-size: .875rem; font-weight: 500;
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── Progress Bar ───────────────────────────────── */
.progress { height: 8px; background: var(--gray-200); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg,var(--primary),var(--primary-light)); border-radius: 999px; transition: width .5s ease; }
.progress-bar.success { background: linear-gradient(90deg,var(--success),#34d399); }

/* ─── Avatar ─────────────────────────────────────── */
.avatar { border-radius: 50%; object-fit: cover; }
.avatar-sm  { width: 32px;  height: 32px;  }
.avatar-md  { width: 48px;  height: 48px;  }
.avatar-lg  { width: 80px;  height: 80px;  }
.avatar-xl  { width: 120px; height: 120px; }
.avatar-placeholder {
  background: var(--primary); color: var(--white);
  display: grid; place-items: center; border-radius: 50%;
  font-weight: 700; font-family: 'Poppins',sans-serif;
}

/* ─── Tables ─────────────────────────────────────── */
.table-container { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: var(--white); }
thead th {
  background: var(--gray-100); padding: .875rem 1.25rem;
  text-align: left; font-size: .8rem; font-weight: 700;
  color: var(--gray-600); text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap;
}
tbody td { padding: .875rem 1.25rem; border-top: 1px solid var(--gray-200); font-size: .875rem; }
tbody tr:hover { background: var(--gray-100); }

/* ─── Pagination ─────────────────────────────────── */
.pagination { display: flex; gap: .4rem; align-items: center; justify-content: center; flex-wrap: wrap; }
.page-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-300); background: var(--white);
  display: grid; place-items: center; font-size: .875rem; font-weight: 600;
  cursor: pointer; transition: var(--transition); color: var(--gray-700);
}
.page-btn:hover, .page-btn.active { background: var(--primary); border-color: var(--primary); color: var(--white); }

/* ─── Modal ──────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: grid; place-items: center; z-index: 2000;
  padding: 1rem;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 2100;
  padding: min(8vh, 4rem) 1rem 1rem;
  overflow-y: auto;
}
.modal-backdrop .modal {
  margin: 0 auto;
}
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  width: 100%; max-width: 560px; max-height: 90vh;
  overflow-y: auto; animation: fadeUp .3s ease;
}
.modal-header {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-family: 'Poppins',sans-serif; font-size: 1.1rem; font-weight: 700; }
.modal-body   { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--gray-200); display: flex; gap: .75rem; justify-content: flex-end; }
.modal-close  { background: none; border: none; font-size: 1.25rem; color: var(--gray-500); cursor: pointer; }
.modal-close:hover { color: var(--gray-900); }
@keyframes fadeUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ─── Footer ─────────────────────────────────────── */
.footer {
  background: var(--gray-900); color: var(--gray-400);
  padding: 4rem 0 0;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.footer-brand { font-family: 'Poppins',sans-serif; font-size: 1.5rem; font-weight: 800; color: var(--white); margin-bottom: 1rem; }
.footer-desc  { font-size: .875rem; line-height: 1.7; color: var(--gray-400); }
.footer-title { font-size: .9rem; font-weight: 700; color: var(--white); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: .08em; }
.footer-links a { display: block; font-size: .875rem; padding: .25rem 0; color: var(--gray-400); transition: var(--transition); }
.footer-links a:hover { color: var(--white); padding-left: .5rem; }
.footer-bottom {
  border-top: 1px solid var(--gray-800); padding: 1.25rem 0;
  margin-top: 2.5rem; display: flex; align-items: center;
  justify-content: space-between; font-size: .8rem;
}
.social-links { display: flex; gap: .75rem; margin-top: 1rem; }
.social-link {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gray-800); color: var(--gray-400);
  display: grid; place-items: center; transition: var(--transition);
}
.social-link:hover { background: var(--primary-light); color: var(--white); }

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .navbar-nav  { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--white); box-shadow: var(--shadow-lg); padding: 1rem; gap: .25rem; }
  .navbar-nav.open { display: flex; }
  .hamburger   { display: block; }
  .hero { padding: 3rem 0 2.5rem; }
  .hero-stats  { grid-template-columns: repeat(3,1fr); gap: 1rem; }
  .stats-grid  { grid-template-columns: repeat(2,1fr); gap: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: .75rem; text-align: center; }
  .category-grid { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 480px) {
  .category-grid { grid-template-columns: repeat(2,1fr); }
  .hero-actions  { flex-direction: column; }
  .stats-grid    { grid-template-columns: 1fr 1fr; }
}

/* --- Additional Mobile Layout Fixes --- */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; width: 100%; }
  .container { padding: 0 1rem; }
  .course-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
  .features-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 2rem; }
  .hero-stats { grid-template-columns: 1fr; gap: 0.5rem; }
  .section-title { font-size: 1.5rem; }
  .modal { max-width: 95%; margin: 1rem auto; }
}
@media (max-width: 480px) {
  .hero-stats { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr; }
  .course-grid { grid-template-columns: 1fr; }
}
