/* ===== Styles for the institute / attendance / webhook pages (builds on the tokens in site.css) ===== */

/* Dropdowns inside the dark navbar follow the indigo theme */
.app-navbar .dropdown-menu {
  background: rgba(16, 23, 53, .97);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: .9rem;
  padding: .4rem;
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, .35);
}
.app-navbar .dropdown-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: rgba(255, 255, 255, .8);
  border-radius: .6rem;
  padding: .5rem .8rem;
  font-size: .92rem;
}
.app-navbar .dropdown-item:hover,
.app-navbar .dropdown-item:focus { background: rgba(255, 255, 255, .09); color: #fff; }
.app-navbar .dropdown-item.active { background: var(--grad); color: #fff; }
.nav-pills-custom .dropdown-toggle::after { margin-inline-start: .15rem; }
@media (min-width: 1200px) {
  /* Many destinations: keep every label on one line and tighten the pills */
  .nav-pills-custom { gap: .1rem; }
  .nav-pills-custom .nav-link { white-space: nowrap; padding: .5rem .65rem !important; font-size: .88rem; gap: .4rem; }
}
.rtl-flip { display: inline-block; }
[dir="rtl"] .rtl-flip { transform: scaleX(-1); }

/* Small pill chips used on sessions / attendance rows */
.app-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .12rem .6rem;
  margin-inline-end: .25rem;
  border-radius: 999px;
  background: #eef1fa;
  color: #475569;
  font-size: .76rem;
  font-weight: 500;
  white-space: nowrap;
}
.app-chip-info { background: rgba(6, 182, 212, .12); color: #0e7490; }
.app-chip-brand { background: rgba(79, 70, 229, .12); color: #4338ca; }
.app-chip-warn { background: rgba(245, 158, 11, .16); color: #b45309; }
.app-chip-danger { background: rgba(239, 68, 68, .14); color: #b91c1c; }

/* Participants table: below-threshold rows */
.rec-table tbody tr.row-low,
.rec-table tbody tr.row-low:hover { background: #fdecec; }

/* Connection-stability bars */
.signal-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; }
.signal-bars i { display: block; width: 4px; border-radius: 1px; background: currentColor; opacity: .22; }
.signal-bars i.on { opacity: 1; }

/* Class-activity grid on the session page */
.activity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .75rem; }
.activity-item {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .75rem 1rem;
  border-radius: .9rem;
  background: #f6f8fc;
}
.activity-label { font-size: .78rem; color: #64748b; }
.activity-sub { font-size: .75rem; color: #64748b; }
.activity-warn { background: rgba(245, 158, 11, .14); }

/* Live badge (pulsing dot reuses .live-dot from site.css) */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .3rem .8rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, .12);
  color: #15803d;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Analytics: server grid + cards */
.server-status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem; }
.server-status-card { padding: 1.25rem; border-radius: 1.25rem; box-shadow: 0 .25rem 1.25rem rgba(16, 23, 53, .06); }
.server-status-card:hover { transform: translateY(-3px); }
.stat-chip-button { border: 0; width: 100%; cursor: pointer; text-align: start; transition: transform .1s ease, box-shadow .15s ease, opacity .15s ease; }
.stat-chip-button:hover { box-shadow: 0 .4rem 1rem rgba(79, 70, 229, .18); }
.stat-chip-button:active { transform: scale(.98); }
.stat-chip-button.is-idle { opacity: .55; }
.stat-chip-button.is-idle:hover { opacity: .95; }
.server-status-card .stat-chip-row { flex-wrap: nowrap; }
.server-status-card .stat-chip { flex: 1; min-width: 0; }

.live-class-list { display: flex; flex-direction: column; gap: .75rem; }
.live-class {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1.1rem;
  border: 1px solid #e3e8f4;
  border-inline-start: 4px solid #22c55e;
  border-radius: 1rem;
  background: #fff;
  transition: box-shadow .15s ease;
}
.live-class:hover { box-shadow: 0 .5rem 1.25rem rgba(16, 23, 53, .1); }
.live-class-name { font-weight: 700; color: #0b1020; text-decoration: none; overflow-wrap: anywhere; }
.live-class-name:hover { color: var(--accent-1); text-decoration: underline; }
@media (max-width: 40rem) { .live-class { flex-wrap: wrap; } }

.device-split { display: flex; height: .75rem; border-radius: 999px; overflow: hidden; background: #e3e8f4; }
.device-split-mobile { background: var(--accent-2); }
.device-split-desktop { background: var(--accent-1); }
.device-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-inline-end: .3rem; }
.device-dot-mobile { background: var(--accent-2); }
.device-dot-desktop { background: var(--accent-1); }

.chart-box { position: relative; height: 260px; }
.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: .9rem;
  pointer-events: none;
}

.capture-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px dashed #cdd5e6;
  border-radius: 1rem;
  background: #f6f8fc;
}

.live-feed { max-height: 22rem; overflow-y: auto; }
#server-modal [data-modal-body].is-loading { opacity: .55; transition: opacity .15s ease; }
.user-avatar {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #eef1fa;
  color: #4338ca;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}
.user-avatar.is-moderator { background: var(--grad); color: #fff; }

/* Jalali date picker (Persian pages) */
.jalali-picker { position: relative; }
.jalali-picker__toggle { text-align: start; background: #fff; }
.jalali-picker__display.is-placeholder { color: #94a3b8; }
.jalali-picker__panel {
  position: absolute;
  z-index: 1050;
  inset-inline-start: 0;
  top: calc(100% + .35rem);
  width: 18rem;
  padding: .75rem;
  border: 1px solid #e3e8f4;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 1rem 2rem rgba(16, 23, 53, .18);
}
.jalali-picker__panel[hidden] { display: none; }
.jalali-picker__nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.jalali-picker__nav-labels { display: flex; gap: .35rem; flex: 1; }
.jalali-picker__nav-labels select { flex: 1; border: 1px solid #dfe5f1; border-radius: .5rem; padding: .2rem .3rem; font-size: .85rem; background: #fff; }
.jalali-picker__nav-btn { border: 0; background: #eef1fa; border-radius: .5rem; width: 1.9rem; height: 1.9rem; line-height: 1; }
.jalali-picker__nav-btn:hover { background: #dfe5f9; }
.jalali-picker__weekdays,
.jalali-picker__days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.jalali-picker__weekdays span { font-size: .75rem; color: #64748b; padding: .2rem 0; }
.jalali-picker__day { border: 0; background: transparent; border-radius: .5rem; padding: .3rem 0; font-size: .85rem; }
.jalali-picker__day:hover { background: #eef1fa; }
.jalali-picker__day--empty { visibility: hidden; }
.jalali-picker__day.is-today { box-shadow: inset 0 0 0 1px var(--accent-1); }
.jalali-picker__day.is-selected { background: var(--grad); color: #fff; }
.jalali-picker__footer { display: flex; justify-content: space-between; margin-top: .5rem; }
.jalali-picker__footer button { border: 0; background: transparent; color: var(--accent-1); font-size: .85rem; }

/* Printing the per-course attendance report */
.print-only { display: none; }
@media print {
  .app-navbar, .app-footer, .no-print, .pwa-ios-hint { display: none !important; }
  .page-wrap { padding-top: 0 !important; }
  .print-only { display: block !important; }
  .card { box-shadow: none !important; border: 0 !important; }
}
