html, body { height: 100%; margin: 0; font-family: 'Plus Jakarta Sans', sans-serif; overflow: hidden; }
.sidebar-item { transition: all 0.2s ease-in-out; }
.sidebar-item:hover { background: rgba(255,255,255,0.1); }
.sidebar-item.active { background: rgba(255,255,255,0.2); font-weight: 600; border-left: 4px solid #34d399; }
.card-hover { transition: transform 0.2s, box-shadow 0.2s; }
.card-hover:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.toast { animation: slideIn 0.3s ease, slideOut 0.3s ease 2.7s; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideOut { from { transform: translateX(0); } to { transform: translateX(100%); } }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Halaqoh Smooth Transition & Tab Animation */
.halaqoh-tab-btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes halaqohSmoothFade {
  0% {
    opacity: 0.65;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
.halaqoh-transition-active {
  animation: halaqohSmoothFade 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
/* Import Modal Styles */
.import-drop-zone { border: 2px dashed #cbd5e1; border-radius: 1rem; transition: all 0.2s; }
.import-drop-zone.dragover { border-color: #10b981; background-color: #f0fdf4; }
.import-preview-table th { background: #f8fafc; font-size: 11px; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: 0.04em; }
.import-preview-table td { font-size: 12px; color: #334155; }
.import-preview-table tr.row-error td { background: #fff5f5; color: #dc2626; }
.import-preview-table tr.row-ok td { background: #f0fdf4; }
.badge-ok { background: #dcfce7; color: #166534; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.badge-err { background: #fee2e2; color: #991b1b; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }

/* Dashboard Donut Charts */
.donut-chart { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.donut-chart svg { transform: rotate(-90deg); }
.donut-ring { fill: none; stroke: #e2e8f0; }
.donut-segment { fill: none; stroke-linecap: round; transition: stroke-dashoffset 1s ease-in-out, opacity 0.3s; }
.donut-segment.animate-in { animation: donutFill 1.2s ease-out forwards; }
@keyframes donutFill {
  from { stroke-dashoffset: var(--circumference); }
  to { stroke-dashoffset: var(--target-offset); }
}
.donut-center-text { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center-text .pct { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.donut-center-text .label { font-size: 0.65rem; font-weight: 600; color: #64748b; margin-top: 2px; }

/* Chart Tooltip */
.chart-tooltip-wrap { position: relative; cursor: pointer; }
.chart-tooltip {
  position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%) scale(0.9); 
  background: #1e293b; color: #fff; padding: 10px 14px; border-radius: 12px;
  font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease; z-index: 50;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25); line-height: 1.6;
}
.chart-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #1e293b;
}
.chart-tooltip-wrap:hover .chart-tooltip,
.chart-tooltip-wrap:focus .chart-tooltip,
.chart-tooltip-wrap:active .chart-tooltip {
  opacity: 1; transform: translateX(-50%) scale(1); pointer-events: auto;
}

/* Overall summary donut */
.summary-donut-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 40%, #f5f3ff 100%);
  border: 1px solid #d1fae5;
}
.hide-scroll::-webkit-scrollbar { display: none; }
.hide-scroll { -ms-overflow-style: none; scrollbar-width: none; }

/* Printing Styles */
@media print {
  html, body, #app, #main-content {
    overflow: visible !important;
    height: auto !important;
    position: static !important;
    background: white !important;
  }
  #sidebar, #sidebar-backdrop, header, .no-print, .toast {
    display: none !important;
  }
  #main-content {
    padding: 0 !important;
    margin: 0 !important;
  }
  .print-header {
    display: block !important;
  }
  .print-signature {
    display: block !important;
    page-break-inside: avoid;
  }
  #halaqoh-modal-container {
    display: none !important;
  }
  /* Ensure tables look nice on paper/PDF */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
  }
  th, td {
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
  }
  th {
    text-align: center !important;
    vertical-align: middle !important;
  }
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .shadow-sm, .shadow-md, .shadow-lg, .shadow-xl, .shadow-2xl {
    box-shadow: none !important;
  }
  /* Remove page margins and headers injected by browser if possible */
  @page {
    margin: 1.5cm;
  }
}

/* Arabic Quran Typography */
.font-arabic {
  font-family: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
  font-feature-settings: "cv01", "cv02", "cv03", "cv04";
  direction: rtl;
  text-align: right;
  word-spacing: 2px;
}

.animate-in {
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* iOS Safe Area & Modal Padding */
.quran-modal-overlay {
  padding-top: max(1.5rem, calc(env(safe-area-inset-top, 0px) + 16px)) !important;
  padding-bottom: max(1rem, calc(env(safe-area-inset-bottom, 0px) + 12px)) !important;
  padding-left: max(0.75rem, env(safe-area-inset-left, 0px)) !important;
  padding-right: max(0.75rem, env(safe-area-inset-right, 0px)) !important;
}

@supports (-webkit-touch-callout: none) {
  /* iOS Safari specific viewport adjustment */
  .quran-modal-card {
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 2rem) !important;
  }
}

/* Quran Widget Animations & Styles */
#student-quran-section {
  scroll-margin-top: 1.5rem;
}

#sq-content-body::-webkit-scrollbar {
  width: 6px;
}
#sq-content-body::-webkit-scrollbar-track {
  background: #f1f5f9;
}
#sq-content-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
#sq-content-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

@keyframes audioPulseWave {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
}

.audio-playing-pulse {
  animation: audioPulseWave 1.8s ease-in-out infinite;
}

