/* ===== VARIABLES CSS ===== */
:root {
  --bg: #000;
  --bg-dark: #000;
  --accent: #ffd700;
  --accent2: #fff;
  --text: #fff;
  --text-muted: #bbb;
  --card: #111;
  --border: #ffd700;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-gold: 0 0 24px #ffd70088;
  --shadow-hover: 0 4px 18px #ffd70055;
}

/* ===== RESET Y BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Montserrat', Arial, sans-serif;
  margin: 0;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  min-height: 100vh;
}

/* ===== LAYOUT PRINCIPAL ===== */
.novela-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.novela-main {
  flex: 1;
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.novela-content {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 3px solid var(--border);
  box-shadow: var(--shadow-gold);
  margin-top: 20px;
}

/* ===== HEADER DE NOVELA ===== */
.novela-header {
  text-align: center;
  margin-bottom: 32px;
}

.novela-portada {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 3px solid var(--accent);
  box-shadow: var(--shadow-gold);
  margin-bottom: 24px;
}

.novela-titulo {
  font-size: 2.5em;
  font-weight: bold;
  margin-bottom: 16px;
  color: var(--accent);
  text-shadow: 0 0 8px #ffd70099;
  line-height: 1.2;
}

.novela-generos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.genre-chip {
  display: inline-block;
  background: var(--accent);
  color: #000;
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.genre-chip:hover {
  background: #fff;
  color: var(--accent);
  border-color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* ===== INFORMACIÓN DE NOVELA ===== */
.novela-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.novela-descripcion {
  grid-column: 1 / -1;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid rgba(255, 215, 0, 0.2);
  line-height: 1.6;
  margin-bottom: 24px;
}

.novela-estado, .novela-peso {
  background: rgba(255, 215, 0, 0.1);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.novela-estado h4, .novela-peso h4 {
  color: var(--accent);
  margin-bottom: 8px;
  font-size: 1.1em;
}

.novela-estado p, .novela-peso p {
  color: var(--text-muted);
  font-size: 0.95em;
}

/* ===== ACCIONES DE NOVELA ===== */
.novela-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.action-btn {
  background: linear-gradient(135deg, var(--accent) 0%, #fff700 100%);
  color: #000;
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1em;
  text-decoration: none;
}

.action-btn:hover {
  background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.action-btn.favorito {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
  border-color: #ff6b6b;
}

.action-btn.favorito:hover {
  background: linear-gradient(135deg, #ff8e8e 0%, #ff6b6b 100%);
}

/* ===== ESTADÍSTICAS DE USUARIO ===== */
.user-stats-section {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 32px;
}

.user-stats-title {
  color: var(--accent);
  font-size: 1.2em;
  margin-bottom: 16px;
  text-align: center;
}

.user-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
}

.stat-item {
  background: linear-gradient(135deg, var(--accent) 0%, #fff700 100%);
  color: #000;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 600;
  font-size: 0.9em;
  border: 2px solid var(--accent);
}

/* ===== SECCIÓN VIP ===== */
.vip-section {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 32px;
  text-align: center;
}

.vip-badge {
  background: var(--accent);
  color: #000;
  padding: 8px 20px;
  border-radius: var(--radius-md);
  font-weight: bold;
  font-size: 1.1em;
  display: inline-block;
  margin-bottom: 16px;
  border: 2px solid var(--accent);
  box-shadow: 0 2px 8px #ffd70033;
}

.vip-instructions-btn {
  background: var(--accent);
  color: #000;
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 12px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 12px;
}

.vip-instructions-btn:hover {
  background: #fff;
  color: var(--accent);
  border-color: #fff;
  box-shadow: var(--shadow-hover);
}

/* ===== SPOILERS ===== */
.spoilers-section {
  margin-bottom: 32px;
}

.spoiler-btn {
  background: var(--accent);
  color: #000;
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 16px 32px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1em;
  width: 100%;
  margin-bottom: 16px;
}

.spoiler-btn:hover {
  background: #fff;
  color: var(--accent);
  border-color: #fff;
  box-shadow: var(--shadow-hover);
}

.spoiler-imgs {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.spoiler-imgs img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ===== ZONA DE DESCARGA ===== */
.downloads-section {
  margin-bottom: 32px;
}

.downloads-title {
  color: var(--accent);
  font-size: 1.3em;
  margin-bottom: 16px;
  text-align: center;
}

.download-section-title {
  font-size: 1.3em;
  font-weight: bold;
  margin: 24px 0 16px 0;
  color: var(--accent);
  text-align: center;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 8px;
}

/* ===== MODALES DE ENLACES ===== */
.modal-enlaces {
  position: fixed;
  z-index: 99999;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-enlaces-content {
  background: var(--card);
  border: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-gold);
}

.modal-enlaces-header {
  background: var(--accent);
  color: #000;
  padding: 20px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-enlaces-header h3 {
  margin: 0;
  font-size: 1.4em;
  font-weight: bold;
}

.cerrar-modal {
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  color: #000;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.cerrar-modal:hover {
  background: rgba(0, 0, 0, 0.1);
}

.modal-enlaces-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.enlace-btn {
  background: linear-gradient(90deg, var(--accent), #fff700);
  color: #000;
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1em;
  box-shadow: 0 2px 16px #ffd70055;
}

.enlace-btn:hover {
  background: linear-gradient(90deg, #fff, var(--accent));
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.enlace-btn.vip-bloqueado {
  background: linear-gradient(90deg, #666, #888);
  color: #ccc;
  border-color: #666;
  cursor: not-allowed;
  opacity: 0.7;
}

.enlace-btn.vip-bloqueado:hover {
  background: linear-gradient(90deg, #666, #888);
  transform: none;
  box-shadow: none;
}

.no-enlaces {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 20px;
}

.principal-btn {
  margin: 0 8px;
  min-width: 120px;
}

.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.descargar-btn {
  background: linear-gradient(90deg, var(--accent), #fff700);
  color: #000;
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1em;
  box-shadow: 0 2px 16px #ffd70055;
}

.descargar-btn:hover {
  background: linear-gradient(90deg, #fff, var(--accent));
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* ===== NAVEGACIÓN ===== */
.novela-navigation {
  text-align: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.back-btn {
  background: linear-gradient(135deg, #ff3cac 0%, #ff6b6b 100%);
  color: #fff;
  border: 2px solid #ff3cac;
  border-radius: var(--radius-md);
  padding: 12px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.back-btn:hover {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff3cac 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 60, 172, 0.4);
}

/* ===== MODALES ===== */
.modal-18 {
  position: fixed;
  z-index: 99999;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-18-content {
  background: var(--card);
  border: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-gold);
}

.modal-18-title {
  color: var(--accent);
  margin-bottom: 16px;
  font-size: 1.5em;
}

.modal-18-text {
  color: var(--text);
  font-size: 1.1em;
  margin-bottom: 24px;
  line-height: 1.5;
}

.modal-18-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.modal-18-btn {
  background: var(--accent);
  color: #000;
  font-weight: bold;
  padding: 12px 24px;
  font-size: 1.15em;
  border-radius: var(--radius-md);
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-18-btn:hover {
  background: #fff;
  color: var(--accent);
  border-color: #fff;
}

.modal-18-btn.danger {
  background: #ff3c3c;
  border-color: #ff3c3c;
}

.modal-18-btn.danger:hover {
  background: #ff6b6b;
  border-color: #ff6b6b;
}

.modal-18-warning {
  margin-top: 24px;
  color: var(--accent);
  font-size: 1em;
  background: rgba(255, 255, 255, 0.1);
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--accent);
  line-height: 1.4;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .novela-main {
    padding: 10px;
  }
  
  .novela-content {
    padding: 20px;
    margin-top: 10px;
  }
  
  .novela-titulo {
    font-size: 1.8em;
  }
  
  .novela-portada {
    max-height: 250px;
  }
  
  .novela-info {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .novela-actions {
    grid-template-columns: 1fr;
  }
  
  .user-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .downloads-grid {
    grid-template-columns: 1fr;
  }
  
  .genre-chip {
    font-size: 0.8em;
    padding: 6px 12px;
  }
  
  .action-btn, .descargar-btn {
    padding: 12px 16px;
    font-size: 0.9em;
  }
  
  .spoiler-imgs {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .novela-content {
    padding: 16px;
  }
  
  .novela-titulo {
    font-size: 1.5em;
  }
  
  .novela-portada {
    max-height: 200px;
  }
  
  .user-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-18-content {
    padding: 24px;
    margin: 20px;
  }
  
  .modal-18-buttons {
    flex-direction: column;
  }
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.novela-content {
  animation: fadeIn 0.5s ease-out;
}

/* ===== ESTADOS DE CARGA ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
  margin-left: 10px;
}

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

/* ===== ESTADOS DE ERROR ===== */
.error-message {
  background: rgba(255, 60, 60, 0.1);
  border: 1px solid #ff3c3c;
  border-radius: var(--radius-md);
  padding: 16px;
  color: #ff6b6b;
  text-align: center;
  margin: 20px 0;
}

/* ===== UTILIDADES ===== */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-24 {
  margin-bottom: 24px;
}

.mb-32 {
  margin-bottom: 32px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.mt-32 {
  margin-top: 32px;
} 

/* ===== RESPONSIVE PARA MODALES ===== */
@media (max-width: 768px) {
  .modal-enlaces-content {
    width: 95%;
    max-width: 400px;
    margin: 20px;
  }
  
  .modal-enlaces-header {
    padding: 16px;
  }
  
  .modal-enlaces-header h3 {
    font-size: 1.2em;
  }
  
  .modal-enlaces-body {
    padding: 20px;
  }
  
  .enlace-btn {
    padding: 14px 16px;
    font-size: 0.9em;
  }
  
  .principal-btn {
    margin: 4px;
    min-width: 100px;
    font-size: 0.9em;
  }
}

@media (max-width: 480px) {
  .modal-enlaces-content {
    width: 98%;
    margin: 10px;
  }
  
  .modal-enlaces-header {
    padding: 12px;
  }
  
  .modal-enlaces-header h3 {
    font-size: 1.1em;
  }
  
  .modal-enlaces-body {
    padding: 16px;
  }
  
  .enlace-btn {
    padding: 12px 14px;
    font-size: 0.85em;
  }
  
  .principal-btn {
    margin: 2px;
    min-width: 90px;
    font-size: 0.85em;
  }
} 
