/* ═══════════════════════════════════════════════════════
   Palermo Sounder Lab — Portal Design System
   Premium dark theme with cinematic aesthetics & glassmorphism
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Bebas+Neue&display=swap');

/* ── CSS Variables ──────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-primary: #050508;
  --bg-secondary: #0c0c12;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --bg-glass: rgba(18, 18, 26, 0.45);
  --bg-glass-border: rgba(255, 255, 255, 0.08);
  
  /* Text colors */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-muted: rgba(255, 255, 255, 0.4);
  
  /* Accent branding colors */
  --accent-primary: #f97316; /* Safety Orange to match the logo */
  --accent-secondary: #d4af37; /* Cinematic Gold */
  --accent-glow: rgba(249, 115, 22, 0.2);
  --accent-gradient: linear-gradient(135deg, #f97316 0%, #d4af37 100%);
  
  /* Subject colors */
  --color-arte: #E84393;
  --color-biologia: #00B894;
  --color-fisica: #6C5CE7;
  --color-geografia: #0984E3;
  --color-historia: #D63031;
  --color-matematica: #FDCB6E;
  --color-tecnologia: #00CEC9;
  --color-visuales: #A29BFE;
  
  /* Layout borders */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Standard smooth transition speeds */
  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
  --transition-fast: 0.2s var(--ease-out);
  --transition-normal: 0.35s var(--ease-out);
  --transition-slow: 0.6s var(--ease-out);
}

/* ── Reset & Base ──────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Cinematic Ambient Background (Flares) ────────── */
.cinematic-bg-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.flare-1 {
  position: absolute;
  top: -10%;
  left: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.08) 0%, transparent 70%);
  filter: blur(80px);
  animation: floatLight1 20s ease-in-out infinite alternate;
}

.flare-2 {
  position: absolute;
  bottom: -15%;
  right: -10%;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.06) 0%, transparent 70%);
  filter: blur(90px);
  animation: floatLight2 25s ease-in-out infinite alternate;
}

.flare-3 {
  position: absolute;
  top: 40%;
  left: 20%;
  width: 45%;
  height: 45%;
  background: radial-gradient(circle, rgba(214, 48, 49, 0.04) 0%, transparent 70%);
  filter: blur(80px);
}

@keyframes floatLight1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(6%, 4%) scale(1.1); }
}

@keyframes floatLight2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-5%, -5%) scale(1.05); }
}

/* ══════════════════════════════════════════════════════
   CINEMATIC ACCESS / LOGIN & REGISTER
   ══════════════════════════════════════════════════════ */

.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 3rem 1.5rem;
  position: relative;
  z-index: 1;
}

.login-card-container {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Brand Header & Frosted Logo Backdrop Container */
.login-brand-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-backdrop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.15);
  margin-bottom: 1.5rem;
  transition: all 0.4s var(--ease-out);
  width: 116px;
  height: 116px;
  cursor: pointer;
}

.logo-backdrop:hover {
  transform: scale(1.05) rotate(1deg);
  border-color: var(--accent-primary);
  box-shadow: 0 25px 45px var(--accent-glow);
}

.portal-main-logo {
  max-height: 80px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}

.portal-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.portal-title span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 400;
}

.portal-tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Sliding tab card details */
.form-slide-card {
  width: 100%;
  background: var(--bg-glass);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-xl);
  padding: 2.75rem 2.25rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.5s var(--ease-out), border-color 0.3s;
}

.form-slide-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

/* Form Tabs Toggle */
.form-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.tab-btn {
  flex: 1;
  padding: 0.65rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Form transition layouts */
.auth-form {
  display: none;
  animation: authFormIn 0.5s var(--ease-out) both;
}

.auth-form.active {
  display: block;
}

@keyframes authFormIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.form-group input {
  width: 100%;
  padding: 0.95rem 1.15rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-fast);
}

.form-group input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
  background: rgba(0, 0, 0, 0.35);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

/* Auth Buttons */
.btn-submit {
  width: 100%;
  padding: 1rem;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.25);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(249, 115, 22, 0.4);
}

.btn-submit:active {
  transform: translateY(0);
  filter: brightness(0.88);
}

/* Spinner Loaders */
.btn-submit.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-submit.loading .btn-text {
  display: none;
}

.btn-submit.loading .btn-loader {
  display: block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btnSpinner 0.6s linear infinite;
}

@keyframes btnSpinner {
  to { transform: rotate(360deg); }
}

.auth-error-msg {
  background: rgba(214, 48, 49, 0.12);
  border: 1px solid rgba(214, 48, 49, 0.25);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #ff7675;
  margin-bottom: 1.5rem;
  display: none;
  animation: formShake 0.4s var(--ease-out);
}

.auth-error-msg.visible {
  display: block;
}

@keyframes formShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.login-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════
   PORTAL CATALOG HEADER & WRAPPER
   ══════════════════════════════════════════════════════ */

.app-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 5, 8, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--bg-glass-border);
  padding: 0 3rem;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-primary);
}

/* Glass backdrop for header logo so ANY logo fits perfectly */
.logo-header-backdrop {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 5px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 40px;
  height: 40px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: all 0.3s;
}

.header-brand:hover .logo-header-backdrop {
  transform: scale(1.05) rotate(2deg);
  border-color: var(--accent-primary);
}

.portal-header-logo {
  max-height: 26px;
  width: auto;
  object-fit: contain;
}

.header-brand h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-brand h2 span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 400;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: white;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

.btn-logout {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.95rem;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-logout:hover {
  background: rgba(214, 48, 49, 0.15);
  border-color: rgba(214, 48, 49, 0.3);
  color: #ff7675;
}

/* ══════════════════════════════════════════════════════
   NETFLIX-STYLE DYNAMIC CINEMATIC HERO SPOTLIGHT
   ══════════════════════════════════════════════════════ */

.cinema-hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 4rem;
  margin: 2rem auto;
  max-width: 1340px;
  min-height: 440px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #08080c;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
  transition: border-color var(--transition-slow);
}

/* Video backdrop — reemplaza la imagen cuando el lab tiene videoPreview */
.cinema-video-backdrop {
  position: absolute;
  right: 0;
  top: 0;
  width: 65%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  animation: kenBurns 28s ease-in-out infinite;
}

.cinema-video-backdrop.active {
  opacity: 1;
}

/* Gradient overlay encima del video (igual al de la imagen) */
.cinema-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #08080c 40%, rgba(8, 8, 12, 0.65) 65%, rgba(8, 8, 12, 0.15) 100%);
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.cinema-video-overlay.active {
  opacity: 1;
}

/* Dramatic widescreen gradients overlays */
.cinema-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
  transition: opacity 0.25s ease;
  z-index: 1;
  pointer-events: none;
  animation: kenBurns 28s ease-in-out infinite;
}

.cinema-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, transparent 20%, #08080c 90%);
  z-index: 1;
  pointer-events: none;
}

.cinema-glow {
  position: absolute;
  inset: 0;
  transition: background var(--transition-slow);
  z-index: 0;
  pointer-events: none;
}

.cinema-content {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

/* Dynamic text transition class */
.cinema-fade-active {
  animation: cinemaTransition 0.5s cubic-bezier(0.25, 1, 0.5, 1) both;
}

@keyframes cinemaTransition {
  0% { opacity: 0; transform: translateY(12px) scale(0.99); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes kenBurns {
  0% { transform: scale(1.0); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1.0); }
}

.cinema-materia-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  padding: 0.35rem 0.95rem;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.3);
  transition: all var(--transition-normal);
}

.cinema-project-title {
  font-size: 2.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: #ffffff;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
}

.cinema-project-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
  margin-bottom: 1.85rem;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  max-width: 550px;
}

.cinema-project-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2.25rem;
}

.cinema-project-tags .tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.7rem;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.btn-cinema-play {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.85rem;
  background: #ffffff;
  color: #000000;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 25px rgba(255, 255, 255, 0.1);
  transition: all var(--transition-fast);
}

.btn-cinema-play:hover {
  transform: scale(1.04) translateY(-2px);
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 8px 30px rgba(249, 115, 22, 0.4);
}

/* Portal Widescreen Stats overlay */
.catalog-stats {
  position: absolute;
  bottom: 2rem;
  right: 3rem;
  display: flex;
  gap: 2.5rem;
  z-index: 2;
}

.stat-item {
  text-align: right;
}

.stat-number {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.1rem;
}

/* ── SEARCH AND CONTROLS BAR ───────────────────────── */
.controls-section {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Search block */
.search-container {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 1.05rem 1.25rem 1.05rem 3rem;
  background: rgba(18, 18, 26, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: all var(--transition-normal);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.25), 0 1px 0 rgba(255, 255, 255, 0.05);
}

.search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 25px rgba(249, 115, 22, 0.15), inset 0 2px 4px rgba(0,0,0,0.25);
  background: rgba(18, 18, 26, 0.55);
}

.search-icon {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

/* Filter pills */
.filter-bar {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 100px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateY(-1px);
}

.filter-pill.active {
  background: color-mix(in srgb, var(--materia-color, var(--accent-primary)) 12%, transparent);
  border-color: color-mix(in srgb, var(--materia-color, var(--accent-primary)) 40%, transparent);
  color: #ffffff;
  box-shadow: 0 4px 15px color-mix(in srgb, var(--materia-color, var(--accent-primary)) 15%, transparent);
}

.filter-pill .pill-icon {
  font-size: 0.95rem;
}

.pill-dots-loading {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin-right: 2px;
}

.pill-dots-loading span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.pill-dots-loading .dot-1 {
  animation: dotColorCycle 6s linear infinite;
}

.pill-dots-loading .dot-2 {
  animation: dotColorCycle 6s linear infinite;
  animation-delay: -2s;
}

.pill-dots-loading .dot-3 {
  animation: dotColorCycle 6s linear infinite;
  animation-delay: -4s;
}

@keyframes dotColorCycle {
  0%, 100% { background-color: var(--color-arte); }
  12.5%    { background-color: var(--color-biologia); }
  25%      { background-color: var(--color-fisica); }
  37.5%    { background-color: var(--color-geografia); }
  50%      { background-color: var(--color-historia); }
  62.5%    { background-color: var(--color-matematica); }
  75%      { background-color: var(--color-tecnologia); }
  87.5%    { background-color: var(--color-visuales); }
}

/* ── SUBJECT GRID SECTIONS ─────────────────────────── */
.catalog-content {
  padding: 1.5rem 2rem;
  max-width: 1340px;
  margin: 0 auto;
}

.subject-section {
  margin-bottom: 1.5rem;
  animation: sectionIn 0.8s var(--ease-out) both;
}

@keyframes sectionIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.subject-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.subject-icon {
  font-size: 1.35rem;
}

.subject-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.subject-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Cards grids */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-card:hover {
  background: var(--bg-card-hover);
  border-color: color-mix(in srgb, var(--card-accent) 55%, transparent);
  transform: translateY(-6px) scale(1.015);
  box-shadow: 
    0 20px 45px rgba(0, 0, 0, 0.6),
    0 0 25px color-mix(in srgb, var(--card-accent) 22%, transparent);
}

.project-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--accent-gradient));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.project-card:hover::after {
  opacity: 1;
}

.card-thumbnail {
  width: 100%;
  height: 150px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.75rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.5s ease;
}

/* Glassmorphism badge overlay for subject icon on top of custom preview images */
.card-thumbnail-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  background: rgba(8, 8, 12, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.card-thumbnail::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, var(--bg-primary) 100%);
  opacity: 0.8;
}

.card-body {
  padding: 1.25rem;
  flex-grow: 1;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  color: #ffffff;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  background: rgba(0, 0, 0, 0.1);
}

.card-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.card-action {
  font-size: 0.8rem;
  color: var(--accent-primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0;
  transform: translateX(-6px);
  transition: all var(--transition-fast);
}

.project-card:hover .card-action {
  opacity: 1;
  transform: translateX(0);
}

/* No results */
.no-results {
  text-align: center;
  padding: 4rem;
  color: var(--text-muted);
}

.no-results .nr-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 1rem;
}

/* ── VIEWPORT PLAYER OVERLAY ───────────────────────── */
.viewer-wrapper {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.viewer-header {
  background: rgba(5, 5, 8, 0.95);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--bg-glass-border);
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.viewer-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.12);
}

.viewer-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.breadcrumb-sep {
  color: var(--text-muted);
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 600;
}

.viewer-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.viewer-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00b894;
  animation: statusPulse 2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(0, 184, 148, 0.4);
}

@keyframes statusPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.6; }
}

.viewer-status-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.viewer-creator {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.75;
  margin-right: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.viewer-frame-wrapper {
  flex: 1;
  position: relative;
  background: #000000;
}

.viewer-frame-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.viewer-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 10;
  transition: opacity 0.5s ease;
}

.viewer-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.1);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE DESIGN SCREEN OVERRIDES
   ══════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .cinema-hero {
    margin: 1rem;
    padding: 4rem 2.5rem;
    min-height: 400px;
  }

  .cinema-project-title {
    font-size: 2.25rem;
  }

  .catalog-stats {
    display: none; /* Hide stats inside banner on medium viewports to gain space */
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 0 1.5rem;
    height: 64px;
  }

  .header-brand h2 {
    font-size: 0.95rem;
  }

  .header-brand span {
    display: none;
  }

  .cinema-hero {
    padding: 3rem 1.5rem;
    min-height: 320px;
  }

  .cinema-project-title {
    font-size: 1.85rem;
  }

  .cinema-project-desc {
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
  }

  .cinema-project-tags {
    margin-bottom: 1.5rem;
  }

  .controls-section {
    padding: 0 1rem;
  }

  .catalog-content {
    padding: 2rem 1rem;
  }

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

  .filter-bar {
    justify-content: flex-start;
    flex-wrap: nowrap;
  }

  .viewer-header {
    padding: 0 1rem;
  }

  .viewer-breadcrumb {
    font-size: 0.75rem;
  }

  .viewer-creator {
    display: none;
  }

  .card-action {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 480px) {
  .form-slide-card {
    padding: 2rem 1.5rem;
  }

  .user-badge .user-name {
    display: none;
  }

  .cinema-hero {
    margin: 0.5rem;
    padding: 2rem 1rem;
    border-radius: var(--radius-lg);
  }

  .cinema-project-title {
    font-size: 1.5rem;
  }

  .btn-cinema-play {
    width: 100%;
    justify-content: center;
  }
}

/* ═══════════════════════════════════════════════════════
   CINEMATIC V2 — 3D PREMIUM LOGIN ANIMATIONS
   Arte • Música • Tecnología — Palermo Sounder Lab
   ═══════════════════════════════════════════════════════ */

/* ── Logo Float Wrapper ─────────────────────────────── */
.logo-float-wrapper {
  display: inline-block;
  margin-bottom: 1.5rem;
  animation:
    wrapperEntrance 1s var(--ease-out) both,
    logoFloat 5s ease-in-out 1.4s infinite alternate;
}

@keyframes wrapperEntrance {
  from {
    opacity: 0;
    transform: translateY(-24px) scale(0.7);
    filter: blur(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes logoFloat {
  from { transform: translateY(0px); }
  to   { transform: translateY(-13px); }
}

/* Glow pulse — solo en el backdrop, sin conflicto de transform */
.logo-float-wrapper .logo-backdrop {
  margin-bottom: 0;
  animation: logoPulse 3.5s ease-in-out 2.2s infinite;
}

@keyframes logoPulse {
  0%, 100% {
    box-shadow:
      0 20px 40px rgba(0, 0, 0, 0.5),
      inset 0 2px 4px rgba(255, 255, 255, 0.15),
      0 0 0px 0px rgba(249, 115, 22, 0);
  }
  50% {
    box-shadow:
      0 20px 40px rgba(0, 0, 0, 0.5),
      inset 0 2px 4px rgba(255, 255, 255, 0.2),
      0 0 45px 6px rgba(249, 115, 22, 0.28),
      0 0 90px 12px rgba(212, 175, 55, 0.09);
  }
}

/* ── Portal Brand Block ──────────────────────────────── */
.portal-brand {
  text-align: center;
  margin-bottom: 0.4rem;
}

.portal-display-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3.6rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: #ffffff;
  line-height: 1;
  display: block;
  perspective: 600px;
  text-shadow: 0 6px 30px rgba(249, 115, 22, 0.15);
}

/* Character 3D entrance — applied per-letter via JS */
.pt-char {
  display: inline-block;
  animation: charReveal3D 0.55s var(--ease-out) both;
  animation-delay: calc(var(--char-i) * 0.038s + 0.18s);
}

@keyframes charReveal3D {
  from {
    opacity: 0;
    transform: translateY(20px) rotateX(-80deg);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
    filter: blur(0);
  }
}

/* "— Lab —" shimmer line */
.portal-lab-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 0.3rem;
  animation: labLineIn 0.7s var(--ease-out) 0.75s both;
}

@keyframes labLineIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lab-dash {
  color: rgba(255, 255, 255, 0.18);
  font-size: 0.75rem;
  font-weight: 300;
}

.lab-word {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.52em;
  text-transform: uppercase;
  background: linear-gradient(
    90deg,
    var(--accent-primary)  0%,
    var(--accent-secondary) 35%,
    #ffffff                50%,
    var(--accent-secondary) 65%,
    var(--accent-primary)  100%
  );
  background-size: 220% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerLab 4s linear 2.5s infinite;
}

@keyframes shimmerLab {
  from { background-position: 120% center; }
  to   { background-position: -120% center; }
}

/* ── Tagline entrance ────────────────────────────────── */
.portal-tagline {
  animation: taglineIn 0.7s var(--ease-out) 1s both;
}

@keyframes taglineIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Form card entrance ──────────────────────────────── */
.form-slide-card {
  animation: cardEntrance 0.95s var(--ease-out) 0.35s both;
}

@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(28px) scale(0.965); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── 3D Tilt Container ───────────────────────────────── */
.login-card-container {
  transform-style: preserve-3d;
  will-change: transform;
}

/* ── Cinema Hero Progress Bar ────────────────────────── */
.cinema-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  z-index: 4;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  overflow: hidden;
}

.cinema-progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  width: 0%;
}

@keyframes progressFill {
  from { width: 0%; }
  to   { width: 100%; }
}

/* ═══════════════════════════════════════════════════════
   CATALOG V2 — SPOTLIGHT, ICONOGRAFÍA & PORTAL
   ═══════════════════════════════════════════════════════ */

/* ── Subject SVG Icons ───────────────────────────────── */
.subject-svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.subject-svg-icon svg {
  width: 100%;
  height: 100%;
}

/* ── Spotlight Cursor Glow (materia-accent) ───────────── */
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    320px circle at var(--sx, 50%) var(--sy, 50%),
    color-mix(in srgb, var(--card-accent, var(--accent-primary)) 16%, transparent),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.project-card:hover::before {
  opacity: 1;
}

/* ── Card video thumbnail — aparece en hover ─────────── */
.card-video-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.project-card:hover .card-video-thumb,
.card-video-primary {
  opacity: 1;
}

/* ── Card thumbnail SVG icon (fallback sin imagen) ───── */
.card-thumb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: currentColor;
}

.card-thumb-icon svg {
  width: 26px;
  height: 26px;
}

/* ── Pill dot (reemplaza emoji en filtros) ───────────── */
.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════
   ACCESSIBILITY — prefers-reduced-motion
   ══════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  /* Disable all animations and transitions globally */
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* Entrance animations — show elements immediately */
  .logo-float-wrapper,
  .pt-char,
  .portal-lab-line,
  .portal-tagline,
  .form-slide-card,
  .subject-section {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  /* Freeze continuous decorative animations */
  .flare-1, .flare-2, .flare-3 {
    animation: none !important;
  }

  .lab-word {
    animation: none !important;
    background-position: 0 center;
  }

  /* Keep functional spinners & status indicators */
  .btn-loader {
    animation: btnSpinner 0.6s linear infinite !important;
  }

  .viewer-status {
    animation: statusPulse 2s ease-in-out infinite !important;
  }

  .loader-spinner {
    animation: spin 0.8s linear infinite !important;
  }

  /* Cinema transitions — snap instead of fade */
  .cinema-backdrop {
    transition: none !important;
  }

  .cinema-progress-fill {
    animation: none !important;
    width: 100%;
  }

  /* Keep lab loading overlay spinner visible */
  .lab-loading-spinner {
    animation: labSpinnerRotate 0.8s linear infinite !important;
  }
}

/* ── Lab Loading Overlay ───────────────────────────── */
.lab-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 8, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lab-loading-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.lab-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px 48px;
  background: rgba(18, 18, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 0 60px rgba(249, 115, 22, 0.12), 0 24px 64px rgba(0, 0, 0, 0.6);
  animation: labCardIn 0.3s var(--ease-out) both;
}

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

.lab-loading-logo {
  width: 52px;
  height: auto;
  opacity: 0.9;
}

.lab-loading-spinner {
  width: 36px;
  height: 36px;
  border: 2.5px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: labSpinnerRotate 0.8s linear infinite;
}

@keyframes labSpinnerRotate {
  to { transform: rotate(360deg); }
}

.lab-loading-text {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
