/* ═══════════════════════════════════════════════════════════════════════════════
   MAIN APP
   ═══════════════════════════════════════════════════════════════════════════════ */

.topbar {
  background: linear-gradient(90deg, var(--red-dark), var(--red) 50%, var(--red-dark));
  color: rgba(255,255,255,.92);
  font-size: .67rem; font-weight: 700; letter-spacing: .18em;
  text-align: center; padding: 7px 16px; text-transform: uppercase;
}

/* STICKY CHROME — single sticky container for all top banners + header + nav */
.sticky-chrome {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* STUDENT MODE SIMULATION BANNER */
.sim-banner {
  background: linear-gradient(90deg, #2a1500, #3d2000, #2a1500);
  border-bottom: 1px solid rgba(251,146,60,.3);
  padding: 7px 24px;
}
[data-theme="light"] .sim-banner {
  background: linear-gradient(90deg, #fff7ed, #ffedd5, #fff7ed);
  border-bottom: 1px solid rgba(234,88,12,.25);
}
.sim-banner-inner {
  max-width: 1140px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.sim-banner-label {
  display: flex; align-items: center; gap: 7px;
  font-size: .72rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(251,146,60,.9);
}
[data-theme="light"] .sim-banner-label { color: #c2410c; }
.sim-banner-exit {
  background: rgba(251,146,60,.12); color: rgba(251,146,60,.9);
  border: 1px solid rgba(251,146,60,.3); border-radius: 6px;
  padding: 4px 14px; font-size: .78rem; font-weight: 600;
  cursor: pointer; transition: all .18s; white-space: nowrap;
}
.sim-banner-exit:hover { background: rgba(251,146,60,.22); }
[data-theme="light"] .sim-banner-exit { background: rgba(234,88,12,.08); color: #c2410c; border-color: rgba(234,88,12,.25); }
[data-theme="light"] .sim-banner-exit:hover { background: rgba(234,88,12,.15); }
.sim-teacher-btn {
  display: flex; align-items: center; gap: 6px;
  font-size: .78rem; padding: 5px 12px;
  background: var(--surface-1); flex-shrink: 0;
}

/* EVENT BANNER */
.event-banner {
  background: linear-gradient(90deg, #071200, #122800, #071200);
  border-bottom: 1px solid rgba(34,197,94,.2);
}
[data-theme="light"] .event-banner { background: linear-gradient(90deg, #0a2000, #1a4800, #0a2000); }
.event-banner-inner { max-width: 1140px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.event-banner-left  { display: flex; align-items: center; gap: 12px; min-width: 0; }
.event-pulse { position: relative; display: block; width: 9px; height: 9px; background: var(--green); border-radius: 50%; flex-shrink: 0; }
.event-pulse::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; background: rgba(34,197,94,.28); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(2.2);opacity:0} }
.event-label { font-size: .62rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.4); display: block; line-height: 1; margin-bottom: 3px; }
.event-name  { color: #a8f0a0; font-size: .9rem; font-weight: 600; }
.event-desc  { color: rgba(255,255,255,.4); font-size: .84rem; }
.event-banner-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.event-mult-badge { background: var(--green-dim); color: var(--green); font-family: 'Bebas Neue', sans-serif; font-size: 1.25rem; letter-spacing: .06em; padding: 3px 14px; border-radius: 20px; border: 1px solid rgba(34,197,94,.25); }
.event-timer-wrap { display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.45); }
.event-timer { font-variant-numeric: tabular-nums; font-size: .9rem; font-weight: 700; letter-spacing: .08em; color: rgba(255,255,255,.7); }
@media (max-width: 480px) {
  .event-desc { display: none; }
  .event-banner-inner { padding: 8px 14px; }
}

/* HEADER — translucent glass over scrolling content */
header {
  background: color-mix(in srgb, var(--surface-1) 76%, transparent);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
}
header::after {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg width='48' height='48' viewBox='0 0 48 48' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 2 L46 24 L24 46 L2 24 Z' fill='none' stroke='rgba(200,16,46,0.06)' stroke-width='1'/%3E%3C/svg%3E");
}
.header-inner {
  max-width: 1140px; margin: 0 auto;
  padding: 14px 20px;
  display: flex; align-items: center; gap: 14px;
  position: relative; z-index: 1;
}
.logo-block {
  flex-shrink: 0; width: 46px; height: 46px; background: var(--grad-red);
  border-radius: 11px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px var(--red-glow);
  animation: logoBreath 4.5s ease-in-out infinite;
}
@keyframes logoBreath {
  0%, 100% { box-shadow: 0 0 16px var(--red-glow); }
  50%      { box-shadow: 0 0 30px var(--red-glow), 0 0 50px rgba(220,30,70,.14); }
}
.logo-block svg { width: 28px; height: 28px; }
.header-text { min-width: 0; flex: 1; }
.header-text h1 { font-family: 'Bebas Neue', sans-serif; font-size: 1.55rem; color: var(--text-1); line-height: 1; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-text p  { font-size: .68rem; color: var(--text-3); letter-spacing: .16em; text-transform: uppercase; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* REG CODE CHIP */
.reg-code-chip {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; cursor: default;
}
.reg-code-chip svg { color: var(--text-3); flex-shrink: 0; }
.reg-code-value {
  font-family: 'Inter', monospace; font-size: .95rem; font-weight: 700;
  letter-spacing: 0.2em; color: var(--text-1);
}
.reg-code-timer {
  font-size: .7rem; color: var(--text-3); min-width: 28px; text-align: right;
}

@media (max-width: 600px) { .reg-code-chip { display: none !important; } }

/* USER CHIP */
.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 30px; padding: 5px 8px 5px 10px;
  transition: border-color .2s; flex-shrink: 0;
}
.user-chip:hover { border-color: var(--border-hi); }
.user-chip-house { width: 24px; height: 24px; font-size: 1.2rem; line-height: 1; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.user-chip-info  { display: flex; flex-direction: column; }
.user-chip-name  { font-size: .8rem; font-weight: 600; color: var(--text-1); line-height: 1.2; }
.user-chip-role  { font-size: .66rem; color: var(--text-3); }
.user-chip-logout {
  background: var(--surface-3); border: none; color: var(--text-3);
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .2s;
}
.user-chip-logout:hover { background: var(--red); color: white; }

/* Guest "Iniciar sesión" — replaces the user chip when logged out */
.guest-login-btn {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 30px; padding: 8px 14px; cursor: pointer;
  font-size: .82rem; font-weight: 600; color: var(--text-1);
  transition: border-color .2s, background .2s;
}
.guest-login-btn:hover { border-color: var(--border-hi); background: var(--surface-3); }

@media (max-width: 600px) {
  .user-chip-info { display: none; }
  .header-text p  { display: none; }
  .header-text h1 { font-size: 1.25rem; }
  .header-inner   { gap: 10px; padding: 12px 16px; }
}

/* NOTIFICATION BELL */
.notif-bell {
  position: relative; flex-shrink: 0;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color .2s, color .2s, background .2s;
}
.notif-bell:hover { border-color: var(--border-hi); color: var(--text-1); }
.notif-bell[aria-expanded="true"] { border-color: var(--border-hi); color: var(--text-1); background: var(--surface-3); }
.notif-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 10px;
  background: var(--red); color: #fff; font-size: .62rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  border: 2px solid var(--surface-1);
}
.notif-badge[hidden] { display: none; }

/* NOTIFICATION PANEL (fixed dropdown — positioned under the bell via JS) */
.notif-panel {
  position: fixed; z-index: 150;
  width: 340px; max-width: calc(100vw - 24px);
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-card), 0 18px 50px rgba(0,0,0,.35);
  overflow: hidden; display: flex; flex-direction: column;
  animation: notifPop .18s ease;
}
.notif-panel[hidden] { display: none; }
@keyframes notifPop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.notif-panel-title { font-size: .82rem; font-weight: 700; color: var(--text-1); letter-spacing: .02em; }
.notif-mark-all {
  background: none; border: none; color: var(--text-3); font-size: .68rem; font-weight: 600;
  cursor: pointer; padding: 2px 4px; transition: color .2s; white-space: nowrap;
}
.notif-mark-all:hover { color: var(--red); }
.notif-list { overflow-y: auto; max-height: min(440px, 70vh); }

.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s; position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: color-mix(in srgb, var(--red) 7%, transparent); }
.notif-item.unread:hover { background: color-mix(in srgb, var(--red) 12%, transparent); }
.notif-item-icon {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px;
  background: var(--surface-3); color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
}
.notif-item.unread .notif-item-icon { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.notif-item-main { flex: 1; min-width: 0; }
.notif-item-title { font-size: .79rem; font-weight: 600; color: var(--text-1); line-height: 1.25; }
.notif-item.unread .notif-item-title::after {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 6px;
  border-radius: 50%; background: var(--red); vertical-align: middle;
}
.notif-item-text { font-size: .73rem; color: var(--text-2); line-height: 1.3; margin-top: 2px; word-break: break-word; }
.notif-item-time { font-size: .65rem; color: var(--text-3); margin-top: 3px; }
.notif-item-del {
  flex-shrink: 0; background: none; border: none; color: var(--text-3);
  width: 22px; height: 22px; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.notif-item-del:hover { background: var(--surface-3); color: var(--red); }
.notif-empty { padding: 32px 16px; text-align: center; color: var(--text-3); font-size: .78rem; }

/* MAIN */
main { max-width: 1140px; margin: 0 auto; padding: 28px 16px 80px; }
@media (min-width: 600px) { main { padding: 36px 24px 80px; } }

/* SECTION LABEL */
.section-label { font-size: .66rem; font-weight: 800; letter-spacing: .24em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; display: flex; align-items: center; gap: 12px; }
.section-label::before { content: ''; width: 18px; height: 2px; border-radius: 2px; background: var(--grad-red); }
.section-label::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }

