/* ============================================================
   Question Bank Data Entry – Custom Styles
   Mobile-First, Bootstrap 5 companion
   ============================================================ */

/* ── Base ─────────────────────────────────────────────────── */
:root {
  --qb-primary:    #0d6efd;
  --qb-sidebar-w: 270px;
  --qb-navbar-h:  56px;
}

body {
  font-size: 15px;
  background-color: #f4f6fb;
  -webkit-tap-highlight-color: transparent;
}

/* ── Main content offset ─────────────────────────────────── */
.main-content {
  min-height: calc(100vh - var(--qb-navbar-h));
  padding-bottom: 80px; /* space for sticky submit on mobile */
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  transition: box-shadow .15s ease;
}
.card:hover {
  box-shadow: 0 .25rem 1rem rgba(0,0,0,.08) !important;
}

/* ── Form controls – larger touch targets on mobile ─────── */
@media (max-width: 575.98px) {
  .form-control,
  .form-select {
    font-size: 16px; /* prevents iOS zoom */
    padding: .6rem .8rem;
  }
  .form-control-lg,
  .form-select-lg {
    font-size: 16px;
    padding: .7rem .9rem;
  }
  .btn-lg {
    font-size: 16px;
  }
}

/* ── Sticky Submit Button ────────────────────────────────── */
.sticky-submit {
  position: sticky;
  bottom: 12px;
  z-index: 50;
}

@media (max-width: 991.98px) {
  /* on small screens, the submit card sticks to bottom */
  .sticky-submit {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    border-radius: 0 !important;
    z-index: 100;
    box-shadow: 0 -2px 12px rgba(0,0,0,.12) !important;
  }
}

/* ── Login Page ──────────────────────────────────────────── */
.login-wrapper {
  background: linear-gradient(135deg, #e8f0fe 0%, #f4f6fb 100%);
}
.login-wrapper .card {
  border-radius: 1.25rem !important;
}

/* ── Mobile Sidebar ──────────────────────────────────────── */
.mobile-sidebar {
  position: fixed;
  top: 0;
  left: -100%;
  width: min(var(--qb-sidebar-w), 85vw);
  height: 100vh;
  z-index: 1050;
  transition: left .25s ease;
  overflow-y: auto;
}
.mobile-sidebar.open {
  left: 0;
}
.mobile-sidebar-inner {
  min-height: 100%;
}
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1040;
}

/* ── Toast / Flash ───────────────────────────────────────── */
.flash-alert {
  border-radius: .75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

/* ── Table improvements ──────────────────────────────────── */
.table th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}

/* ── Badge pill for counts ───────────────────────────────── */
.badge.rounded-pill { min-width: 2rem; }

/* ── Today Questions list ────────────────────────────────── */
#questionsList .list-group-item:hover {
  background-color: #f8f9ff;
}

/* ── Operator dashboard – question counter badge ─────────── */
.q-counter {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}

/* ── Loading spinner overlay ─────────────────────────────── */
.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* ── Accordion ───────────────────────────────────────────── */
.accordion-button:not(.collapsed) {
  background-color: #eef2ff;
  color: var(--qb-primary);
}
.accordion-button:focus {
  box-shadow: none;
}

/* ── Navbar ──────────────────────────────────────────────── */
.navbar-brand {
  font-size: 1.05rem;
}

/* ── Difficulty badges ───────────────────────────────────── */
.diff-easy   { background-color: #198754; color: #fff; }
.diff-medium { background-color: #ffc107; color: #000; }
.diff-hard   { background-color: #dc3545; color: #fff; }

/* ── Toast messages ──────────────────────────────────────── */
.toast-message {
  min-width: 260px;
  border-radius: .75rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.flash-alert {
  animation: fadeSlideIn .3s ease;
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
  .navbar, .mobile-sidebar, .sidebar-overlay, .btn, nav { display: none !important; }
  .main-content { padding: 0; }
}
