/* DANZFLO — Classes Instructor Management */

.inst-page {
  position: relative;
  background:
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(37, 99, 235, 0.06), transparent 55%),
    radial-gradient(ellipse 55% 40% at 100% 0%, rgba(249, 115, 22, 0.05), transparent 50%),
    #f8fafc;
}

.inst-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.inst-header-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.625rem;
}

.inst-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: #64748b;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.625rem;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.inst-back:hover {
  color: #2563eb;
  border-color: #93c5fd;
  background: #eff6ff;
}

.inst-back svg { width: 1.125rem; height: 1.125rem; }

.inst-page-badge {
  display: inline-flex;
  align-items: center;
  height: 2.5rem;
  padding: 0 1.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ea580c;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 9999px;
}

.inst-page-title {
  margin: 0.5rem 0 0;
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.inst-header-top + .inst-page-title { margin-top: 0; }

.inst-page-subtitle {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  color: #64748b;
}

.inst-header-stats {
  display: flex;
  gap: 0.75rem;
}

.inst-header-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.875rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.inst-header-stat__value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.inst-header-stat__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

/* Panel */
.inst-panel {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.inst-toolbar {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #eef2f7;
}

.inst-search {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  max-width: 22rem;
  height: 2.75rem;
  padding: 0 0.875rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.inst-search:focus-within {
  background: #fff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.inst-search svg {
  width: 1.125rem;
  height: 1.125rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.inst-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.875rem;
  color: #0f172a;
}

.inst-search input::placeholder { color: #94a3b8; }

/* Table */
.inst-table-wrap {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.inst-table-wrap--initial {
  min-height: 220px;
}

.inst-table-wrap--busy .inst-table {
  opacity: 0.45;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.inst-table-busy-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.inst-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
}

.inst-table th {
  padding: 0.875rem 1.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}

.inst-table th.text-right,
.inst-table td.text-right { text-align: right; }

.inst-table th.text-center,
.inst-table td.text-center { text-align: center; }

.inst-table td {
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.inst-table tbody tr {
  transition: background 0.15s ease;
}

.inst-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.03);
}

.inst-table tbody tr:last-child td { border-bottom: none; }

.inst-name-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.inst-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #e2e8f0;
  flex-shrink: 0;
}

.inst-name {
  font-weight: 600;
  color: #0f172a;
}

.inst-email {
  color: #64748b;
  font-size: 0.8125rem;
}

.inst-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #334155;
  background: #f1f5f9;
  border-radius: 999px;
}

.inst-thumb {
  display: block;
  width: 4.5rem;
  height: 2.75rem;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #e2e8f0;
}

.inst-title-link {
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
  transition: color 0.15s ease;
}

.inst-title-link:hover { color: #2563eb; }

.inst-level {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  color: #0369a1;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.18);
  border-radius: 999px;
}

.inst-level--intermediate {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.2);
}

.inst-level--advanced {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.18);
}

.inst-price {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #0f172a;
}

.inst-price--strike {
  color: #94a3b8;
  font-weight: 500;
  text-decoration: line-through;
}

.inst-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.375rem;
}

.inst-action-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: #475569;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.inst-action-btn:hover {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.15);
}

.inst-action-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* Floating tooltip (body-level) */
.inst-help-tooltip {
  position: fixed;
  z-index: 9999;
  max-width: 12rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: #0f172a;
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, visibility 0.12s ease;
  white-space: nowrap;
}

.inst-help-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}

.inst-help-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #0f172a;
  border-bottom: 0;
}

.inst-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.875rem;
}

/* Pagination */
.inst-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid #eef2f7;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.4), rgba(255, 255, 255, 0.9));
}

.inst-pagination[hidden] { display: none; }

.inst-pagination-info {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
  text-align: center;
}

.inst-pagination-info strong {
  color: #334155;
  font-weight: 600;
}

.inst-page-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.inst-page-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.inst-page-nav,
.inst-page-text,
.inst-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.125rem;
  height: 2.125rem;
  padding: 0 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.inst-page-nav svg {
  width: 1rem;
  height: 1rem;
}

.inst-page-nav:hover:not(:disabled),
.inst-page-text:hover:not(:disabled),
.inst-page-btn:hover {
  color: #2563eb;
  border-color: #93c5fd;
  background: rgba(37, 99, 235, 0.04);
}

.inst-page-nav:disabled,
.inst-page-text:disabled { opacity: 0.4; cursor: not-allowed; }

.inst-page-nums { display: flex; align-items: center; gap: 0.375rem; }

.inst-page-btn.active {
  color: #2563eb;
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.06);
}

.inst-page-ellipsis {
  color: #94a3b8;
  font-size: 0.8125rem;
  padding: 0 0.25rem;
}

.inst-page-size-select {
  height: 2.125rem;
  padding: 0 2rem 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") no-repeat right 0.5rem center / 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  appearance: none;
  cursor: pointer;
}

/* Video Modal */
.inst-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.inst-modal-overlay[hidden] { display: none !important; }

.inst-modal {
  width: 100%;
  max-width: 56rem;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25);
  overflow: hidden;
  animation: inst-modal-in 0.2s ease;
}

@keyframes inst-modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.inst-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #eef2f7;
}

.inst-modal-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.inst-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.inst-modal-close:hover {
  color: #ef4444;
  border-color: #fca5a5;
  background: #fef2f2;
}

.inst-modal-close svg { width: 1rem; height: 1rem; }

.inst-modal-body { padding: 1rem 1.25rem 1.25rem; }

.inst-video-player {
  position: relative;
  background: #0f172a;
  border-radius: 0.75rem;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.inst-video-player video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Class Details */
.cd-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
  padding: 1.25rem;
  overflow: hidden;
}

.cd-video-wrap {
  position: relative;
  border-radius: 0.875rem;
  overflow: hidden;
  background: #0f172a;
  aspect-ratio: 16 / 9;
  margin-bottom: 1.25rem;
}

.cd-video-poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cd-video-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.25);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.cd-video-play:hover { background: rgba(15, 23, 42, 0.4); }

.cd-video-play svg {
  width: 4rem;
  height: 4rem;
  color: #fff;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.cd-identity {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.cd-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.75rem;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.cd-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.cd-meta {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.cd-info-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.cd-info-card {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.875rem 1rem;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 0.75rem;
}

.cd-info-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.cd-info-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  text-transform: capitalize;
}

.cd-section { margin-bottom: 1.25rem; }
.cd-section:last-child { margin-bottom: 0; }

.cd-section-label {
  margin: 0 0 0.625rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.cd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cd-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: #334155;
  border-radius: 999px;
}

.cd-desc {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #475569;
}

@media (max-width: 1024px) {
  .cd-info-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .inst-page-header { flex-direction: column; }
  .inst-search { max-width: none; }
  .cd-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inst-pagination { flex-direction: column; align-items: stretch; }
  .inst-page-left { justify-content: center; }
}
