/**
 * Admin Modern Theme
 * Completely fresh design - dark sidebar, sleek navbar, modern buttons
 */

/* ========== SIDEBAR - Dark Minimalist ========== */
#accordionSidebar.sidebar-modern {
  background: #0f172a !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  width: 260px !important;
}

.sidebar-modern .sidebar-brand {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-modern .sidebar-brand:hover {
  background: transparent;
}
.sidebar-modern .sidebar-brand img {
  filter: brightness(0) invert(1);
  opacity: 0.95;
}
.sidebar-modern .text-center.px-3.py-2 {
  padding: 0.75rem 1rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-modern .text-center.px-3.py-2 span {
  color: #94a3b8 !important;
  font-size: 0.8rem !important;
  font-weight: 500;
}

.sidebar-modern .sidebar-divider {
  border-color: rgba(255, 255, 255, 0.06);
  margin: 0.5rem 1rem;
}

.sidebar-modern .nav-item {
  margin: 0;
}
.sidebar-modern .nav-link {
  padding: 0.65rem 1rem !important;
  margin: 0.125rem 0.75rem !important;
  border-radius: 0.5rem !important;
  width: auto !important;
  text-align: left !important;
  color: #94a3b8 !important;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex !important;
  align-items: center;
  border: none !important;
}
.sidebar-modern .nav-link:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #f1f5f9 !important;
  transform: none;
}
.sidebar-modern .nav-link.active {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
  border-left: 3px solid #3b82f6;
  margin-left: 0.5rem !important;
  padding-left: 0.75rem !important;
}
.sidebar-modern .nav-link i {
  width: 1.25rem;
  margin-right: 0.75rem;
  font-size: 0.85rem;
  opacity: 0.9;
}

.sidebar-modern .collapse-inner {
  background: rgba(15, 23, 42, 0.5) !important;
  border-radius: 0.5rem !important;
  margin: 0.25rem 0.75rem 0.5rem !important;
  padding: 0.5rem !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-modern .collapse-item {
  padding: 0.5rem 1rem !important;
  margin: 0.125rem 0 !important;
  border-radius: 0.375rem !important;
  color: #94a3b8 !important;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
.sidebar-modern .collapse-item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #f1f5f9 !important;
  transform: none;
}

.sidebar-modern .btn-danger {
  margin: 0.75rem !important;
  background: rgba(239, 68, 68, 0.2) !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  color: #f87171 !important;
  border-radius: 0.5rem !important;
  font-weight: 500;
}
.sidebar-modern .btn-danger:hover {
  background: rgba(239, 68, 68, 0.3) !important;
  border-color: #ef4444 !important;
  color: #fff !important;
}

/* Mobile sidebar behavior: make it a proper slide-in drawer */
@media (max-width: 767.98px) {
  #accordionSidebar.sidebar-modern {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1040;
    width: 260px !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: transform 0.22s ease;
  }

  #accordionSidebar.sidebar-modern.toggled {
    width: 260px !important;
    transform: translateX(-100%);
  }

  #wrapper #content-wrapper {
    width: 100%;
  }

  .sidebar-modern .nav-item .collapse {
    position: relative;
    left: 0;
    top: 0;
    margin: 0 0.75rem;
  }

  .sidebar-modern .nav-item .collapse .collapse-inner {
    box-shadow: none;
    border-radius: 0.5rem;
  }

  .sidebar-modern .nav-item .nav-link span {
    font-size: 0.85rem;
    display: inline;
    white-space: normal;
  }
}

/* ========== NAVBAR - Sleek Modern ========== */
.topbar-modern {
  background: #fff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  padding: 0.5rem 1rem 0.5rem 0 !important;
}

.topbar-modern #sidebarToggleTop {
  color: #64748b !important;
  padding: 0.5rem;
}
.topbar-modern #sidebarToggleTop:hover {
  color: #0f172a !important;
  background: #f1f5f9 !important;
}

.topbar-modern .nav-link {
  color: #64748b !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem !important;
  border-radius: 0.5rem !important;
  transition: all 0.2s ease;
}
.topbar-modern .nav-link:hover {
  color: #0f172a !important;
  background: #f8fafc !important;
}

.topbar-modern .dropdown-toggle::after {
  margin-left: 0.35rem;
  font-size: 0.75rem;
}

.topbar-modern .badge-counter {
  position: absolute !important;
  top: -2px !important;
  right: -2px !important;
  font-size: 0.65rem !important;
  padding: 0.2rem 0.4rem !important;
  border-radius: 9999px !important;
  background: #ef4444 !important;
  color: #fff !important;
}

.topbar-modern .dropdown-menu {
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12) !important;
  border-radius: 0.75rem !important;
  padding: 0.5rem !important;
  margin-top: 0.5rem !important;
  min-width: 280px;
}
.topbar-modern .dropdown-header {
  padding: 0.75rem 1rem !important;
  font-weight: 600;
  color: #0f172a !important;
  background: #f8fafc !important;
  border-radius: 0.5rem !important;
  margin-bottom: 0.25rem;
}
.topbar-modern .dropdown-item {
  padding: 0.75rem 1rem !important;
  border-radius: 0.5rem !important;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}
.topbar-modern .dropdown-item:hover {
  background: #f1f5f9 !important;
  padding-left: 1rem !important;
}
.topbar-modern .dropdown-item.text-danger:hover {
  background: #fef2f2 !important;
  color: #dc2626 !important;
}
.topbar-modern .dropdown-divider {
  margin: 0.5rem 0;
  border-color: #e2e8f0;
}

.topbar-modern .rounded-circle.bg-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.topbar-modern .topbar-divider {
  border-color: #e2e8f0;
}

.topbar-modern .icon-circle {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

/* ========== QUIZ LIST BUTTONS - Modern Pill Style ========== */
.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Primary action - Attempt */
.btn-quiz-attempt {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 9999px;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none !important;
}
.btn-quiz-attempt.btn-free {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}
.btn-quiz-attempt.btn-free:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  color: #fff;
}
.btn-quiz-attempt.btn-paid {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}
.btn-quiz-attempt.btn-paid:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  color: #fff;
}

/* Status buttons */
.btn-quiz-expired {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
  transition: all 0.2s ease;
  text-decoration: none !important;
}
.btn-quiz-expired:hover {
  background: #fde68a;
  color: #92400e;
}

.btn-quiz-upcoming {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  cursor: not-allowed;
  text-decoration: none !important;
}

/* Action icons - modern style */
.btn-quiz-edit,
.btn-quiz-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  text-decoration: none !important;
}
.btn-quiz-edit {
  background: #ecfdf5;
  color: #059669;
}
.btn-quiz-edit:hover {
  background: #10b981;
  color: #fff;
}
.btn-quiz-delete {
  background: #fef2f2;
  color: #dc2626;
}
.btn-quiz-delete:hover {
  background: #ef4444;
  color: #fff;
}

/* Analytics dropdown */
.btn-quiz-analytics {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  transition: all 0.2s ease;
}
.btn-quiz-analytics:hover {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}
.btn-quiz-analytics .dropdown-menu {
  border-radius: 0.5rem;
  margin-top: 0.35rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  border: 1px solid #e2e8f0;
}
.btn-quiz-analytics .dropdown-item {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: 0.375rem;
}
.btn-quiz-analytics .dropdown-item:hover {
  background: #f1f5f9;
}

/* Quiz actions cell padding */
.admin-table-card .quiz-actions {
  padding: 0.25rem 0;
}

/* ========== QUIZ FILTER TABS - Grouped cards ========== */
.quiz-filters-row {
  margin-bottom: 1.25rem;
}

.quiz-filters-row .quiz-filter-board {
  width: 100%;
  padding: 1rem;
  border: 1px solid #dbe4ef;
  border-radius: 16px;
  background: linear-gradient(180deg, #fdfefe 0%, #f4f8fc 100%);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.quiz-filters-row .quiz-filter-group {
  height: 100%;
  padding: 0.9rem;
  border-radius: 12px;
  border: 1px solid #d7e1ec;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.quiz-filters-row .quiz-filter-heading {
  margin-bottom: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4b647d;
}

.quiz-filters-row .quiz-filters-modern {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.quiz-filters-row .quiz-filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.05rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 10px;
  background: #f7fafd;
  color: #37506a;
  border: 1px solid #d6e2ee;
  text-decoration: none !important;
  transition: all 0.18s ease;
}

.quiz-filters-row .quiz-filter-pill:hover {
  background: #edf3f9;
  border-color: #bfd2e5;
  color: #1f3a55;
  transform: translateY(-1px);
}

.quiz-filters-row .quiz-filter-pill.quiz-filter-main {
  border-color: #b6d1ea;
  background: linear-gradient(135deg, #eef6ff 0%, #e3f0ff 100%);
}

.quiz-filters-row .quiz-filter-pill.active {
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 7px 16px rgba(37, 99, 235, 0.28);
}

.quiz-filters-row .quiz-filter-pill .pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 0.14rem 0.42rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
}

.quiz-filters-row .quiz-filter-pill.active .pill-count {
  background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 1199px) {
  .quiz-filters-row .quiz-filter-board {
    padding: 0.85rem;
  }
}

@media (max-width: 767px) {
  .quiz-filters-row .quiz-filter-board {
    padding: 0.75rem;
    border-radius: 12px;
  }
  .quiz-filters-row .quiz-filter-group {
    padding: 0.75rem;
  }
}
