/* ============================================================ 
   CHEM TUTOR - COMPLETE STYLES (UPDATED)
   ============================================================ */

/* ---------- ROOT VARIABLES ---------- */
:root { 
  --saffron: #FF9933; 
  --green: #138808; 
  --navy: #000080;
  --orange-50: #fff7ed;
  --orange-100: #ffedd5;
  --orange-500: #f97316;
  --orange-600: #ea580c;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-200: #fecaca;
  --red-500: #ef4444;
  --red-600: #dc2626;
}

* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}

body { 
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; 
  scroll-behavior: smooth;
  background: #f0f9ff;
  color: var(--gray-800);
  line-height: 1.6;
}

/* ---------- CONTAINER ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- RESPONSIVE GRID ---------- */
.grid-responsive {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid-responsive {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-responsive {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .grid-responsive {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- NAVBAR (Mobile Hamburger সহ) ---------- */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 12px 0;
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo i {
  color: var(--orange-500);
}

.logo span {
  color: var(--orange-500);
}

/* ✅ Mobile Menu Toggle Button */
.menu-toggle {
  display: block;
  font-size: 28px;
  cursor: pointer;
  color: var(--gray-700);
  padding: 4px 8px;
  background: none;
  border: none;
  transition: 0.3s;
}

.menu-toggle:hover {
  color: var(--orange-500);
}

/* ✅ Navigation Links */
.nav-links {
  display: none;
  width: 100%;
  flex-direction: column;
  background: white;
  padding: 16px 0;
  gap: 12px;
  text-align: center;
  border-top: 1px solid var(--gray-200);
  margin-top: 12px;
}

.nav-links.active {
  display: flex;
}

.nav-links a {
  transition: color 0.3s;
  font-size: 15px;
  color: var(--gray-600);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
}

.nav-links a:hover {
  color: var(--orange-500);
  background: var(--orange-50);
}

.nav-cta {
  background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
  color: #fff !important;
  padding: 10px 24px;
  border-radius: 30px;
  font-weight: 600;
  transition: 0.3s;
}

.nav-cta:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

/* ✅ Desktop Navigation */
@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }
  
  .nav-links {
    display: flex !important;
    width: auto;
    flex-direction: row;
    background: transparent;
    padding: 0;
    gap: 24px;
    border-top: none;
    margin-top: 0;
  }
}

/* ---------- DASHBOARD SIDEBAR (Responsive) ---------- */
.dashboard-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (min-width: 768px) {
  .dashboard-container {
    flex-direction: row;
  }
}

.sidebar {
  width: 100%;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 16px;
}

@media (min-width: 768px) {
  .sidebar {
    width: 260px;
    border-bottom: none;
    border-right: 1px solid var(--gray-200);
    min-height: 100vh;
    flex-shrink: 0;
  }
}

.main-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

@media (min-width: 768px) {
  .main-content {
    padding: 24px;
  }
}

/* ---------- STAT CARDS (Responsive) ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.stat-card {
  background: white;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  text-align: center;
}

.stat-card .stat-label {
  font-size: 11px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 800;
  margin-top: 4px;
}

@media (min-width: 640px) {
  .stat-card .stat-value {
    font-size: 28px;
  }
}

/* ---------- TABLES (Responsive) ---------- */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrapper table {
  min-width: 600px;
  width: 100%;
}

@media (max-width: 640px) {
  .table-wrapper table {
    min-width: 480px;
  }
}

/* ---------- MODAL (Responsive) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-content {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}

@media (max-width: 480px) {
  .modal-content {
    padding: 16px;
    border-radius: 16px;
  }
}

/* ---------- TOAST (Responsive) ---------- */
#toastContainer {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100% - 32px);
}

@media (min-width: 640px) {
  #toastContainer {
    max-width: 400px;
  }
}

.toast {
  background: white;
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  border-left: 5px solid #3b82f6;
  animation: slideInRight 0.3s ease-out;
  font-size: 14px;
}

/* ---------- ✅ SUSPENSION BANNER (NEW) ---------- */
.suspension-banner {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border: 2px solid #ef4444;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: shake 0.5s ease-in-out;
}

.suspension-banner .icon {
  font-size: 28px;
  flex-shrink: 0;
}

.suspension-banner .content {
  flex: 1;
}

.suspension-banner .title {
  font-weight: bold;
  color: #dc2626;
  font-size: 16px;
}

.suspension-banner .message {
  color: #991b1b;
  font-size: 14px;
  margin-top: 2px;
}

.suspension-banner .action-btn {
  background: #dc2626;
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: 0.3s;
}

.suspension-banner .action-btn:hover {
  background: #b91c1c;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* ---------- QUESTION PALETTE (Responsive) ---------- */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

@media (max-width: 480px) {
  .palette-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.palette-btn {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  background: white;
  color: var(--gray-700);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.palette-btn:hover {
  border-color: var(--gray-400);
}

.palette-btn.answered {
  background: #22c55e;
  border-color: #22c55e;
  color: white;
}

.palette-btn.current {
  border-color: var(--orange-500);
  background: var(--orange-50);
  color: var(--orange-500);
}

.palette-btn.answered.current {
  background: var(--orange-500);
  border-color: var(--orange-500);
  color: white;
}

/* ---------- LOADING ---------- */
#loadingOverlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#loadingOverlay.hidden {
  display: none !important;
}

/* ---------- ANIMATIONS ---------- */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- UTILITY ---------- */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.w-full {
  width: 100%;
}

.max-w-full {
  max-width: 100%;
}

.overflow-hidden {
  overflow: hidden;
}

.rounded-xl {
  border-radius: 12px;
}

.shadow-sm {
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ---------- RESPONSIVE IMAGES ---------- */
img {
  max-width: 100%;
  height: auto;
}

/* ---------- RESPONSIVE TYPOGRAPHY ---------- */
@media (max-width: 480px) {
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  h3 { font-size: 18px; }
  p { font-size: 14px; }
}

@media (min-width: 768px) {
  h1 { font-size: 32px; }
  h2 { font-size: 28px; }
  h3 { font-size: 22px; }
}

/* ============================================================
   COURSE CARD REORDER STYLES
   ============================================================ */

/* Move buttons */
.move-btn {
  background: #f1f5f9;
  color: #475569;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.move-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
  transform: scale(1.02);
}

.move-btn:active {
  transform: scale(0.95);
}

.move-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Course card drag & drop styles */
.course-card {
  transition: all 0.2s ease;
  cursor: grab;
  user-select: none;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 35px -12px rgba(0,0,0,0.15);
}

.course-card:active {
  cursor: grabbing;
}

.course-card.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.course-card.drag-over {
  border-color: #f97316 !important;
  border-width: 2px !important;
  box-shadow: 0 0 0 3px rgba(249,115,22,0.2);
}

/* Drag handle hint */
.drag-hint {
  font-size: 12px;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}