/* css/proyector.css - Estilos del Gran Marcador para Proyector y Pantallas */

.proyector-body {
  padding: 20px 32px 90px 32px;
  position: relative;
  min-height: 100vh;
}

/* Header Superior */
.proyector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.school-crest,
.school-logo-img,
.school-heraldic-crest {
  height: 68px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 16px rgba(251, 191, 36, 0.45));
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.school-heraldic-crest:hover,
.school-logo-img:hover {
  transform: scale(1.08);
}

.header-titles h1 {
  font-size: 1.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.1;
}

.header-titles .subtitle {
  font-size: 0.9rem;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-clock-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #f8fafc;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  animation: ticker-pulse 1.5s infinite;
}

/* Barra de Filtros y Vistas */
.controls-bar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.pills-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
}

.pill-btn {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pill-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.pill-btn.active {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(217, 119, 6, 0.35));
  color: #fef08a;
  border: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.2);
}

/* Categorías pills */
.category-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  background: rgba(18, 24, 40, 0.6);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.cat-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.cat-pill.active {
  background: var(--cat-accent, var(--gold));
  color: #090d16;
  font-weight: 700;
  border-color: transparent;
  box-shadow: 0 0 20px var(--cat-glow, rgba(251, 191, 36, 0.4));
}

/* SECCIÓN DEL PODIO (TOP 3) */
.podium-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 24px;
  margin: 10px auto 40px auto;
  max-width: 950px;
  padding: 20px 10px;
}

.podium-slot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.podium-slot.rank-1 {
  order: 2;
  z-index: 3;
}
.podium-slot.rank-2 {
  order: 1;
  z-index: 2;
}
.podium-slot.rank-3 {
  order: 3;
  z-index: 1;
}

.podium-crown {
  font-size: 2.4rem;
  margin-bottom: -10px;
  z-index: 4;
  filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.8));
}

.podium-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 16px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--house-grad, linear-gradient(180deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%));
  border: 2px solid var(--house-border, var(--border-glass));
  border-bottom: none;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.podium-slot.rank-1 .podium-card {
  border-color: var(--gold);
  box-shadow: 0 -10px 35px rgba(251, 191, 36, 0.35), inset 0 0 30px rgba(251, 191, 36, 0.15);
}

.podium-slot.rank-2 .podium-card {
  border-color: var(--silver);
  box-shadow: 0 -10px 25px rgba(203, 213, 225, 0.2);
}

.podium-slot.rank-3 .podium-card {
  border-color: var(--bronze);
  box-shadow: 0 -10px 25px rgba(217, 119, 6, 0.2);
}

.podium-shield {
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}

.podium-slot.rank-1 .podium-shield {
  width: 88px;
  height: 88px;
}

.podium-house-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.podium-slot.rank-1 .podium-house-name {
  font-size: 1.45rem;
  color: #fef08a;
}

.podium-grade-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.podium-points {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
}

.podium-slot.rank-1 .podium-points {
  font-size: 2.8rem;
  color: #fbbf24;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.8);
}

.podium-pts-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

/* El pedestal numérico */
.podium-pedestal {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  border: 2px solid var(--house-border, var(--border-glass));
  border-top: none;
}

.podium-slot.rank-1 .podium-pedestal {
  height: 110px;
  background: linear-gradient(180deg, #d97706 0%, #78350f 100%);
  color: #fef08a;
  border-color: var(--gold);
}

.podium-slot.rank-2 .podium-pedestal {
  height: 80px;
  background: linear-gradient(180deg, #475569 0%, #1e293b 100%);
  color: #f1f5f9;
  border-color: var(--silver);
}

.podium-slot.rank-3 .podium-pedestal {
  height: 60px;
  background: linear-gradient(180deg, #92400e 0%, #451a03 100%);
  color: #fef3c7;
  border-color: var(--bronze);
}

/* GRID DE CASAS (ESTANDARTES Y RELOJES DE PUNTOS) */
.houses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.house-card {
  background: rgba(18, 24, 40, 0.75);
  backdrop-filter: blur(14px);
  border: 1.5px solid var(--house-border, var(--border-glass));
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.house-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--house-color, var(--gold));
  box-shadow: 0 0 12px var(--house-color, var(--gold));
}

.house-card:hover {
  transform: translateY(-4px);
  border-color: var(--house-color, var(--gold));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--house-glow, rgba(251, 191, 36, 0.2));
}

.house-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.house-info-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.house-shield-mini {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.house-title-group h3 {
  font-size: 1.25rem;
  margin-bottom: 2px;
}

.house-scientist-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.house-rank-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
}

.house-rank-badge.top-1 {
  background: var(--gold);
  color: #090d16;
  box-shadow: 0 0 14px var(--gold);
}
.house-rank-badge.top-2 {
  background: var(--silver);
  color: #090d16;
}
.house-rank-badge.top-3 {
  background: var(--bronze);
  color: #fff;
}

/* Contador Principal de la Tarjeta */
.house-score-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.house-main-score {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  color: #f8fafc;
}

.house-progress-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--house-color, #3b82f6), var(--house-accent, #60a5fa));
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 10px var(--house-color, #3b82f6);
}

/* Desglose de Categorías en Tarjeta */
.house-categories-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cat-item-micro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.cat-item-micro span {
  color: var(--text-muted);
}

.cat-item-micro strong {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* VISTA COPA DE LECTURA (Estantería Especial) */
.reading-cup-view {
  background: rgba(18, 24, 40, 0.85);
  border: 1.5px solid rgba(59, 130, 246, 0.4);
  border-radius: var(--radius-xl);
  padding: 30px;
  margin-bottom: 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(59, 130, 246, 0.2);
}

.reading-header {
  text-align: center;
  margin-bottom: 30px;
}

.reading-header h2 {
  font-size: 2rem;
  color: #93c5fd;
  margin-bottom: 6px;
}

.bookshelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.bookshelf-house-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--house-border, var(--border-glass));
  border-radius: var(--radius-lg);
  padding: 20px;
}

.bookshelf-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.virtual-shelf {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 70px;
  padding: 6px 12px;
  background: linear-gradient(180deg, #451a03 0%, #291002 100%);
  border-radius: var(--radius-sm);
  border-bottom: 6px solid #78350f;
  overflow-x: auto;
  margin-bottom: 12px;
}

.virtual-book {
  width: 14px;
  height: var(--book-h, 50px);
  background: var(--book-color, #3b82f6);
  border-radius: 2px;
  box-shadow: 1px 0 3px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease;
}

.virtual-book:hover {
  transform: translateY(-8px) scale(1.1);
}

.books-count-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
}

.books-big-number {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: #60a5fa;
}

/* TICKER INFERIOR EN DIRECTO */
.live-ticker-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(11, 17, 32, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(251, 191, 36, 0.3);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.ticker-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-right: 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.ticker-marquee {
  flex: 1;
  overflow: hidden;
  position: relative;
  white-space: nowrap;
  padding-left: 20px;
}

.ticker-marquee:hover .ticker-content {
  animation-play-state: paused;
}

.ticker-content {
  display: inline-block;
  font-size: 0.95rem;
  color: var(--text-main);
  animation: ticker-slide 50s linear infinite;
}

@keyframes ticker-slide {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.ticker-item-span {
  margin-right: 48px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.01em;
}

.ticker-item-span strong {
  color: var(--gold);
  font-weight: 700;
}

.ticker-item-span .ticker-pts {
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
}

.ticker-item-span .ticker-pts.pos {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.ticker-item-span .ticker-pts.neg {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* MODAL DE DETALLE DE CASA */
.house-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 7, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.house-modal-content {
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 32px 28px;
  border: 2px solid var(--modal-house-color, var(--gold));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 35px var(--modal-house-color, rgba(251, 191, 36, 0.3));
  border-radius: var(--radius-xl);
  animation: modalScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-close-modal {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-close-modal:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalScale {
  from { transform: scale(0.92) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* RESPONSIVE MÓVIL PARA ALUMNOS / PANTALLA ESTRECHA */
@media (max-width: 768px) {
  .proyector-body {
    padding: 14px 14px 80px 14px;
  }

  .proyector-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .header-titles h1 {
    font-size: 1.4rem;
  }

  .podium-container {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .podium-slot {
    width: 100%;
    order: unset !important;
  }

  .podium-pedestal {
    height: 40px !important;
    font-size: 1.5rem;
  }

  .houses-grid {
    grid-template-columns: 1fr;
  }
}
