/* ============================================================
   TAKSHILA FAQ — Global CSS
   ============================================================ */

/* ---------- Google Font ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #e0e7ff;
  --accent: #06b6d4;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0891b2;
  --purple: #7c3aed;

  --bg: #f0f4ff;
  --bg-card: #ffffff;
  --bg-sidebar: #1e1b4b;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(79, 70, 229, .10);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .08);
  --transition: .22s ease;
  --sidebar-w: 260px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

/* ---------- Utility ---------- */
.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.gap-2 {
  gap: .5rem;
}

.gap-3 {
  gap: .75rem;
}

.gap-4 {
  gap: 1rem;
}

.mt-1 {
  margin-top: .25rem;
}

.mt-2 {
  margin-top: .5rem;
}

.mt-3 {
  margin-top: .75rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.text-muted {
  color: var(--text-muted);
  font-size: .875rem;
}

.text-sm {
  font-size: .875rem;
}

.text-xs {
  font-size: .75rem;
}

.fw-600 {
  font-weight: 600;
}

.fw-700 {
  font-weight: 700;
}

.w-100 {
  width: 100%;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* ---------- Badge ---------- */
.badge {
  display: inline-block;
  padding: .4rem .65rem;
  border-radius: 15px;
  font-size: .73rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: .3px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .9rem;
  border-radius: var(--radius-sm);
  border: none;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  /* transform: translateY(-1px); */
  box-shadow: 0 4px 12px rgba(79, 70, 229, .35);
  text-decoration: none;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  filter: brightness(1.1);
  /* transform: translateY(-1px); */
  text-decoration: none;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  filter: brightness(1.1);
  /* transform: translateY(-1px); */
  text-decoration: none;
}

.btn-warning {
  background: var(--warning);
  color: #fff;
}

.btn-warning:hover {
  filter: brightness(1.1);
  /* transform: translateY(-1px); */
  text-decoration: none;
}

.btn-info {
  background: var(--info);
  color: #fff;
}

.btn-info:hover {
  filter: brightness(1.1);
  /* transform: translateY(-1px); */
  text-decoration: none;
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--text);
}

.btn-secondary:hover {
  background: #cbd5e1;
  /* transform: translateY(-1px); */
  text-decoration: none;
}

.btn-purple {
  background: var(--purple);
  color: #fff;
}

.btn-purple:hover {
  filter: brightness(1.1);
  /* transform: translateY(-1px); */
  text-decoration: none;
}

.btn-sm {
  padding: .3rem .75rem;
  font-size: .8rem;
}

.btn-xs {
  padding: .18rem .5rem;
  font-size: .72rem;
}

.btn-outline {
  background: transparent;
  /* border: 2px solid var(--primary); */
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

/* ---------- Form Controls ---------- */
.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: .4rem;
  font-size: .875rem;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: .6rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .9rem;
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

select.form-control {
  cursor: pointer;
}

/* ---------- Card ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 1.2rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ---------- Table ---------- */
.table-wrap {
  overflow-x: auto;
}

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

thead tr {
  background: var(--bg);
}

th {
  text-align: left;
  padding: .75rem 1rem;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 2px solid var(--border);
}

td {
  padding: .75rem 1rem;
  font-size: .875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #f8faff;
}

/* ---------- Alert / Flash ---------- */
.alert {
  padding: .85rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .875rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  border-left: 4px solid;
}

.alert-success {
  background: #f0fdf4;
  color: #15803d;
  border-color: #16a34a;
}

.alert-danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #dc2626;
}

.alert-warning {
  background: #fffbeb;
  color: #b45309;
  border-color: #d97706;
}

.alert-info {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #3b82f6;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  gap: .4rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 .6rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}

.page-btn:hover,
.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  text-decoration: none;
}

.page-btn.disabled {
  opacity: .45;
  pointer-events: none;
}

/* ---------- Stat Card ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-val {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: .2rem;
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* ---------- Sidebar layout ---------- */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  color: #e2e8f0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.4rem 1.4rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.sidebar-brand h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.sidebar-brand span {
  font-size: .72rem;
  color: #a5b4fc;
  font-weight: 500;
}

.sidebar-nav {
  padding: .8rem 0;
  flex: 1;
}

.nav-label {
  padding: .5rem 1.4rem .3rem;
  font-size: .68rem;
  font-weight: 700;
  color: #6366f1;
  text-transform: uppercase;
  letter-spacing: .8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1.4rem;
  color: #cbd5e1;
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
  border-left: 3px solid transparent;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: rgba(99, 102, 241, .2);
  border-left-color: #818cf8;
  text-decoration: none;
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: .95rem;
}

.sidebar-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: .8rem;
  color: #94a3b8;
}

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

.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: .9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.content {
  padding: 2rem;
  flex: 1;
}

/* ---------- FAQ Public Page ---------- */
.public-header {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: #fff;
  padding: 1rem;
  text-align: center;
}

.public-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: .5rem;
}

.public-header p {
  font-size: 1.05rem;
  opacity: .85;
}

.search-bar {
  max-width: 640px;
  margin: 1.25rem auto 0;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 1rem 1.2rem 1rem 3.2rem;
  border-radius: 50px;
  border: none;
  font-size: 1rem;
  font-family: inherit;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .2);
  outline: none;
}

.search-bar i {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
}

.portal-tabs {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  padding: 1.5rem 2rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.portal-tab {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1.1rem;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  background: #fff;
  color: var(--text);
  text-decoration: none;
}

.portal-tab:hover,
.portal-tab.active {
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  transform: translateY(-1px);
  text-decoration: none;
}

.faq-section {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.category-block {
  margin-bottom: 2.5rem;
}

.category-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--primary-light);
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.faq-item:hover {
  box-shadow: var(--shadow);
}

.faq-question {
  padding: 1rem 1.3rem;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background var(--transition);
  gap: .5rem;
}

.faq-question:hover {
  background: var(--primary-light);
}

.faq-question.open {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.faq-chevron {
  transition: transform var(--transition);
  flex-shrink: 0;
  color: var(--text-muted);
}

.faq-question.open .faq-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-answer {
  display: none;
  padding: 0 1.3rem 1.2rem;
  font-size: .9rem;
  line-height: 1.75;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.faq-answer.show {
  display: block;
  animation: fadeIn .2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.faq-answer ul,
.faq-answer ol {
  margin-left: 1.5rem;
  margin-top: .4rem;
}

.faq-answer p {
  margin-bottom: .5rem;
}

.helpful-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem 1.3rem .9rem;
  font-size: .8rem;
  color: var(--text-muted);
}

.helpful-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 30px;
  padding: .2rem .75rem;
  font-size: .78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .3rem;
  transition: all var(--transition);
  font-family: inherit;
}

.helpful-btn:hover {
  background: var(--bg);
}

.helpful-btn.yes:hover {
  border-color: var(--success);
  color: var(--success);
}

.helpful-btn.no:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.no-result {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.no-result i {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .content {
    padding: 1rem;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .public-header h1 {
    font-size: 1.75rem;
  }

  .topbar {
    padding: .75rem 1rem;
  }
}

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.modal-overlay.open .modal-container {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.modal-close:hover {
  color: var(--danger);
  background: #fef2f2;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1.1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

/* Modals sizing overrides */
.modal-lg {
  max-width: 850px;
}

.modal-sm {
  max-width: 450px;
}