/* =========================
   🔘 PREMIUM BUTTON SYSTEM (FIXED)
   ========================= */

/* BASE BUTTON SYSTEM */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

/* VARIANTS */
.btn-primary {
  background: linear-gradient(135deg,#6366f1,#8b5cf6);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99,102,241,0.3);
}

.btn:active {
  transform: scale(0.96);
}


/* PRIMARY */
.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #fff;
  border: none;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* SUCCESS */
.btn-success {
  background: #22c55e;
  color: #fff;
}

.btn-outline {
  border: 1px solid #e5e7eb;
  background: #fff;
}

.btn-outline:hover {
  background: #f5f7ff; /* ⬅ slight purple tint instead of gray */
  border-color: #c7d2fe;

  color: #4338ca !important; /* ⬅ slightly deeper purple */
}

.btn-outline:hover {
  transform: translateY(-1px);
}

.btn-outline:active {
  transform: scale(0.97);
}


/* GOLD */
.btn-gold {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #000 !important;
}

/* Danger */
.btn-danger {
  background: #ef4444;
  color: #fff;
}

.btn-light {
  background: #f1f5f9;
  color: #334155;
}

.btn-warning {
  background: #f59e0b;
  color: #fff;
}


.btn-dark {
  background: #0f172a;
  color: #ffffff;

  padding: 8px 14px;
  border-radius: 999px;

  font-size: 14px;
  font-weight: 500;

  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-dark:hover {
  background: #020617;
}


.view-btn {
  display: inline-block;
  font-size: 12px;
  color: #6366f1;
  font-weight: 500;
  margin-top: 6px;
  text-decoration: none;
  transition: 0.2s;
}

.view-btn:hover {
  transform: translateX(4px);
}


.btn-action {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  background: #f1f5f9;
  color: #0f172a;
  transition: 0.2s;
}

.btn-action:hover {
  background: #e2e8f0;
}

/* SUCCESS */
.btn-action.success {
  background: #22c55e;
  color: white;
}

/* DANGER */
.btn-mini.danger {
  background: #ef4444;
  color: white;
}

/* PRIMARY */
.btn-action.primary {
  background: #6366f1;
  color: white;
}


/* =========================
🧾 CARDS UTILITIES UPGRADE CARDS
   ========================= */

.card {
  background: #ffffff;

  border: 1px solid #eef2f7; /* very soft border */

  border-radius: 14px;

  overflow: hidden;

  transition: all 0.25s ease;

  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* Hover = premium lift */
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.06);
}

/* 🔥 PRICE (STRONG + PREMIUM) */
.course-price {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  margin-top: 12px;
  letter-spacing: 0.3px;
}

/* Card Header */
.card-header {
  margin-bottom: var(--space-4);
  font-weight: var(--font-weight-semibold);
}

/* Card Body */
.card-body {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}


/* =========================
   📝 INPUTS
   ========================= */

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-label {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
}

.input {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  font-size: var(--text-sm);
  outline: none;
  transition: all 0.2s ease;
}

.input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

/* Textarea */
.textarea {
  min-height: 120px;
  resize: vertical;
}


/* =========================
   🏷️ BADGES
   ========================= */

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  transition: transform 0.2s ease;
}

/* Variants */
.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

/* =========================
   🎓 COURSE BADGE (SCOPED)
   ========================= */

.course-thumb .badge {
  position: absolute;
  top: 10px;
  left: 10px;

  font-size: 11px;
  padding: 4px 8px;

  border-radius: 999px;
  color: #fff;
  z-index: 2;
}

/* Variants */
.course-thumb .badge.completed {
  background: #16a34a;
}

.course-thumb .badge.progress {
  background: rgba(99,102,241,0.9); /* instead of strong blue */
}

.course-thumb .badge.new {
  background: #180891;
}


/* =========================
   🎨 THUMBNAIL OVERLAY
   ========================= */

.course-thumb::after {
  content: "";
  position: absolute;
  pointer-events: none; /* 🔥 IMPORTANT FIX */
  inset: 0;

  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.05),
    rgba(0,0,0,0.35)
  );

  opacity: 0;
  transition: opacity 0.3s ease;
}

/*===========================
 BADGES CSS FILE
 ==========================*/

/* BADGES */
.badge-progress,
.badge-new {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 20px;
  color: #fff;
}

.badge-progress {
  background: #4D44E1 !important;
}

.course-card:hover .badge {
  transform: translateY(-2px);
}

.price {
  font-weight: 800;
  color: #111;
}

.btn-dark {
  background: #0f172a;
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  transition: 0.2s;
}

.btn-dark:hover {
  background: #020617;
}


/* 🎯 BUTTON PRESS FEEL */
.btn {
  transition: all 0.15s ease;
}

.btn:active {
  transform: scale(0.96);
}


/* =========================
   🎯 HOVER ACTIONS
   ========================= */

.course-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: 0.3s;
}

.course-overlay {
  z-index: 3;
}

.course-card:hover .course-overlay {
  opacity: 1;
}


/* Mobile always visible */
@media (max-width: 768px) {
  .course-overlay {
    opacity: 1;
  }
}

/* =========================
   📊 TABLE
   ========================= */

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

.table th {
  text-align: left;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
}

.table tr:hover {
  background: var(--color-surface-alt);
}


/* =========================
   👤 AVATAR
   ========================= */

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary);

  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: var(--font-weight-bold);
  box-shadow: var(--shadow-soft);
}

/* Sizes */
.avatar-sm {
  width: 32px;
  height: 32px;
}

.avatar-lg {
  width: 60px;
  height: 60px;
}


/* =========================
   📈 PROGRESS BAR
   ========================= */

/* PROGRESS */
.progress-wrapper {
  margin-top: 12px;
}

.progress-bar {
  height: 6px;
  background: #f1f1f1;
  border-radius: 20px;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #22c55e);
  border-radius: 999px;
  transition: width 0.6s var(--ease-smooth);
}


/* 🔥 PROGRESS % */
.progress-text {
  font-size: 15px;
  font-weight: 600;  
  color: #777;
  margin-top: 6px;
  display: inline-block;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(to right, #6366f1, #22c55e);
}

/* =========================
   🪟 MODAL
=========================== */

/* ===== MODAL BACKDROP ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 9999;
}

.modal.active {
  opacity: 1;
  pointer-events: all;
}

/* ===== MODAL BOX ===== */
.modal-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 420px;

  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.15),
    0 8px 24px rgba(0, 0, 0, 0.08);

  transform: scale(0.92);
  opacity: 0;
  transition: all 0.25s ease;
}

/* Animate in */
.modal.active .modal-content {
  transform: scale(1);
  opacity: 1;
}

/* ===== TITLE ===== */
.modal-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #0f172a;
}

/* ===== DESCRIPTION ===== */
.modal-content p {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 20px;
}

/* ===== BUTTON AREA ===== */
.modal-content .btn {
  min-width: 90px;
}

/* Align buttons nicely */
.modal-content {
  display: flex;
  flex-direction: column;
}

.modal-content button {
  margin-top: 10px;
}

/* Better layout */
.modal-content button:first-of-type {
  margin-right: 8px;
}

/* Button row */
.modal-content {
  gap: 10px;
}

.modal-content::after {
  content: "";
  display: block;
}

/* Flex buttons row */
.modal-content button {
  display: inline-flex;
}

/* Wrap buttons */
.modal-content {
  align-items: flex-start;
}

.modal-content button {
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 500;
}

/* ===== BUTTON GROUP FIX ===== */
.modal-content {
  flex-wrap: wrap;
}

.modal-content button {
  margin-top: 12px;
}

.modal-content button#cancelDelete {
  background: #f1f5f9;
  color: #334155;
}

.modal-content button#confirmDelete {
  background: #ef4444;
  color: #fff;
}

/* Hover polish */
.modal-content button#confirmDelete:hover {
  background: #dc2626;
}

.modal-content button#cancelDelete:hover {
  background: #e2e8f0;
}

/* =========================
 MODAL ALIGN BUTTONS PROPERLY
========================== */
   
.modal-content {
  display: flex;
  flex-direction: column;
}

.modal-content p {
  margin-bottom: 16px;
}

.modal-content .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal.shake .modal-content {
  animation: shake 0.3s;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

/* =========================
   📱 RESPONSIVE COMPONENT RULES
   ========================= */

@media (max-width: 640px) {
  .btn {
    width: auto;
    padding: 8px 12px;
    font-size: 13px;
    color: #fff;
  }
}

/* =========================
 CONTINUE WHERE YOU LEFT BADGE
   ========================= */

.resume-badge {
  position: absolute;
  top: 10px;
  right: 10px;

  color: #fff;

  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
}

.resume-badge {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
}


/* =========================
   🔵 TOP SLIM LOADER
   ========================= */

#top-loader {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #3b82f6);
  z-index: 2000;
  transition: width 0.3s ease;
}


/* =========================
   🚀 PREMIUM CONTINUE BAR
   ========================= */

.continue-bar {
  position: fixed;

  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);

  width: auto;
  min-width: 320px;
  max-width: 640px;

  padding: 14px 18px;

  background: #0f172a;
  color: #fff;

  border-radius: 14px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  box-shadow: 0 20px 60px rgba(0,0,0,0.25);

  z-index: 999;
}

/* Left */
.continue-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.continue-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
}

.continue-info h4 {
  font-size: 14px;
  margin: 2px 0;
}

.continue-label {
  font-size: 11px;
  opacity: 0.7;
}

/* Progress */
.continue-progress {
  width: 120px;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 999px;
  overflow: hidden;
  margin: 4px 0;
}

.continue-progress div {
  height: 100%;
  background: #22c55e;
}

/* Right */
.continue-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.continue-close {
  cursor: pointer;
  opacity: 0.6;
}

.continue-close:hover {
  opacity: 1;
}

/* Animation */
@keyframes slideUp {
  from {
    transform: translate(-50%, 20px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

/* =========================
   🎯 MOBILE OPTIMIZATION
========================= */

@media (max-width: 640px) {

  .continue-bar {
    left: 10px;
    right: 10px;
    transform: none;

    width: auto;
    max-width: none;

    border-radius: 12px;
    padding: 12px;
    backdrop-filter: blur(10px);
  }
    .continue-title {
    font-size: 13px;
  }
    .continue-thumb {
    width: 40px;
    height: 40px;
  }

}

/* =========================
   🎯 DESKTOP PREMIUM VERSION
========================= */

@media (min-width: 1024px) {

  .continue-bar {
    max-width: 500px;
    margin: auto;
  }

}

/* =========================
  FLOATING ACTION BUTTON
========================= */

.course-overlay-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);

  opacity: 0;
  transition: all 0.25s ease;
}


.course-overlay .btn {
  padding: 8px 14px;
  font-size: 13px;
}

.course-overlay .btn {
  transform: translateY(10px);
  transition: 0.3s;
}

.course-card:hover .course-overlay .btn {
  transform: translateY(0);
}

/* =========================
 🔥 THUMBNAIL WITH PREMIUM OVERLAY
   ========================= */

.course-thumb {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: #e2e8f0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.course-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-thumb img {
  transition: transform 0.4s ease;
}

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

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

/* Gradient overlay */
.course-thumb::after {
  content: "";
  position: absolute;
  inset: 0;

  background: linear-gradient(
    to top,
    rgba(15,23,42,0.6),
    rgba(15,23,42,0.1),
    transparent
  );
}


/* =========================
 🔥 COURSE BODY
   ========================= */

/* BODY */
.course-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* TITLE */
.course-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.course-desc {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;

  display: -webkit-box;
  -webkit-line-clamp: 2; /* 🔥 LIMIT TO 2 LINES */
  -webkit-box-orient: vertical;
  overflow: hidden;

  min-height: 32px; /* keeps card height consistent */
}

/* META (rating + price) */
.course-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.course-rating {
  font-size: 12px;
  font-weight: 500;
}

.course-price {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

/* PROGRESS */
.progress-wrapper {
  margin-top: 4px;
}

.progress-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4D44E1, #22c55e);
  border-radius: 10px;
}

.progress-text {
  font-size: 11px;
  color: #6b7280;
  min-width: 30px;
}

/* BUTTON AREA */
.course-footer {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
}


/* =========================
 ALL COURSE CARD CSS HERE
   ========================= */

.course-card {
  position: relative;
  overflow: hidden;

  transition: all 0.25s ease;
}

.course-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.08);
}


.course-card.recommended {
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  transition: all 0.25s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

.course-card.recommended:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 35px rgba(0,0,0,0.1);
}


.course-card.recommended .course-thumb {
  height: 120px;
  overflow: hidden;
}

.course-card.recommended img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


.course-card.recommended .course-body {
  padding: 12px;
}

/* =========================
 REMOVE GLOBAL LINK / HOVER COLOR BLEED
   ========================= */

.course-card a:hover {
  color: inherit;
}

/* =========================
 MY COURSES PAGE FILTER
   ========================= */
   
.course-filters {
  display: flex;
  gap: 10px;

  margin-top: 20px;
  margin-bottom: 25px; /* 🔥 THIS FIXES THE GAP */
}

.filter-btn {
  padding: 8px 14px;
  border-radius: 20px;

  border: 1px solid var(--color-border);
  background: #fff;

  font-size: 13px;
  font-weight: 500;

  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: #f5f7ff;
  border-color: #c7d2fe;
}

.filter-btn.active {
  background: #4D44E1;
  color: #fff;
  border-color: #4D44E1;
}


/*=========================
Flash Message Toast CSS
==========================*/

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

/* Toast Card */
.toast {
  min-width: 280px;
  max-width: 320px;
  padding: 14px 16px;

  border-radius: 12px;
  background: #111827;
  color: #fff;

  display: flex;
  align-items: flex-start;
  gap: 12px;

  box-shadow: 0 20px 40px rgba(0,0,0,0.15);

  opacity: 0;
  transform: translateX(40px) scale(0.98);

  animation: toastIn 0.4s ease forwards;
}

.toast {
  position: relative;
  touch-action: pan-y;
  cursor: pointer;
}

/* Entry Animation */
@keyframes toastIn {
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Exit */
.toast.hide {
  opacity: 0;
  transform: translateX(40px) scale(0.96);
  transition: all 0.3s ease;
}

/* Icon */
.toast-icon {
  font-size: 18px;
  margin-top: 2px;
}

/* Content */
.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 13px;
  opacity: 0.85;
}

/* Variants (calm colors) */
.toast.success { background: #052e16; }
.toast.error   { background: #3f0d0d; }
.toast.info    { background: #1e1b4b; }

/* Progress bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: rgba(255,255,255,0.2);
  overflow: hidden;
  border-radius: 0 0 12px 12px;
}

.toast-progress-bar {
  height: 100%;
  width: 100%;
  background: rgba(255,255,255,0.6);
  animation: toastTimer linear forwards;
}

/* Timer animation */
@keyframes toastTimer {
  from { width: 100%; }
  to   { width: 0%; }
}


/*=========================
 FIX FILTER TABS CSS
==========================*/

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: var(--space-md);
}

.tab {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;

  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);

  transition: all 0.2s ease;
}

.tab:hover {
  background: #f3f4f6;
}

.tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}



