/*
 * Evaluación de Maestros — Frontend CSS v2.2
 * ALL styles scoped inside .te-wrap. No globals. No :root. No @import.
 * No !important on inherited properties. No -webkit-text-fill-color on h2.
 */

/* ── Container ────────────────────────────────────────────── */
.te-wrap {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: #16161f;
  color: #e8e8f0;
  border-radius: 16px;
  padding: 40px;
  max-width: 820px;
  margin: 32px auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.45);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.te-wrap *, .te-wrap *::before, .te-wrap *::after {
  box-sizing: border-box;
}
.te-wrap::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(245,200,66,.13) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Typography inside wrap ───────────────────────────────── */
/* Deliberately NOT using !important so theme headings outside .te-wrap are unaffected */
.te-wrap .te-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 8px;
  /* Gradient text as background trick — scoped to .te-title not h2 */
  background: linear-gradient(135deg, #ffffff 40%, #f5c842);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.te-wrap p { margin: 0 0 1em; color: #e8e8f0; }
.te-wrap a { color: #f5c842; text-decoration: none; }
.te-wrap a:hover { color: #f79d3c; }

/* ── Badge ────────────────────────────────────────────────── */
.te-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f5c842, #f79d3c);
  color: #0e0e14;
  font-size: .68rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 4px 14px; border-radius: 100px; margin-bottom: 12px;
}

/* ── Header block ─────────────────────────────────────────── */
.te-wrap .te-header,
.te-wrap .te-explorer-header {
  text-align: center;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}
.te-wrap .te-header p,
.te-wrap .te-explorer-header p { color: #7878a0; margin: 0; font-size: .93rem; }

/* ── Breadcrumb ───────────────────────────────────────────── */
.te-wrap .te-breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 28px; padding-bottom: 20px;
  border-bottom: 1.5px solid #2a2a3d;
  position: relative; z-index: 1;
}
.te-wrap .te-bc-item {
  font-size: .82rem; font-weight: 500; color: #7878a0;
  padding: 4px 10px; border-radius: 100px;
  transition: color .2s, background .2s; cursor: default;
}
.te-wrap .te-bc-item.te-bc-clickable { cursor: pointer; color: #f5c842; }
.te-wrap .te-bc-item.te-bc-clickable:hover { background: rgba(245,200,66,.12); }
.te-wrap .te-bc-active { color: #e8e8f0; }
.te-wrap .te-bc-sep { color: #353550; font-size: .9rem; }

/* ── Step ─────────────────────────────────────────────────── */
.te-wrap .te-step { animation: teSlideUp .28s ease both; position: relative; z-index: 1; }
.te-wrap .te-step.te-hidden { display: none; }

/* ── University grid ──────────────────────────────────────── */
.te-wrap .te-uni-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.te-wrap .te-uni-card {
  display: flex; align-items: center; gap: 14px;
  background: #1c1c28; border: 1.5px solid #2a2a3d; border-radius: 8px;
  padding: 16px 18px; cursor: pointer; width: 100%; text-align: left;
  font-family: inherit; color: #e8e8f0;
  transition: border-color .2s, transform .15s, background .2s;
}
.te-wrap .te-uni-card:hover {
  border-color: rgba(245,200,66,.5);
  background: rgba(245,200,66,.05);
  transform: translateY(-2px);
}
.te-wrap .te-uni-logo {
  width: 48px; height: 48px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #f5c842, #f79d3c);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; color: #0e0e14; overflow: hidden;
}
.te-wrap .te-uni-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.te-wrap .te-uni-name { flex: 1; font-weight: 600; font-size: .95rem; line-height: 1.3; }
.te-wrap .te-uni-arrow { color: #7878a0; font-size: 1.1rem; transition: transform .2s; }
.te-wrap .te-uni-card:hover .te-uni-arrow { transform: translateX(4px); color: #f5c842; }

/* ── Faculty grid ─────────────────────────────────────────── */
.te-wrap .te-fac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.te-wrap .te-fac-card {
  display: flex; align-items: center; gap: 12px;
  background: #1c1c28; border: 1.5px solid #2a2a3d; border-radius: 8px;
  padding: 14px 16px; cursor: pointer; width: 100%; text-align: left;
  font-family: inherit; color: #e8e8f0; transition: border-color .2s, transform .15s;
}
.te-wrap .te-fac-card:hover { border-color: rgba(245,200,66,.5); transform: translateX(4px); }
.te-wrap .te-fac-icon { font-size: 1.3rem; }
.te-wrap .te-fac-name { flex: 1; font-weight: 600; font-size: .92rem; line-height: 1.3; }
.te-wrap .te-fac-arrow { color: #7878a0; transition: transform .2s, color .2s; }
.te-wrap .te-fac-card:hover .te-fac-arrow { transform: translateX(4px); color: #f5c842; }

/* ── Teacher mini-cards ───────────────────────────────────── */
.te-wrap .te-teachers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.te-wrap .te-teacher-mini-card {
  display: flex; align-items: center; gap: 14px;
  background: #1c1c28; border: 1.5px solid #2a2a3d; border-radius: 8px;
  padding: 15px 17px; cursor: pointer; width: 100%; text-align: left;
  font-family: inherit; color: #e8e8f0; transition: border-color .2s, transform .15s;
}
.te-wrap .te-teacher-mini-card:hover { border-color: rgba(245,200,66,.5); transform: translateY(-2px); }
.te-wrap .te-tmini-photo {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #f5c842, #f79d3c);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem; color: #0e0e14; overflow: hidden;
}
.te-wrap .te-tmini-photo img { width: 100%; height: 100%; object-fit: cover; }
.te-wrap .te-tmini-info { flex: 1; min-width: 0; }
.te-wrap .te-tmini-info strong {
  display: block; font-weight: 600; font-size: .95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #e8e8f0;
}
.te-wrap .te-tmini-info span { display: block; color: #7878a0; font-size: .82rem; }
.te-wrap .te-tmini-stars { color: #f5c842; font-size: .88rem; margin-top: 3px; }
.te-wrap .te-tmini-stars em { font-style: normal; font-weight: 600; font-size: .78rem; }
.te-wrap .te-tmini-stars.te-muted { color: #7878a0; font-size: .78rem; }
.te-wrap .te-tmini-evals { font-size: .75rem; color: #7878a0; }
.te-wrap .te-tmini-arrow { color: #7878a0; transition: color .2s; }
.te-wrap .te-teacher-mini-card:hover .te-tmini-arrow { color: #f5c842; }

/* ── Profile ──────────────────────────────────────────────── */
.te-wrap .te-profile-header {
  display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap;
  margin-bottom: 32px; padding-bottom: 24px;
  border-bottom: 1.5px solid #2a2a3d;
}
.te-wrap .te-teacher-avatar {
  width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #f5c842, #f79d3c);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.9rem; color: #0e0e14; overflow: hidden;
}
.te-wrap .te-teacher-avatar img { width: 100%; height: 100%; object-fit: cover; }
.te-wrap .te-profile-info { flex: 1; min-width: 160px; }
.te-wrap .te-profile-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem; font-weight: 700; line-height: 1.2;
  color: #e8e8f0; margin: 0 0 6px;
  /* No gradient, no -webkit-text-fill-color — preserves theme compatibility */
}
.te-wrap .te-subject { display: block; color: #f5c842; font-weight: 600; font-size: .93rem; margin-bottom: 4px; }
.te-wrap .te-profile-meta { display: block; color: #7878a0; font-size: .82rem; margin-bottom: 4px; }
.te-wrap .te-total { display: block; color: #7878a0; font-size: .82rem; }
.te-wrap .te-overall-badge {
  text-align: center; margin-left: auto;
  background: #1c1c28; border: 1.5px solid #2a2a3d;
  border-radius: 8px; padding: 14px 22px;
}
.te-wrap .te-overall-num { display: block; font-size: 2.6rem; font-weight: 700; color: #f5c842; line-height: 1; }
.te-wrap .te-overall-stars { color: #f5c842; font-size: 1rem; margin: 4px 0; letter-spacing: 2px; }
.te-wrap .te-overall-label { font-size: .72rem; color: #7878a0; text-transform: uppercase; letter-spacing: .08em; }

/* ── Section title ────────────────────────────────────────── */
.te-wrap .te-section-title {
  font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #7878a0; margin: 28px 0 16px; padding-bottom: 8px;
  border-bottom: 1px solid #2a2a3d;
}

/* ── Bars ─────────────────────────────────────────────────── */
.te-wrap .te-bars-grid { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.te-wrap .te-bar-row { display: grid; grid-template-columns: 180px 1fr 40px; align-items: center; gap: 12px; }
.te-wrap .te-bar-label { font-size: .88rem; font-weight: 500; color: #e8e8f0; }
.te-wrap .te-bar-track {
  background: #1c1c28; border-radius: 100px;
  height: 8px; overflow: hidden; border: 1px solid #2a2a3d;
}
.te-wrap .te-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f5c842, #f79d3c);
  border-radius: 100px;
  transition: width 1s cubic-bezier(.25,1,.25,1);
}
.te-wrap .te-bar-num { font-weight: 700; color: #f5c842; text-align: right; font-size: .9rem; }

/* ── Comments ─────────────────────────────────────────────── */
.te-wrap .te-comments-list { display: flex; flex-direction: column; gap: 14px; }
.te-wrap .te-comment-card {
  background: #1c1c28; border: 1.5px solid #2a2a3d;
  border-radius: 8px; padding: 18px; animation: teSlideUp .3s ease;
}
.te-wrap .te-comment-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.te-wrap .te-comment-stars { color: #f5c842; font-size: 1rem; letter-spacing: 2px; }
.te-wrap .te-comment-overall { font-weight: 700; font-size: .88rem; color: #f5c842; }
.te-wrap .te-comment-date { margin-left: auto; font-size: .78rem; color: #7878a0; }
.te-wrap .te-comment-ratings { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.te-wrap .te-comment-crit {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.04); border: 1px solid #2a2a3d;
  border-radius: 6px; padding: 4px 9px;
}
.te-wrap .te-cc-label { font-size: .73rem; color: #7878a0; }
.te-wrap .te-cc-stars { font-size: .78rem; color: #f5c842; letter-spacing: 1px; }
.te-wrap .te-comment-text {
  font-size: .92rem; color: #e8e8f0; line-height: 1.6;
  border-left: 3px solid rgba(245,200,66,.4); padding-left: 14px;
  margin: 0; font-style: italic;
}

/* ── Spinner ──────────────────────────────────────────────── */
.te-wrap .te-loading { display: flex; justify-content: center; padding: 40px 0; }
.te-wrap .te-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid #2a2a3d; border-top-color: #f5c842;
  animation: teSpin .7s linear infinite;
}

/* ── Eval form fields ─────────────────────────────────────── */
.te-wrap .te-form .te-field { margin-bottom: 24px; }
.te-wrap .te-field label {
  display: block; font-size: .78rem; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  color: #7878a0; margin-bottom: 10px;
}
.te-wrap .te-optional { font-weight: 400; text-transform: none; letter-spacing: 0; }
.te-wrap .te-select-wrap { position: relative; }
.te-wrap .te-select-wrap select,
.te-wrap textarea {
  width: 100%; background: #1c1c28; color: #e8e8f0;
  border: 1.5px solid #2a2a3d; border-radius: 8px;
  padding: 12px 16px; font-family: inherit; font-size: 1rem;
  outline: none; transition: border-color .2s;
  box-sizing: border-box; -webkit-appearance: none; margin: 0;
}
.te-wrap .te-select-wrap select:focus,
.te-wrap textarea:focus { border-color: #f5c842; }
.te-wrap .te-select-wrap select option { background: #1c1c28; }
.te-wrap .te-chevron {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; stroke: #7878a0; stroke-width: 2;
  fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}

/* ── Teacher preview card ─────────────────────────────────── */
.te-wrap .te-teacher-card {
  display: flex; align-items: center; gap: 14px;
  background: #1c1c28; border: 1.5px solid #2a2a3d; border-radius: 8px;
  padding: 14px 18px; margin-bottom: 28px; animation: teSlideUp .3s ease;
}
.te-wrap .te-teacher-photo {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #f5c842, #f79d3c);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem; color: #0e0e14; font-weight: 700;
  overflow: hidden; flex-shrink: 0;
}
.te-wrap .te-teacher-photo img { width: 100%; height: 100%; object-fit: cover; }
.te-wrap .te-teacher-info strong { display: block; font-weight: 600; color: #e8e8f0; }
.te-wrap .te-teacher-info span { color: #7878a0; font-size: .9rem; }

/* ── Criteria grid ────────────────────────────────────────── */
.te-wrap .te-criteria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.te-wrap .te-criterion {
  background: #1c1c28; border: 1.5px solid #2a2a3d;
  border-radius: 8px; padding: 18px; transition: border-color .2s, transform .15s;
}
.te-wrap .te-criterion:hover { border-color: rgba(245,200,66,.35); transform: translateY(-2px); }
.te-wrap .te-criterion.te-rated { border-color: rgba(245,200,66,.55); }
.te-wrap .te-criterion-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.te-wrap .te-criterion-icon { font-size: 1.4rem; }
.te-wrap .te-criterion-label { font-weight: 600; font-size: .95rem; color: #e8e8f0; }

/* ── Stars ────────────────────────────────────────────────── */
.te-wrap .te-stars { display: flex; gap: 6px; }
.te-wrap .te-star { cursor: pointer; display: block; }
.te-wrap .te-star input { position: absolute; opacity: 0; pointer-events: none; }
.te-wrap .te-star svg {
  width: 32px; height: 32px;
  fill: #2a2a3d; stroke: #2a2a3d;
  transition: fill .15s, stroke .15s, transform .15s;
}
.te-wrap .te-star:hover svg,
.te-wrap .te-star.active svg { fill: #f5c842; stroke: #f5c842; }
.te-wrap .te-star:hover svg { transform: scale(1.2); }
.te-wrap .te-star-label { margin-top: 8px; min-height: 20px; }
.te-wrap .te-star-value { font-size: .82rem; color: #f5c842; font-weight: 600; }

/* ── Submit button ────────────────────────────────────────── */
.te-wrap .te-btn-submit {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, #f5c842, #f79d3c);
  color: #0e0e14; font-family: inherit; font-size: 1rem; font-weight: 700;
  border: none; border-radius: 8px; cursor: pointer;
  transition: opacity .2s, transform .15s; letter-spacing: .04em;
}
.te-wrap .te-btn-submit:hover { opacity: .9; transform: translateY(-1px); }
.te-wrap .te-btn-submit:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.te-wrap .te-btn-icon { font-size: 1.1rem; transition: transform .2s; }
.te-wrap .te-btn-submit:hover .te-btn-icon { transform: translateX(4px); }

/* ── Results header ───────────────────────────────────────── */
.te-wrap .te-results-header {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  margin-bottom: 28px; padding-bottom: 24px;
  border-bottom: 1.5px solid #2a2a3d;
}

/* ── Ranking ──────────────────────────────────────────────── */
.te-wrap .te-ranking-list { display: flex; flex-direction: column; gap: 12px; }
.te-wrap .te-rank-card {
  display: flex; align-items: center; gap: 16px;
  background: #1c1c28; border: 1.5px solid #2a2a3d;
  border-radius: 8px; padding: 16px 20px; transition: transform .15s;
}
.te-wrap .te-rank-card:hover { transform: translateX(4px); }
.te-wrap .te-top-1 { border-color: #f5c842; background: rgba(245,200,66,.06); }
.te-wrap .te-top-2 { border-color: #a8a8a8; background: rgba(168,168,168,.06); }
.te-wrap .te-top-3 { border-color: #cd7f32; background: rgba(205,127,50,.06); }
.te-wrap .te-rank-pos { font-size: 1.5rem; min-width: 40px; text-align: center; }
.te-wrap .te-rank-photo {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #f5c842, #f79d3c);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem; color: #0e0e14; overflow: hidden;
}
.te-wrap .te-rank-photo img { width: 100%; height: 100%; object-fit: cover; }
.te-wrap .te-rank-info { flex: 1; }
.te-wrap .te-rank-info strong { display: block; font-weight: 600; color: #e8e8f0; }
.te-wrap .te-rank-info span { color: #7878a0; font-size: .88rem; }
.te-wrap .te-rank-score { text-align: right; }
.te-wrap .te-rank-num { display: block; font-size: 1.5rem; font-weight: 700; color: #f5c842; line-height: 1; }
.te-wrap .te-mini-stars { color: #f5c842; letter-spacing: 2px; font-size: .85rem; }
.te-wrap .te-rank-evals { color: #7878a0; font-size: .78rem; }

/* ── Alert ────────────────────────────────────────────────── */
.te-wrap .te-alert {
  margin-top: 16px; padding: 14px 18px;
  border-radius: 8px; font-weight: 500; animation: teSlideUp .3s ease;
}
.te-wrap .te-alert-success {
  background: rgba(76,175,130,.15);
  border: 1.5px solid rgba(76,175,130,.4);
  color: #4caf82;
}
.te-wrap .te-alert-error {
  background: rgba(224,92,110,.15);
  border: 1.5px solid rgba(224,92,110,.4);
  color: #e05c6e;
}

/* ── Misc ─────────────────────────────────────────────────── */
.te-wrap .te-notice { color: #7878a0; text-align: center; padding: 32px 0; font-size: .95rem; }
.te-hidden { display: none !important; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes teSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes teSpin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .te-wrap { padding: 22px 16px; }
  .te-wrap .te-uni-grid,
  .te-wrap .te-teachers-grid,
  .te-wrap .te-criteria-grid { grid-template-columns: 1fr; }
  .te-wrap .te-bar-row { grid-template-columns: 110px 1fr 34px; }
  .te-wrap .te-profile-header,
  .te-wrap .te-results-header { flex-direction: column; }
  .te-wrap .te-overall-badge { margin-left: 0; width: 100%; }
  .te-wrap .te-cc-label { display: none; }
}
