/* Modern Smart Coaching Management System Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@300;400;500;600;700&family=Noto+Sans+Bengali:wght@400;500;600;700&display=swap');

:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary-color: #0f172a;
  --accent-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --sidebar-width: 260px;
  --sidebar-bg: #1e293b;
  --sidebar-color: #94a3b8;
  --sidebar-active: #3b82f6;
  --body-bg: #f8fafc;
}

body, button, input, select, textarea, h1, h2, h3, h4, h5, h6, .badge, .btn, table, p, a, div, span:not(.fa):not(.fas):not(.far):not(.fab):not(.bi):not([class*="fa-"]):not([class*="bi-"]) {
  font-family: 'Hind Siliguri', 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Preserve FontAwesome & Bootstrap Icons fonts */
.fa, .fa-solid, .fa-regular, .fa-brands, .fas, .far, .fab, [class*="fa-"] {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
  font-style: normal !important;
  display: inline-block;
  line-height: 1;
}

.bi, [class*="bi-"] {
  font-family: "bootstrap-icons" !important;
  font-style: normal !important;
  display: inline-block;
  line-height: 1;
}

body {
  background-color: var(--body-bg);
  color: #334155;
  margin: 0;
  padding: 0;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  50% { transform: scale(1.02); box-shadow: 0 0 15px 4px rgba(37, 99, 235, 0.25); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.animate-fade-in {
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }

/* Layout */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Backdrop Overlay for Auto-Hiding Sidebar on Outside Click */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #090d16 0%, #0f172a 40%, #1e293b 100%);
  color: #94a3b8;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.3s ease;
  z-index: 1050;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

/* Mobile: Sidebar behaves as an off-canvas drawer */
@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4);
  }
  .sidebar.show {
    transform: translateX(0);
  }
}

/* Desktop Collapsed state when toggled */
@media (min-width: 992px) {
  body.sidebar-collapsed .sidebar {
    margin-left: calc(-1 * var(--sidebar-width));
  }
}

.sidebar .brand {
  padding: 1.25rem 1.2rem;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar .brand .logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.35rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  animation: floatIcon 3s ease-in-out infinite;
}

.sidebar .brand .title {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.sidebar .brand .subtitle {
  font-size: 0.78rem;
  color: #94a3b8;
}

.sidebar-menu {
  list-style: none;
  padding: 0.75rem 0;
  margin: 0;
  overflow-y: auto;
  flex-grow: 1;
}

.sidebar-menu .menu-header {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  padding: 0.85rem 1.4rem 0.3rem;
  font-weight: 700;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.68rem 1.35rem;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.22s ease;
  border-left: 4px solid transparent;
  border-radius: 0 8px 8px 0;
  margin-right: 8px;
}

.sidebar-menu li a i {
  width: 22px;
  font-size: 1.05rem;
  color: #94a3b8;
  text-align: center;
  transition: transform 0.2s ease, color 0.2s ease;
}

.sidebar-menu li a:hover {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  transform: translateX(4px);
  border-left-color: #60a5fa;
}

.sidebar-menu li a:hover i {
  color: #60a5fa;
  transform: scale(1.15);
}

.sidebar-menu > li.active > a {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.25) 0%, rgba(37, 99, 235, 0.05) 100%);
  color: #ffffff;
  font-weight: 600;
  border-left-color: #3b82f6;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.1);
}

.sidebar-menu > li.active > a i {
  color: #38bdf8;
  transform: scale(1.1);
}

/* Drag & Drop Reordering Support */
.sidebar-menu li.draggable-item {
  cursor: grab;
  position: relative;
}

.sidebar-menu li.draggable-item:active {
  cursor: grabbing;
}

.sidebar-menu li.dragging {
  opacity: 0.35;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-menu li.drag-over {
  border-top: 2px solid #38bdf8 !important;
  background: rgba(56, 189, 248, 0.1);
}

.drag-handle {
  opacity: 0.3;
  margin-left: auto;
  font-size: 0.75rem;
  transition: opacity 0.2s;
}

.sidebar-menu li:hover .drag-handle {
  opacity: 0.8;
}

/* Sidebar Section Headers & Submenu Accordion */
.sidebar-section-header {
  padding: 0.85rem 1.35rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-section-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin-left: 6px;
}

.sidebar-submenu {
  list-style: none;
  padding: 0.25rem 0 0.5rem 1.5rem;
  margin: 0;
}

.sidebar-submenu li a {
  padding: 0.45rem 1rem 0.45rem 1.25rem;
  font-size: 0.88rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 6px 6px 0;
  transition: all 0.2s ease;
}

.sidebar-submenu li a:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  border-left-color: #38bdf8;
  transform: translateX(4px);
}

.sidebar-submenu li.active a {
  color: #ffffff;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.15);
  border-left-color: #38bdf8;
}

.submenu-arrow {
  margin-left: auto;
  font-size: 0.75rem;
  transition: transform 0.25s ease;
}

.menu-toggle[aria-expanded="true"] .submenu-arrow {
  transform: rotate(90deg);
}

.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Header Navbar */
.top-navbar {
  background: #ffffff;
  padding: 0.85rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

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

/* Modern Card */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

.stat-card .icon-box {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.card-custom {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  margin-bottom: 1.5rem;
}

.card-custom .card-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 1.05rem;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Buttons */
.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}
.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.badge-tag {
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
}

/* Table styles */
.table-custom {
  width: 100%;
  border-collapse: collapse;
}

.table-custom th {
  background-color: #f1f5f9;
  color: #475569;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.9rem;
}

.table-custom td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.table-custom tr:hover td {
  background-color: #f8fafc;
}

/* Question Paper Print Layout */
.question-paper-print {
  background: #ffffff;
  max-width: 800px;
  margin: 0 auto;
  padding: 30px;
  border: 1px solid #ddd;
  position: relative;
  font-family: 'Hind Siliguri', sans-serif;
}

.question-paper-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 4.5rem;
  color: rgba(0, 0, 0, 0.04);
  font-weight: 900;
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

/* Modal Stacking Safeguards */
.modal-backdrop {
  z-index: 1050 !important;
}
.modal {
  z-index: 1055 !important;
}
.modal-dialog {
  z-index: 1056 !important;
}

/* Print Rules */
@media print {
  .no-print, .sidebar, .top-navbar, .btn, .alert, .modal {
    display: none !important;
  }
  body, .app-wrapper, .main-content, .page-content {
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .question-paper-print {
    border: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
}

/* Mockup Exact UI Additions */
.header-search-box {
  position: relative;
}
.header-search-box .search-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
}
.header-search-box .search-input {
  padding-left: 42px;
  border-radius: 30px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 14px;
  height: 42px;
  transition: all 0.2s ease;
}
.header-search-box .search-input:focus {
  background-color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.logo-3d-box {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 50%, #3b82f6 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.35);
  animation: floatIcon 3.5s ease-in-out infinite;
}

.hero-welcome-card {
  background: linear-gradient(135deg, #edf5ff 0%, #f7faff 100%);
  border: 1px solid #e1ecfa;
  border-radius: 20px;
  padding: 24px 30px;
  position: relative;
  overflow: hidden;
}

.hero-welcome-card .quote-badge {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 13px;
  color: #1e3a8a;
  font-style: italic;
  font-weight: 500;
}

.dashboard-stat-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px 16px;
  border: 1px solid #edf2f7;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s, box-shadow 0.2s;
}
.dashboard-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}
.dashboard-stat-card .stat-icon-sq {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.quick-action-sq {
  border-radius: 16px;
  padding: 18px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.22s ease;
  border: 1px solid transparent;
}
.quick-action-sq:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.06);
}
.quick-action-sq .action-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-top: 6px;
  flex-shrink: 0;
}
