/* CSS: PROYECTO ESPARTACO (DISEÑO PREMIUM ROMANO-CINEMATOGRÁFICO) */

:root {
  /* Colors - Pure Black & Cinematic Burgundy */
  --bg-primary: #000000;      /* Fondo negro absoluto */
  --bg-secondary: #060606;    /* Negro mate */
  --bg-card: rgba(10, 10, 10, 0.95);
  
  --text-primary: #FFFFFF;    /* Letras blancas */
  --text-secondary: #B5B5B5;  /* Gris claro para legibilidad secundaria */
  
  --gold-accent: #8A1F26;     /* Rojo apagado tipo terciopelo de teatro / Moulin Rouge */
  --gold-hover: #AB2630;      /* Rojo un poco más claro para hover */
  --roman-purple: #4A1015;    /* Rojo oscuro de fondo */
  --imperial-red: #8A1F26;    /* Rojo de acento */
  
  --border-color: rgba(138, 31, 38, 0.4);
  --glass-border: rgba(255, 255, 255, 0.05);
  --shadow-sm: 0 4px 8px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.9);
  --shadow-gold: 0 4px 20px rgba(138, 31, 38, 0.25);
  
  /* Typography */
  --font-serif: 'Cinzel', serif;    /* Tipografía épica e histórica (estilo Trajan de posters de cine) */
  --font-sans: 'Inter', sans-serif; /* Tipografía de lectura */
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.85)), url('spartacus_official_silhouette.png?v=20260603k');
  background-size: auto 75vh;
  background-position: center 240px;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 2rem;
}

/* Decoraciones */
.ambient-border {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--roman-purple) 0%, var(--gold-accent) 50%, var(--roman-purple) 100%);
  z-index: 100;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header */
.app-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 0 2rem 0;
}

.header-logo-container {
  position: relative;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-gold);
  background-color: #000000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  z-index: 10;
  margin-bottom: 1.5rem;
}

.header-logo-container:hover {
  transform: scale(1.08);
}

.header-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.35); /* Hace el dibujo un 35% más grande con respecto al círculo */
  transform-origin: center;
}

@media (max-width: 768px) {
  .header-logo-container {
    margin: 0 auto 1rem auto;
    width: 110px;
    height: 110px;
  }
}

.logo-area {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.logo-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.title-top {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 10px;
  color: #ffffff;
  gap: 1.2rem;
  width: 100%;
  text-transform: uppercase;
}

.title-top::before,
.title-top::after {
  content: "";
  flex: 1;
  height: 2px;
  background-color: var(--gold-accent);
  opacity: 0.8;
}

.title-bottom {
  display: block;
  font-family: var(--font-serif);
  font-size: 3.4rem;
  font-weight: 700;
  letter-spacing: 8px;
  color: var(--gold-accent) !important;
  -webkit-text-fill-color: var(--gold-accent) !important;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
  margin-top: 0.3rem;
  padding-bottom: 0.8rem;
  position: relative;
  width: 100%;
  text-align: center;
  text-transform: uppercase;
}

.title-bottom::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 5%;
  width: 90%;
  height: 2px;
  background-color: var(--gold-accent);
  opacity: 0.8;
}


.title-accent {
  background: linear-gradient(135deg, var(--gold-accent) 0%, #FFF 50%, var(--gold-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
  animation: shine 6s linear infinite;
}

@keyframes shine {
  to { background-position: 200% center; }
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto;
}

/* Glassmorphism utility */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

/* Toolbar: Search and Filters */
.toolbar-section {
  padding: 1.5rem;
  margin-bottom: 3rem;
  border: 1px solid var(--border-color);
}

.toolbar-top {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.search-bar {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 0.6rem 1.25rem;
  gap: 0.75rem;
  flex: 1;
  min-width: 280px;
  transition: all 0.3s ease;
}

.search-bar:focus-within {
  border-color: var(--gold-accent);
  box-shadow: var(--shadow-gold);
}

.search-icon {
  color: var(--gold-accent);
  opacity: 0.7;
}

.search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: white;
  flex: 1;
  font-size: 1rem;
}

.search-bar input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.clear-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.clear-btn:hover {
  color: white;
}

/* Filters */
.filters-container {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-accent) transparent;
}

.filters-container::-webkit-scrollbar {
  height: 4px;
}

.filters-container::-webkit-scrollbar-thumb {
  background: var(--gold-accent);
  border-radius: 4px;
}

.filter-btn {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(138, 31, 38, 0.15);
  color: var(--text-secondary);
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  border-color: var(--gold-accent);
  color: var(--text-primary);
  background: rgba(138, 31, 38, 0.04);
}

.filter-btn.active {
  background: var(--roman-purple);
  color: white;
  border-color: var(--gold-accent);
  box-shadow: var(--shadow-sm);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  font-size: 0.95rem;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--roman-purple);
  color: white;
  border: 1px solid transparent;
}

.btn-primary:hover {
  background-color: var(--imperial-red);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.3);
}

.btn-gold {
  background-color: var(--gold-accent);
  color: #FFFFFF;
  border-radius: 50px;
  padding: 0.6rem 1.5rem;
}

.btn-gold:hover {
  background-color: var(--gold-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--gold-accent);
  color: var(--gold-accent);
}

.btn-outline:hover {
  background: rgba(138, 31, 38, 0.08);
  transform: translateY(-2px);
}

/* Movies Grid */
.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2.5rem;
  min-height: 300px;
}

.loading-state, .empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.empty-state i {
  color: var(--gold-accent);
  width: 48px;
  height: 48px;
}

/* Movie Card */
.movie-card {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 10, 9, 0.96);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
  backdrop-filter: blur(8px);
}

.movie-card:hover {
  transform: translateY(-8px);
  border-color: var(--gold-accent);
  box-shadow: 0 12px 30px rgba(138, 31, 38, 0.12);
}

.movie-poster-wrapper {
  position: relative;
  height: 360px;
  background: #060a08;
  overflow: hidden;
}

.movie-poster-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.6s ease;
}

.movie-card:hover .movie-poster-wrapper img {
  transform: scale(1.04);
}

.movie-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(10, 15, 13, 0.95) 0%, rgba(10, 15, 13, 0.4) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
}

.period-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(92, 27, 51, 0.85); /* Púrpura imperial */
  color: white;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  font-family: var(--font-serif);
  font-size: 0.75rem;
  border: 1px solid var(--gold-accent);
  backdrop-filter: blur(4px);
  z-index: 2;
}

.year-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--gold-accent);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.75rem;
  backdrop-filter: blur(4px);
  z-index: 2;
}

.filmoteca-badge {
  position: absolute;
  top: 48px;
  left: 12px;
  background: rgba(16, 185, 129, 0.85); /* Emerald green background */
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.7rem;
  backdrop-filter: blur(4px);
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.movie-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  margin-bottom: 0.2rem;
  color: white;
  line-height: 1.25;
}

.movie-director {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.movie-ratings {
  display: flex;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  font-size: 0.72rem;
  border: 1px solid rgba(212, 175, 55, 0.08);
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.stars-list {
  display: inline-flex;
  gap: 1px;
}

.stars-list i,
.stars-list svg {
  width: 13px !important;
  height: 13px !important;
}

.stars-list i.filled,
.stars-list svg.filled {
  fill: #fbbd24 !important;
  color: #fbbd24 !important;
}

.stars-list i.empty,
.stars-list svg.empty {
  color: rgba(255, 255, 255, 0.15) !important;
}

.stars-list i.laurel-filled,
.stars-list svg.laurel-filled {
  fill: #fbbd24 !important;
  color: #fbbd24 !important;
  opacity: 1 !important;
}

.stars-list i.laurel-empty,
.stars-list svg.laurel-empty {
  color: rgba(255, 255, 255, 0.15) !important;
  opacity: 0.25 !important;
}

.movie-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(8, 10, 9, 0.98);
}

.movie-synopsis-preview {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 1rem;
  flex: 1;
}

.movie-card-actions {
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.75rem;
}

.movie-card-actions .btn {
  padding: 0.45rem;
  font-size: 0.82rem;
}

.btn-icon-only {
  min-width: 36px;
  justify-content: center;
}

/* Modales */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  animation: fadeIn 0.25s ease forwards;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

.modal-header {
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  letter-spacing: 1px;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: white;
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Detail Modal Grid */
.movie-detail-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .movie-detail-grid {
    grid-template-columns: 1fr;
  }
}

.movie-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.movie-detail-poster {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  height: 380px;
  background: #000;
}

.movie-detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.movie-meta-block {
  background: rgba(0, 0, 0, 0.25);
  padding: 1.2rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.meta-row {
  display: flex;
  justify-content: space-between;
}

.meta-row.divider {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.meta-label {
  color: var(--text-secondary);
}

.meta-value {
  color: white;
  font-weight: 500;
}

.movie-detail-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.detail-section-title {
  font-family: var(--font-serif);
  color: var(--gold-accent);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.4rem;
  margin-bottom: 0.8rem;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-section-title i {
  width: 16px;
  height: 16px;
}

.synopsis-text {
  font-size: 0.95rem;
  line-height: 1.6;
}

.analysis-block {
  background: rgba(139, 0, 0, 0.05); /* Sutil tinte rojo romano */
  border-left: 4px solid var(--imperial-red);
  padding: 1.25rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap; /* Mantiene saltos de línea */
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.data-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.data-label {
  font-size: 0.88rem;
  color: var(--gold-accent);
  font-family: var(--font-serif);
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.input-field {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  color: white;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-family: var(--font-sans);
  outline: none;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.input-field:focus {
  border-color: var(--gold-accent);
  background: rgba(0, 0, 0, 0.6);
}

.input-field::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

select.input-field {
  cursor: pointer;
}

select.input-field option {
  background: var(--bg-secondary);
  color: white;
}

textarea.input-field {
  resize: vertical;
}

.textarea-medium {
  min-height: 120px;
  font-size: 1rem;
  line-height: 1.5;
  padding: 0.75rem;
}

.textarea-large {
  min-height: 350px;
  font-size: 1.05rem;
  line-height: 1.6;
  padding: 0.9rem;
}

/* Rating Input Component */
.rating-input {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  height: 38px;
}

.rating-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, transform 0.15s ease;
}

.rating-btn:hover {
  transform: scale(1.15);
}

.rating-btn.active {
  color: var(--gold-accent);
}

.rating-btn.active i {
  fill: var(--gold-accent);
}

/* Poster Upload Area */
.upload-container {
  background: rgba(138, 31, 38, 0.02);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.upload-icon {
  color: var(--gold-accent);
  opacity: 0.5;
  width: 24px;
  height: 24px;
}

.upload-text {
  font-size: 0.8rem;
  opacity: 0.6;
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-input-active .upload-container {
  background: rgba(138, 31, 38, 0.08);
  border-style: solid;
}

.or-separator {
  font-size: 0.75rem;
  opacity: 0.4;
  margin: 0.25rem 0;
  z-index: 3;
}

.upload-container .input-field {
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  z-index: 3;
}

/* Custom Scrollbar */
.scrollbar-custom::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.scrollbar-custom::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.scrollbar-custom::-webkit-scrollbar-thumb {
  background: rgba(251, 189, 36, 0.45);
  border-radius: 4px;
  border: 1px solid rgba(251, 189, 36, 0.1);
}

.scrollbar-custom::-webkit-scrollbar-thumb:hover {
  background: rgba(251, 189, 36, 0.85);
}

/* Footer styling */
.app-footer {
  text-align: center;
  padding: 4rem 0 2rem 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  opacity: 0.6;
}

/* Characters list styles */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.character-card {
  background: rgba(12, 12, 12, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.25rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  box-shadow: var(--shadow-sm);
}

.character-card:hover {
  border-color: var(--gold-hover);
  background: rgba(22, 22, 22, 0.95);
  transform: translateY(-3px);
  box-shadow: var(--shadow-gold);
}

.character-name {
  font-family: var(--font-serif);
  color: var(--gold-accent);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.actor-name {
  font-size: 0.9rem;
  color: white;
  font-weight: 500;
}

.character-role {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 0.3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.3rem;
}

/* Form Character Row Styling */
.character-form-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.75);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid rgba(251, 189, 36, 0.25);
  margin-bottom: 0.85rem;
  width: 100%;
}

.char-form-top {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

.char-form-photos {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.char-form-footer {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
}

.char-bio-input {
  width: 100% !important;
  min-height: 75px !important;
  background: rgba(0, 0, 0, 0.4) !important;
  border: 1px solid rgba(251, 189, 36, 0.3) !important;
  color: #f1f5f9 !important;
  padding: 0.6rem !important;
  font-size: 0.85rem !important;
  border-radius: 6px !important;
  resize: vertical !important;
}

@media (max-width: 600px) {
  .character-form-row {
    padding: 0.75rem;
  }
  .char-form-top, .char-form-photos {
    flex-direction: column;
  }
}

/* Navigation Tabs */
.app-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding: 0.5rem;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.6rem 1.25rem;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  border-radius: 25px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.nav-tab:hover {
  color: white;
  background: rgba(138, 31, 38, 0.1);
}

.nav-tab.active {
  background: var(--gold-accent);
  color: white;
  box-shadow: var(--shadow-gold);
}

/* View Content Visibility */
.view-content {
  animation: fadeIn 0.4s ease forwards;
}

/* Art Section */
.art-section {
  padding: 2.5rem;
  border: 1px solid var(--border-color);
}

.art-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.art-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.art-header p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.art-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  background: rgba(12, 12, 12, 0.85);
  transition: transform 0.3s ease;
}

.art-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-color);
}

.art-img-container {
  height: 200px;
  background: #000;
}

.art-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art-info {
  padding: 1.5rem;
}

.art-info h3 {
  font-family: var(--font-serif);
  color: var(--gold-accent);
  margin-bottom: 0.25rem;
}

.art-origin {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.75rem;
}

.art-info p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Student Profile View */
.profile-section {
  padding: 2.5rem;
  border: 1px solid var(--border-color);
  max-width: 800px;
  margin: 0 auto;
}

.profile-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.profile-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.profile-header p {
  color: var(--text-secondary);
}

.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
}

.stat-num {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--gold-accent);
  display: block;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.profile-subtitle {
  font-family: var(--font-serif);
  color: white;
  margin-bottom: 1rem;
}

.profile-ratings-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-movie-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.01);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.empty-text {
  text-align: center;
  opacity: 0.4;
  padding: 2rem;
  font-style: italic;
}

/* Admin Dashboard View */
.admin-section {
  padding: 2.5rem;
  border: 1px solid var(--border-color);
}

.admin-header {
  margin-bottom: 2rem;
}

.admin-header h2 {
  font-size: 2rem;
}

.admin-header p {
  color: var(--text-secondary);
}

.admin-table-container {
  overflow-x: auto;
}

.excel-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.excel-table th {
  background: rgba(138, 31, 38, 0.15);
  color: var(--gold-accent);
  font-family: var(--font-serif);
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  border: 1px solid var(--border-color);
}

.excel-table td {
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: white;
}

.excel-table tbody tr {
  transition: background 0.2s ease;
}

.excel-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.status-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.status-approved {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.status-pending {
  background: rgba(251, 189, 36, 0.15);
  color: #fbbd24;
  border: 1px solid rgba(251, 189, 36, 0.3);
}

/* Authentication View */
.auth-section {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}

.auth-card {
  width: 100%;
  max-width: 450px;
  background: rgba(12, 12, 12, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 1rem;
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 1rem;
  transition: all 0.3s ease;
  text-align: center;
}

.auth-tab-btn:hover {
  color: white;
  background: rgba(138, 31, 38, 0.05);
}

.auth-tab-btn.active {
  color: var(--gold-accent);
  border-bottom: 2px solid var(--gold-accent);
  background: rgba(138, 31, 38, 0.02);
}

.auth-forms {
  padding: 2rem;
}

.auth-status {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.status-error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-warning {
  background: rgba(251, 189, 36, 0.15);
  color: #fbbd24;
  border: 1px solid rgba(251, 189, 36, 0.3);
}

.status-success {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

/* Comments Section */
.comment-row {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.comment-author {
  font-weight: 600;
  color: white;
}

.comment-text {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.45;
}

.delete-comment-btn {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  margin-top: 0.5rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.delete-comment-btn:hover {
  opacity: 1;
}

.divider-top {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

.auth-prompt-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 0.75rem;
}

/* Platform pill indicators */
.platform-pill {
  background: rgba(138, 31, 38, 0.2);
  color: var(--gold-accent);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

/* Student card controls */
.student-card-controls {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.visto-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-secondary);
  user-select: none;
}

.visto-active {
  color: #4ade80;
}

.visto-checkbox {
  accent-color: var(--gold-accent);
  cursor: pointer;
}

.star-rating-card {
  display: inline-flex;
  gap: 2px;
}

.star-btn-card {
  width: 14px;
  height: 14px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.star-btn-card:hover {
  transform: scale(1.2);
}

.star-btn-card.filled {
  fill: #fbbd24;
  color: #fbbd24;
}

.star-btn-card.empty {
  color: rgba(255, 255, 255, 0.15);
}

.teacher-card-controls {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   CSS ADDITIONS: MODAL SCROLL FIX, DETAIL BANNER, TRUTH/MYTHS & GALLERY
   ========================================================================== */

/* Fix para permitir scroll vertical en el formulario de registro/edición */
#movieForm {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 82vh;
  min-height: 0;
  overflow: hidden;
}

#movieForm .modal-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Imagen de cartel (Cabecera de la ficha detallada) */
.movie-detail-banner-wrapper {
  position: relative;
  height: 220px;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
  border-bottom: 2px solid var(--border-color);
  background-color: #000;
}

.movie-detail-banner-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  transition: opacity 0.5s ease;
}

/* Grid de la galería de imágenes en detalle */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.gallery-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #000;
  cursor: zoom-in;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover {
  transform: scale(1.05);
  border-color: var(--gold-accent);
  box-shadow: var(--shadow-gold);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Galería en formulario de edición */
.form-gallery-thumb {
  position: relative;
  width: 75px;
  height: 75px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #050505;
}

.form-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.form-gallery-thumb .delete-thumb-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(239, 68, 68, 0.9);
  border: none;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: background 0.2s ease, transform 0.1s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  z-index: 5;
}

.form-gallery-thumb .delete-thumb-btn:hover {
  background: #ef4444;
  transform: scale(1.1);
}

/* Lightbox Visor Modal */

/* Lightbox Visor Modal */

/* Detail Modal Overlay Styling */
#detailModal {
  display: none; /* hidden by default */
  position: fixed;
  inset: 0; /* top, right, bottom, left = 0 */
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
  z-index: 10000; /* ensure above other content */
  padding: 0 !important;
}

#detailModal .modal-content {
  background: var(--bg-secondary, #060606) !important;
  border: none !important;
  border-radius: 0 !important;
  max-width: 100vw !important;
  width: 100vw !important;
  max-height: 100vh !important;
  height: 100vh !important;
  margin: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  animation: fadeIn 0.2s ease forwards;
  padding: 2rem;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: -45px;
  right: 0;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(239, 68, 68, 0.8);
}

/* ============================================================
   DETAIL MODAL — Diseño completo de ficha de película
   ============================================================ */

/* Contenedor de la ficha de detalle — 100% PANTALLA COMPLETA Y MAXIMA LEGIBILIDAD */
.detail-modal-content {
  background: var(--bg-secondary, #060606);
  border: none;
  border-radius: 0;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: none;
  animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ── MODAL HEADER FIJO COMPACTO ── */
#detailModal .modal-header {
  position: relative;
  z-index: 100;
  background: var(--bg-secondary, #060606);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  padding: 1rem 2.5rem !important;
}

#detailModal .detail-banner-container {
  display: none !important;
}

.detail-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--bg-secondary, #0f0f1a) 0%,
    rgba(0,0,0,0.3) 55%,
    rgba(0,0,0,0.5) 100%
  );
}

.detail-close-btn {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  z-index: 2;
}

.detail-close-btn:hover {
  background: rgba(239, 68, 68, 0.75);
  transform: scale(1.1);
}

.detail-hero-info {
  position: absolute;
  bottom: 1.5rem;
  left: 2rem;
  right: 3rem;
  z-index: 2;
}

.detail-hero-title {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9);
  letter-spacing: -0.02em;
}

.detail-hero-subtitle {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.75);
  margin-top: 0.3rem;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* ── BODY SCROLLABLE ── */
.detail-modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 1.75rem 2.5rem;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ── LAYOUT: sidebar + main AMPLIO ── */
.detail-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.25rem;
}

@media (max-width: 700px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-poster-wrap { display: none; }
}

/* ── SIDEBAR ── */
.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.detail-poster-wrap {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  aspect-ratio: 2/3;
  background: #000;
}

.detail-poster-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.detail-meta-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.detail-meta-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.detail-meta-lbl {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary, rgba(255,255,255,0.45));
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.detail-meta-val {
  font-size: 0.9rem;
  color: white;
  font-weight: 500;
}

.detail-meta-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 0.35rem 0;
}

.detail-trailer-btn {
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── MAIN CONTENT ── */
.detail-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.detail-section {
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 1.5rem;
}

.detail-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Títulos de sección con color */
.detail-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.85rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid currentColor;
}

.detail-section-title svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.clr-white { color: rgba(255,255,255,0.85); border-color: rgba(255,255,255,0.2) !important; }
.clr-green { color: #4ade80; }
.clr-red   { color: #f87171; }
.clr-gold  { color: #fbbd24; }
.clr-blue  { color: #60a5fa; }

/* Bloques de análisis con colores — EXTRA LEGIBLE Y AMPLIO */
.analysis-block {
  border-left: 3px solid;
  border-radius: 0 8px 8px 0;
  padding: 1.1rem 1.3rem;
  font-size: 1.05rem;
  line-height: 1.8;
  white-space: pre-line;
  color: rgba(255, 255, 255, 0.95);
}

.analysis-green { border-color: #4ade80; background: rgba(10, 15, 12, 0.96) !important; border-left: 4px solid #4ade80; }
.analysis-red   { border-color: #f87171; background: rgba(15, 10, 10, 0.96) !important; border-left: 4px solid #f87171; }
.analysis-gold  { border-color: #fbbd24; background: rgba(15, 14, 10, 0.96) !important; border-left: 4px solid #fbbd24; }
.analysis-blue  { border-color: #60a5fa; background: rgba(10, 12, 15, 0.96) !important; border-left: 4px solid #60a5fa; }

/* Sinopsis — EXTRA LEGIBLE */
.synopsis-text {
  font-size: 1.15rem;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
  white-space: pre-line;
}

/* Comentarios */
.detail-comments-section {
  background: rgba(255,255,255,0.015);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 1.25rem;
}

/* Character Card Photo Styles */
.character-photos {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  width: 100%;
}

.character-photo-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.5rem;
  text-align: center;
}

.character-photo-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.character-photo-img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease;
}

.character-photo-img:hover {
  transform: scale(1.05);
}

.character-quote {
  font-style: italic;
  font-size: 0.9rem;
  color: #fbbd24;
  border-left: 2px solid var(--gold-accent);
  padding-left: 0.6rem;
  margin: 0.6rem 0;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.02);
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
  border-radius: 0 4px 4px 0;
}

/* Form Character Edit Layout */
.character-form-row {
  background: rgba(0, 0, 0, 0.4) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px;
  padding: 1.25rem !important;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.char-form-header {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
}

.char-form-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
}

.char-form-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

/* Homepage Sections */
.catalog-section {
  margin-bottom: 3.5rem;
}

.section-title-premium {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--gold-accent);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title-premium svg,
.section-title-premium i {
  color: var(--gold-accent);
  width: 24px;
  height: 24px;
}

.movies-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2.5rem;
}

/* ==========================================================================
   ESTILOS PARA EL NUEVO DISEÑO DE DASHBOARD DE 3 COLUMNAS (FICHA DE DETALLE)
   ========================================================================== */

/* Dashboard layout para mostrar todo en una sola vista vertical y amplia */
.dashboard-layout {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.5rem;
  height: auto;
  min-height: 0;
  overflow: visible;
}

.dashboard-col {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.5rem;
  height: auto;
  min-height: 0;
}

/* Caja contenedora tipo tarjeta */
.card-box {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(138, 31, 38, 0.15);
  border-radius: 10px;
  padding: 1rem !important;
  margin-bottom: 0 !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Alturas internas para evitar scrolls de página general */
.detail-modal-body {
  padding: 1.5rem 2rem 2rem 2rem !important;
  overflow-y: auto !important; /* El cuerpo principal del modal sí escrolea */
}

.detail-main {
  min-height: 0;
  height: auto;
  display: flex !important;
  flex-direction: column !important;
}

/* Alturas dinámicas sin scrolls internos para evitar cajas extensas vacías o recortadas */
#detailSynopsis {
  height: auto;
  max-height: none;
  overflow: visible;
}

.analysis-block.scrollbar-custom {
  height: auto;
  max-height: none;
  overflow: visible;
  font-size: 0.88rem;
  line-height: 1.5;
}

#detailEscenas.scrollbar-custom,
#detailTecnicos.scrollbar-custom {
  height: auto;
  max-height: none;
  overflow: visible;
  font-size: 0.88rem;
}

#detailCharacters.scrollbar-custom {
  height: auto;
  max-height: none;
  overflow: visible;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

#detailGalleryGrid.scrollbar-custom {
  height: auto;
  max-height: none;
  overflow: visible;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

#detailCommentsList.scrollbar-custom {
  height: auto;
  max-height: none;
  overflow: visible;
}

/* Adaptabilidad para pantallas medianas/pequeñas */
@media (max-width: 1024px) {
  .detail-modal-body {
    overflow-y: auto !important;
  }
  
  .dashboard-layout {
    grid-template-columns: 1fr;
    overflow-y: visible;
    height: auto;
  }
  
  .dashboard-col {
    height: auto;
  }
  
  #detailSynopsis,
  .analysis-block.scrollbar-custom,
  #detailEscenas.scrollbar-custom,
  #detailTecnicos.scrollbar-custom,
  #detailCharacters.scrollbar-custom,
  #detailGalleryGrid.scrollbar-custom,
  #detailCommentsList.scrollbar-custom {
    max-height: none !important;
    overflow-y: visible !important;
  }
}

/* ============================================================
   ESTILOS PARA LAS ESTRELLAS/LAURELES DE CALIFICACIÓN (MODAL)
   ============================================================ */
.rating-stars {
  display: inline-flex;
  gap: 2px;
}

.rating-stars i,
.rating-stars svg {
  width: 16px !important;
  height: 16px !important;
}

.rating-stars i.filled,
.rating-stars svg.filled,
.rating-stars i.laurel-filled,
.rating-stars svg.laurel-filled {
  fill: #fbbd24 !important;
  color: #fbbd24 !important;
  opacity: 1 !important;
}

.rating-stars i.empty,
.rating-stars svg.empty,
.rating-stars i.laurel-empty,
.rating-stars svg.laurel-empty {
  color: rgba(255, 255, 255, 0.15) !important;
  fill: transparent !important;
  opacity: 0.35 !important;
}

/* ============================================================
   ESTILOS ADICIONALES PARA TEMAS Y MOVIMIENTO DE TARJETAS
   ============================================================ */
.movie-card[draggable="true"] {
  cursor: grab;
  user-select: none;
}

.movie-card.dragging {
  opacity: 0.4 !important;
  transform: scale(0.96) !important;
  border-color: var(--gold-accent) !important;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.8) !important;
}

.catalog-section {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 1.5rem 1rem;
}

.catalog-section.drag-over {
  background: rgba(138, 31, 38, 0.08);
  border-color: rgba(138, 31, 38, 0.6);
  box-shadow: 0 0 20px rgba(138, 31, 38, 0.2);
  transform: scale(1.008);
}

.theme-drop-zone {
  grid-column: 1 / -1;
  border: 2px dashed rgba(138, 31, 38, 0.25);
  border-radius: 10px;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-secondary);
  background: rgba(138, 31, 38, 0.01);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
}

.catalog-section.drag-over .theme-drop-zone {
  border-color: var(--gold-accent);
  color: #ffffff;
  background: rgba(138, 31, 38, 0.05);
}

.theme-drop-zone i, .theme-drop-zone svg {
  color: var(--gold-accent);
  opacity: 0.6;
  width: 28px;
  height: 28px;
}

/* Menú contextual de Mover a Tema */
.move-menu-container {
  position: relative;
  display: inline-block;
}

.move-menu-dropdown {
  position: absolute;
  bottom: 100%;
  right: 0;
  z-index: 1000;
  background: #0f0f0f;
  border: 1px solid rgba(138, 31, 38, 0.5);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.85);
  min-width: 220px;
  max-height: 280px;
  overflow-y: auto;
  padding: 0.4rem 0;
  display: none;
  animation: slideInUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  margin-bottom: 6px;
}

.move-menu-dropdown.show {
  display: block;
}

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

.move-menu-header {
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--gold-accent);
  font-family: var(--font-serif);
  font-weight: bold;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 0.25rem;
  letter-spacing: 0.5px;
}

.move-menu-item {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-align: left;
  width: 100%;
  background: none;
  border: none;
  font-family: var(--font-sans);
}

.move-menu-item:hover {
  background: var(--roman-purple);
  color: #ffffff;
}

.move-menu-item i, .move-menu-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.move-menu-item.create-new {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-weight: 500;
  background: rgba(138, 31, 38, 0.15);
}

.move-menu-item.create-new:hover {
  color: #ffffff;
  background: var(--gold-accent);
}

/* ==========================================================
   ESTILOS ADICIONALES: FRASES DE PELÍCULA Y LISTAS DE USUARIO
   ========================================================== */

/* Contenedor de Frase Célebre de la Película en Detalle */
.movie-quote-container {
  display: none; /* Controlado por JS */
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  color: #ffffff;
  margin: 1.5rem auto;
  max-width: 85%;
  padding: 0.75rem 2rem;
  position: relative;
  line-height: 1.5;
  background: rgba(138, 31, 38, 0.05);
  border-left: 3px solid var(--gold-accent);
  border-right: 3px solid var(--gold-accent);
  border-radius: 6px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.movie-quote-container::before {
  content: "“";
  font-size: 3.5rem;
  color: var(--gold-accent);
  position: absolute;
  left: 0.5rem;
  top: -1.2rem;
  font-family: var(--font-serif);
  opacity: 0.3;
}

.movie-quote-container::after {
  content: "”";
  font-size: 3.5rem;
  color: var(--gold-accent);
  position: absolute;
  right: 0.5rem;
  bottom: -2.8rem;
  font-family: var(--font-serif);
  opacity: 0.3;
}

/* Sección de Listas en el Perfil */
.profile-lists-section {
  margin-top: 2rem;
  margin-bottom: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.5rem;
}

.profile-lists-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

/* Tarjeta de Lista */
.list-card {
  background: rgba(15, 15, 15, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.list-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gold-accent);
  transition: background 0.3s ease;
}

.list-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-hover);
  box-shadow: var(--shadow-gold);
  background: rgba(22, 10, 12, 0.95);
}

.list-card:hover::after {
  background: var(--gold-hover);
}

.list-card-top {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.list-card-icon-wrap {
  color: var(--gold-accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.list-card-icon-wrap i, .list-card-icon-wrap svg {
  width: 22px;
  height: 22px;
}

.list-card-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.3;
  word-break: break-word;
}

.list-card-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 0.15rem;
}

.list-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.6rem;
  margin-top: 0.8rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.list-card:hover .list-card-actions {
  opacity: 1;
}

.list-card-actions .btn-sm {
  padding: 0.25rem 0.45rem;
  font-size: 0.75rem;
  border-radius: 4px;
}

/* Vista de Detalle de Lista en Modal */
.list-movies-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  padding-right: 0.25rem;
}

.list-movie-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: all 0.25s ease;
}

.list-movie-item:hover {
  background: rgba(138, 31, 38, 0.06);
  border-color: rgba(138, 31, 38, 0.2);
}

.list-movie-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.list-movie-thumb {
  width: 30px;
  height: 42px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #000;
}

.list-movie-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #ffffff;
}

.list-movie-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

/* Selector para añadir películas a una lista */
.add-to-list-selector {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.add-to-list-row {
  display: flex;
  gap: 0.5rem;
}

.add-to-list-select {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  color: white;
  border-radius: 6px;
  padding: 0.5rem;
  font-family: var(--font-sans);
  outline: none;
}

/* Checkboxes de Listas en la Ficha de Película */
.detail-list-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.5rem;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.detail-list-checklist-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.detail-list-checklist-item:hover {
  color: #ffffff;
}

.detail-list-checklist-item input[type="checkbox"] {
  accent-color: var(--gold-accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* ============================================== */
/* ESTILOS DE FICHA PDF (FONDO BLANCO / B&N IMPRESIÓN) */
/* ============================================== */
.espartaco-pdf-sheet {
  background: #ffffff !important;
  color: #0f172a !important;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  padding: 24px;
  box-sizing: border-box;
  width: 100%;
}

.pdf-inner-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #ffffff;
}

.pdf-brand-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #8a1f26;
  padding-bottom: 12px;
}

.pdf-brand-titles {
  display: flex;
  flex-direction: column;
}

.pdf-sub-title {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 3px;
  color: #475569;
  font-weight: 600;
  text-transform: uppercase;
}

.pdf-main-title {
  font-family: 'Cinzel', serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 5px;
  color: #8a1f26;
  text-transform: uppercase;
  margin: 2px 0 0 0;
}

.pdf-badge-tag {
  background: #fdf2f2;
  border: 1px solid #8a1f26;
  color: #8a1f26;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: 600;
  text-transform: uppercase;
}

.pdf-gold-rule {
  height: 2px;
  background: #8a1f26;
  margin-top: -8px;
}

.pdf-movie-header-grid {
  display: flex;
  gap: 20px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 16px;
}

.pdf-poster-column {
  width: 140px;
  flex-shrink: 0;
}

.pdf-poster-img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.pdf-meta-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pdf-film-title {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  color: #0f172a;
  font-weight: 700;
  margin: 0;
}

.pdf-film-subtitle {
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}

.pdf-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0;
}

.pdf-tag {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
}

.pdf-tag-gold {
  border-color: #8a1f26;
  color: #8a1f26;
  background: #fdf2f2;
  font-weight: 600;
}

.pdf-tag-crimson {
  border-color: #dc2626;
  color: #991b1b;
  background: #fef2f2;
  font-weight: 600;
}

.pdf-ratings-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 4px;
}

.pdf-rating-line {
  display: flex;
  gap: 8px;
}

.pdf-rating-lbl {
  color: #475569;
  font-weight: 600;
}

.pdf-rating-val.gold-stars {
  color: #d97706;
  font-weight: bold;
  letter-spacing: 2px;
}

.pdf-rating-val.laurel-icons {
  color: #16a34a;
  font-weight: bold;
}

.pdf-filmoteca-notice {
  color: #16a34a;
  font-weight: bold;
  font-size: 11px;
  margin-top: 2px;
}

.pdf-basado-line {
  color: #334155;
  font-size: 11px;
}

.pdf-quote-banner {
  background: #fdf2f2;
  border-left: 4px solid #8a1f26;
  padding: 10px 14px;
  font-family: 'Cinzel', serif;
  font-style: italic;
  font-size: 13px;
  color: #8a1f26;
  border-radius: 0 6px 6px 0;
  border-top: 1px solid #fecdd3;
  border-right: 1px solid #fecdd3;
  border-bottom: 1px solid #fecdd3;
}

.pdf-card-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 14px;
}

.pdf-box-h2 {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  color: #0f172a;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
}

.pdf-box-h2.text-green {
  color: #15803d;
}

.pdf-box-h2.text-red {
  color: #b91c1c;
}

.pdf-box-h2.text-gold {
  color: #b45309;
}

.pdf-box-h2.text-blue {
  color: #1d4ed8;
}

.pdf-box-p {
  font-size: 12px;
  line-height: 1.55;
  color: #1e293b;
  margin: 0;
  white-space: pre-wrap;
}

.pdf-analysis-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pdf-box-verdadero {
  border-left: 4px solid #16a34a;
  background: #f0fdf4;
}

.pdf-box-falso {
  border-left: 4px solid #dc2626;
  background: #fef2f2;
}

.pdf-box-escenas {
  border-left: 4px solid #d97706;
  background: #fffbeb;
}

.pdf-box-tecnicos {
  border-left: 4px solid #2563eb;
  background: #eff6ff;
}

.pdf-characters-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.65;
  margin-top: 10px;
}

.pdf-characters-table th {
  background: #8a1f26;
  color: #ffffff;
  font-family: 'Cinzel', serif;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid #8a1f26;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.pdf-characters-table td {
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  background: #ffffff;
  vertical-align: top;
  font-size: 12.5px;
  line-height: 1.65;
}

.pdf-characters-table td strong {
  color: #8a1f26;
  font-size: 13px;
}

.pdf-characters-table tr:nth-child(even) td {
  background: #f8fafc;
}

.pdf-footer-bar {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #64748b;
  border-top: 1px solid #cbd5e1;
  padding-top: 10px;
  margin-top: 8px;
}

@media print {
  @page {
    margin: 8mm 8mm 8mm 8mm;
    size: A4 portrait;
  }
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }
  body * {
    visibility: hidden !important;
  }
  #printModal, #printModal * {
    visibility: visible !important;
  }
  #printModal {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: #ffffff !important;
    display: block !important;
    z-index: 999999 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .print-modal-bar, .modal-header, .close-btn {
    display: none !important;
  }
  #printModal .modal-content {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    box-shadow: none !important;
    border: none !important;
    background: #ffffff !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #printModalBody {
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
    overflow: visible !important;
  }
  .sheet-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }
  .espartaco-pdf-sheet {
    padding: 0 !important;
    margin: 0 !important;
    page-break-before: avoid !important;
  }
}

/* ==========================================================================
   OPTIMIZACIONES DE RENDIMIENTO Y ADAPTACIÓN MÓVIL (ULTRA-RÁPIDO Y FLUIDO)
   ========================================================================== */

/* 1. Rendimiento GPU en móviles (Evita tirones al hacer scroll) */
@media (max-width: 1024px) {
  body {
    background-attachment: scroll !important;
  }
}

/* Desplazamiento táctil suave */
.filters-container,
.app-nav,
.modal-body,
.modal-content,
.view-content,
.scrollbar-custom,
.movies-grid {
  -webkit-overflow-scrolling: touch;
}

/* 2. Navegación Principal Adaptada a Cuadrícula (.app-nav) */
@media (max-width: 900px) {
  .app-nav {
    flex-wrap: wrap !important;
    justify-content: center !important;
    overflow-x: visible !important;
    padding: 0.5rem !important;
    border-radius: 12px !important;
    gap: 0.35rem !important;
    margin-bottom: 1.25rem !important;
  }
  .nav-tab {
    white-space: nowrap !important;
    flex: 0 1 auto !important;
    padding: 0.5rem 0.8rem !important;
    font-size: 0.82rem !important;
    border-radius: 8px !important;
    min-height: 38px !important;
  }
}

/* 3. Ajuste de Cabecera y Título para Pantallas Pequeñas */
@media (max-width: 768px) {
  .container {
    padding: 0 0.85rem !important;
  }
  .app-header {
    padding: 1.25rem 0 0.75rem 0 !important;
  }
  .header-logo-container {
    width: 85px !important;
    height: 85px !important;
    margin-bottom: 0.85rem !important;
  }
  .logo-title {
    max-width: 100% !important;
  }
  .title-top {
    font-size: 0.72rem !important;
    letter-spacing: 3px !important;
    gap: 0.5rem !important;
  }
  .title-bottom {
    font-size: 1.85rem !important;
    letter-spacing: 2px !important;
    padding-bottom: 0.5rem !important;
    margin-top: 0.15rem !important;
  }

  /* Toolbar y Buscador */
  .toolbar-section {
    padding: 0.85rem !important;
    margin-bottom: 1.5rem !important;
    border-radius: 12px !important;
  }
  .toolbar-top {
    gap: 0.6rem !important;
    margin-bottom: 0.75rem !important;
  }
  .search-bar {
    min-width: 100% !important;
    padding: 0.55rem 0.85rem !important;
  }
  .search-bar input {
    font-size: 16px !important; /* Previene auto-zoom molesto en iOS Safari */
  }
  .filters-container {
    gap: 0.35rem !important;
    padding-bottom: 0.35rem !important;
  }
  .filter-btn {
    padding: 0.4rem 0.85rem !important;
    font-size: 0.78rem !important;
    min-height: 36px !important;
  }

  /* Cuadrícula de Películas en Móvil (2 Columnas Cómodas) */
  .movies-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 0.85rem !important;
  }
  .movie-card {
    border-radius: 10px !important;
  }
  .movie-poster-wrapper {
    height: 220px !important;
  }
  .movie-card-overlay {
    padding: 0.65rem !important;
  }
  .movie-title {
    font-size: 1rem !important;
    line-height: 1.2 !important;
  }
  .movie-director {
    font-size: 0.72rem !important;
    margin-bottom: 0.3rem !important;
  }
  .period-badge {
    font-size: 0.65rem !important;
    padding: 0.2rem 0.4rem !important;
    top: 6px !important;
    left: 6px !important;
  }
  .year-badge {
    font-size: 0.65rem !important;
    padding: 0.2rem 0.4rem !important;
    top: 6px !important;
    right: 6px !important;
  }
  .movie-card-body {
    padding: 0.65rem !important;
  }
  .movie-synopsis-preview {
    font-size: 0.78rem !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    margin-bottom: 0.4rem !important;
  }
  .movie-ratings {
    font-size: 0.65rem !important;
    padding: 0.25rem 0.35rem !important;
  }

  /* Modales en Móvil estilo 'Bottom Sheet' de pantalla completa */
  .modal-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
  }
  .modal-content {
    border-radius: 16px 16px 0 0 !important;
    max-height: 94vh !important;
    height: 94vh !important;
    border-bottom: none !important;
    width: 100% !important;
  }
  .modal-header {
    padding: 0.85rem 1.25rem !important;
  }
  .modal-header h2 {
    font-size: 1.15rem !important;
  }
  .modal-body {
    padding: 0.85rem !important;
  }
  .modal-footer {
    padding: 0.85rem 1.25rem !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  .modal-footer .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Formulario en Móvil */
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  input[type="text"],
  input[type="number"],
  input[type="url"],
  select,
  textarea {
    font-size: 16px !important; /* Previene auto-zoom en iOS */
  }

  /* Ficha de película en Móvil */
  .detail-layout,
  .dashboard-layout,
  .movie-detail-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.85rem !important;
  }
}

@media (max-width: 420px) {
  .title-top {
    font-size: 0.65rem !important;
    letter-spacing: 2px !important;
  }
  .title-bottom {
    font-size: 1.5rem !important;
    letter-spacing: 1px !important;
  }
  .movies-grid {
    grid-template-columns: 1fr !important;
  }
  .movie-poster-wrapper {
    height: 270px !important;
  }
}

/* ============================================== */
/* PWA INSTALLATION BUTTON & MODAL STYLES         */
/* ============================================== */
.pwa-install-tab-btn {
  background: linear-gradient(135deg, var(--roman-purple) 0%, #ab2630 100%) !important;
  color: #ffffff !important;
  border: 1px solid var(--gold-accent) !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(138, 31, 38, 0.4);
  animation: pulsePwa 2.5s infinite ease-in-out;
}

.pwa-install-tab-btn:hover {
  background: var(--gold-hover) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(171, 38, 48, 0.6);
}

@keyframes pulsePwa {
  0% { box-shadow: 0 0 0 0 rgba(138, 31, 38, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(138, 31, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(138, 31, 38, 0); }
}

/* ============================================== */
/* MOBILE BOTTOM NAVIGATION BAR & THEMES HUB     */
/* ============================================== */

/* Sub-period buttons grid inside Themes Hub */
.sub-period-btn {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--text-secondary);
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.25s ease;
}

.sub-period-btn:hover,
.sub-period-btn.active {
  background: var(--roman-purple);
  color: #ffffff;
  border-color: var(--gold-accent);
  box-shadow: 0 4px 12px rgba(138, 31, 38, 0.3);
}

/* Themes Grid Cards */
.themes-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
}

.theme-hub-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0.75rem;
  border-radius: 12px;
  background: rgba(10, 10, 10, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.theme-hub-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-accent);
  background: rgba(138, 31, 38, 0.15);
  box-shadow: var(--shadow-gold);
}

.theme-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(138, 31, 38, 0.25);
  border: 1px solid rgba(212, 175, 55, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.6rem;
  color: var(--gold-accent);
}

.theme-hub-card h4 {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: #ffffff;
  margin: 0;
}

/* Bottom Navigation Bar for Mobile */
.bottom-nav-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(6, 6, 6, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  z-index: 999;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
}

.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.72rem;
  gap: 0.2rem;
  cursor: pointer;
  flex: 1;
  padding: 0.4rem 0;
  transition: color 0.2s ease;
}

.bnav-item i,
.bnav-item svg {
  width: 22px !important;
  height: 22px !important;
}

.bnav-item.active {
  color: var(--gold-accent);
  font-weight: 600;
}

.bnav-item.active i,
.bnav-item.active svg {
  color: var(--gold-accent) !important;
}

/* Pestañas de Navegación de Materias (Historia, Arte, Literatura, etc.) */
/* Pestañas de Navegación de Materias (Adaptadas a cuadrícula sin desplazar a la derecha) */
.app-nav {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  margin-bottom: 1.5rem;
}

.nav-tab {
  flex: 0 1 auto;
  white-space: nowrap;
}

/* Selector de Periodos Históricos (Adaptado a cuadrícula sin desplazar a la derecha) */
.filters-container {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 0.4rem;
  padding-bottom: 0.6rem;
}

.filter-btn {
  flex: 0 1 auto;
  white-space: nowrap;
}

/* Adaptación móvil ultra-cómoda: 2-3 columnas encuadradas sin desplazamiento horizontal */
@media (max-width: 768px) {
  body {
    padding-bottom: 76px !important;
  }

  .bottom-nav-bar {
    display: flex !important;
  }

  .app-nav {
    flex-wrap: wrap !important;
    justify-content: center !important;
    overflow-x: visible !important;
    padding: 0.4rem 0.35rem !important;
    gap: 0.35rem !important;
    margin-bottom: 1rem !important;
  }

  .nav-tab {
    flex: 1 1 calc(33.33% - 0.35rem) !important;
    max-width: calc(50% - 0.35rem) !important;
    min-width: 95px !important;
    text-align: center !important;
    justify-content: center !important;
    font-size: 0.76rem !important;
    padding: 0.45rem 0.3rem !important;
    border-radius: 8px !important;
  }

  .filters-container {
    flex-wrap: wrap !important;
    justify-content: center !important;
    overflow-x: visible !important;
    gap: 0.35rem !important;
    padding-bottom: 0.25rem !important;
  }

  .filter-btn {
    flex: 1 1 calc(33.33% - 0.35rem) !important;
    max-width: calc(50% - 0.35rem) !important;
    min-width: 85px !important;
    text-align: center !important;
    justify-content: center !important;
    font-size: 0.75rem !important;
    padding: 0.4rem 0.3rem !important;
    border-radius: 8px !important;
  }
}







