/* JoSAA 2026 seat matrix — mobile-first, Excel-style filters, colourful table/cards */

.smc-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 45%, #0f172a 100%);
  color: #fff;
  border-radius: 0.875rem;
  padding: 1rem 0.875rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
  .smc-hero {
    padding: 1.5rem 1.25rem;
    border-radius: 1rem;
  }
}

.smc-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
}

@media (min-width: 640px) {
  .smc-stat-grid {
    gap: 0.65rem;
  }
}

.smc-stat {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  padding: 0.4rem 0.2rem;
  text-align: center;
  min-width: 0;
}

@media (min-width: 640px) {
  .smc-stat {
    border-radius: 0.625rem;
    padding: 0.55rem 0.4rem;
  }
}

.smc-stat__n {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.1;
}

@media (min-width: 640px) {
  .smc-stat__n {
    font-size: 1.35rem;
  }
}

.smc-stat__l {
  font-size: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #94a3b8;
  margin-top: 0.12rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 640px) {
  .smc-stat__l {
    font-size: 0.6rem;
    letter-spacing: 0.06em;
    margin-top: 0.15rem;
  }
}

.smc-stat__l-full {
  display: none;
}

@media (min-width: 640px) {
  .smc-stat__l-short {
    display: none;
  }

  .smc-stat__l-full {
    display: inline;
  }
}

/* ── Excel-style filter toolbar ── */
.smc-toolbar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.smc-toolbar__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

@media (min-width: 640px) {
  .smc-toolbar__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
  }
}

/* Mobile: row1 Institute+Branch, row2 Status+Search */
@media (max-width: 639px) {
  .smc-filter-select,
  .smc-search {
    font-size: 0.75rem;
    padding: 0.45rem 1.75rem 0.45rem 0.5rem;
  }

  .smc-search {
    padding-right: 0.5rem;
  }
}

.smc-filter-field label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.2rem;
}

.smc-filter-select,
.smc-search {
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.55rem center;
  background-size: 12px;
  appearance: none;
  -webkit-appearance: none;
}

.smc-search {
  background-image: none;
  padding-right: 0.65rem;
  font-weight: 500;
}

.smc-filter-select:focus,
.smc-search:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.smc-toolbar__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.smc-clear-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  cursor: pointer;
}

.smc-clear-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.smc-active-filters {
  font-size: 0.7rem;
  color: #475569;
  flex: 1;
  min-width: 0;
}

.smc-active-filters strong {
  color: #1d4ed8;
}

.smc-result-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.65rem;
  padding: 0.35rem 0.65rem;
  background: #eff6ff;
  border-radius: 0.375rem;
  border-left: 3px solid #3b82f6;
}

/* ── Copy protection ── */
.smc-protected {
  user-select: none;
  -webkit-user-select: none;
}

.smc-protected * {
  user-select: none;
  -webkit-user-select: none;
}

.smc-shield-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.5rem;
  font-size: 0.7rem;
  color: #1e40af;
  margin-bottom: 0.75rem;
}

/* ── Type chips (colourful) ── */
.smc-type-chip {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 0.35rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.smc-type-chip--iit {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #5b21b6;
  border: 1px solid #c4b5fd;
}

.smc-type-chip--nit {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.smc-type-chip--iiit {
  background: linear-gradient(135deg, #ccfbf1, #99f6e4);
  color: #0f766e;
  border: 1px solid #5eead4;
}

.smc-type-chip--gfti {
  background: linear-gradient(135deg, #ffedd5, #fed7aa);
  color: #c2410c;
  border: 1px solid #fdba74;
}

.smc-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 0.35rem;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.smc-badge--added {
  background: #22c55e;
  color: #fff;
  box-shadow: 0 1px 4px rgba(34, 197, 94, 0.35);
}

.smc-badge--removed {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.35);
}

.smc-badge--renamed {
  background: #f59e0b;
  color: #fff;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.35);
}

.smc-demand {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 0.3rem;
  font-size: 0.65rem;
  font-weight: 700;
}

.smc-demand--very-high { background: #fecaca; color: #991b1b; }
.smc-demand--high { background: #fed7aa; color: #9a3412; }
.smc-demand--medium { background: #fef08a; color: #854d0e; }
.smc-demand--moderate { background: #e2e8f0; color: #475569; }
.smc-demand--na { background: #f1f5f9; color: #94a3b8; }

.smc-cutoff {
  font-weight: 800;
  color: #1d4ed8;
  font-size: 0.8rem;
}

.smc-cutoff--na {
  color: #94a3b8;
  font-weight: 600;
}

/* ── Table panel + maximize ── */
.smc-table-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.smc-table-panel__head .smc-swipe-hint {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.smc-table-panel__title {
  display: none;
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.5rem;
}

.smc-maximize-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.4rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #93c5fd;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.smc-maximize-btn:hover {
  background: #dbeafe;
  color: #1d4ed8;
}

.smc-maximize-btn__icon--compress {
  display: none;
}

.smc-table-panel--maximized .smc-maximize-btn__icon--expand {
  display: none;
}

.smc-table-panel--maximized .smc-maximize-btn__icon--compress {
  display: block;
}

.smc-table-panel--maximized {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  background: #f8fafc;
  margin: 0 !important;
}

.smc-table-panel--maximized .smc-table-panel__title {
  display: block;
}

.smc-table-panel--maximized .smc-table-panel__head {
  margin-bottom: 0.5rem;
}

.smc-table-viewport {
  position: relative;
}

.smc-table-panel--maximized .smc-table-viewport {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.smc-table-panel--maximized .smc-table-scroll {
  flex: 1;
  min-height: 0;
  max-height: none;
  height: auto;
}

.smc-table-panel--maximized .smc-capture-watermark {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  border-radius: 0.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='160'%3E%3Ctext x='50%25' y='50%25' dominant-baseline='middle' text-anchor='middle' fill='%231e40af' font-size='13' font-family='system-ui,sans-serif' font-weight='700' transform='rotate(-22 130 80)' opacity='0.22'%3EJEECounselors%3C/text%3E%3C/svg%3E");
  background-size: 260px 160px;
}

.smc-capture-watermark {
  display: none;
}

.smc-capture-shield {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 25;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.92);
  border-radius: 0.75rem;
  text-align: center;
}

.smc-table-panel--maximized .smc-capture-shield--visible {
  display: flex;
}

.smc-table-panel--capture-blocked .smc-table-scroll {
  filter: blur(22px) brightness(0.35);
  opacity: 0.2;
}

.smc-capture-shield__box {
  max-width: 18rem;
  color: #f8fafc;
}

.smc-capture-shield__icon {
  font-size: 1.75rem;
  display: block;
  margin-bottom: 0.5rem;
}

.smc-capture-shield__title {
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
}

.smc-capture-shield__hint {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.45;
}

body.smc-table-maximized {
  overflow: hidden;
}

.smc-table-panel--maximized {
  -webkit-touch-callout: none;
}

/* ── Scrollable table container (horizontal + vertical) ── */
.smc-table-scroll {
  position: relative;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  max-height: min(75vh, 720px);
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.smc-table-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.smc-table-scroll::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 99px;
}

.smc-table-scroll::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.smc-table-wrap {
  position: relative;
  min-width: min-content;
}

.smc-table-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    -24deg,
    transparent,
    transparent 100px,
    rgba(15, 23, 42, 0.012) 100px,
    rgba(15, 23, 42, 0.012) 200px
  );
  z-index: 2;
}

.smc-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
}

.smc-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 0.6rem 0.65rem;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(180deg, #1e3a8a 0%, #1d4ed8 100%);
  border-bottom: 2px solid #1e40af;
  white-space: nowrap;
}

.smc-table thead th:first-child {
  border-radius: 0.75rem 0 0 0;
}

.smc-table thead th:last-child {
  border-radius: 0 0.75rem 0 0;
}

.smc-table tbody tr[data-smc-row] {
  border-left: 4px solid transparent;
  transition: background 0.12s ease;
}

.smc-table tbody tr.smc-row--iit { background: #faf5ff; border-left-color: #8b5cf6; }
.smc-table tbody tr.smc-row--nit { background: #eff6ff; border-left-color: #3b82f6; }
.smc-table tbody tr.smc-row--iiit { background: #f0fdfa; border-left-color: #14b8a6; }
.smc-table tbody tr.smc-row--gfti { background: #fff7ed; border-left-color: #f97316; }

.smc-table tbody tr.smc-row--added td:first-child { box-shadow: inset 3px 0 0 #22c55e; }
.smc-table tbody tr.smc-row--removed { opacity: 0.92; }
.smc-table tbody tr.smc-row--removed td { color: #64748b; }

.smc-table tbody tr:hover {
  filter: brightness(0.97);
}

.smc-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  vertical-align: top;
  line-height: 1.35;
  color: #334155;
}

.smc-table tbody tr.smc-hidden,
.smc-card.smc-hidden {
  display: none !important;
}

.smc-inst-name {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.8rem;
}

.smc-branch-name {
  font-weight: 600;
  color: #1e293b;
}

.smc-degree {
  font-size: 0.68rem;
  color: #64748b;
}

.smc-research {
  font-size: 0.72rem;
  color: #475569;
  max-width: 14rem;
}

.smc-basis {
  font-size: 0.68rem;
  color: #64748b;
}

/* Mobile table — same colourful theme, scroll container */
@media (max-width: 639px) {
  .smc-table-scroll {
    max-height: min(68vh, 560px);
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    border-radius: 0.5rem;
  }

  .smc-table {
    min-width: 640px;
    font-size: 0.68rem;
  }

  .smc-table thead th {
    padding: 0.45rem 0.4rem;
    font-size: 0.58rem;
  }

  .smc-table td {
    padding: 0.4rem 0.45rem;
  }

  .smc-type-chip {
    font-size: 0.55rem;
    padding: 0.15rem 0.35rem;
  }

  .smc-badge {
    font-size: 0.55rem;
  }

  .smc-inst-name {
    font-size: 0.7rem;
  }

  .smc-branch-name {
    font-size: 0.68rem;
  }

  .smc-degree {
    font-size: 0.58rem;
  }

  .smc-cutoff {
    font-size: 0.68rem;
  }

  .smc-research {
    font-size: 0.62rem;
    max-width: 9rem;
  }

  .smc-demand {
    font-size: 0.55rem;
  }
}

.smc-insight-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  background: #fff;
  margin-bottom: 0.75rem;
}

.smc-insight-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.3rem;
}

.smc-print-block { display: none; }

@media print {
  .smc-protected,
  .smc-toolbar,
  .smc-shield-note {
    display: none !important;
  }
  .smc-print-block {
    display: block !important;
    padding: 2rem;
    text-align: center;
    color: #64748b;
  }
}

.smc-swipe-hint {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: #64748b;
  text-align: center;
  margin-bottom: 0.35rem;
  padding: 0.25rem 0.5rem;
  background: #f1f5f9;
  border-radius: 0.35rem;
}

@media (min-width: 900px) {
  .smc-swipe-hint {
    display: none;
  }
}
