/* ============================================
   BITACORA CULTURAL - ESTILOS CSS COMPLETOS
   ============================================ */

/* ======================
   VARIABLES Y RESET
   ====================== */
:root {
  --primary: #2c3e50;
  --secondary: #ff6f61;
  --accent: #4b8b60;
  --light: #f8f9fa;
  --dark: #000000;
  --gray: #6c757d;
  --success: #28a745;
  --danger: #e74c3c;
  --warning: #ffc107;
  --blue-light: #4d7cff;
  --card-bg: #ffffff;
  --border-color: #e9ecef;

  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
  --shadow-hover: 0 15px 35px rgba(255, 111, 97, 0.15);
  --radius: 10px;
  --radius-sm: 6px;
  --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Montserrat", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ======================
   ESTRUCTURA BASICA
   ====================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 70px 0;
}

/* ======================
   HEADER Y NAVEGACION
   ====================== */
header {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 15px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

#public-view header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

#public-view > section:first-of-type {
  margin-top: 120px;
}

#public-view {
  padding-top: 0;
}

body.modal-open #public-view header {
  position: static;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-image {
  height: 50px;
  max-width: 180px;
}

.logo-image img {
  height: 100%;
  max-height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.logo p {
  font-size: 13px;
  color: #ff6f61;
  font-style: italic;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 20px;
  align-items: center;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
}

nav a:hover {
  color: #ff6f61;
  background: rgba(255, 255, 255, 0.1);
}

.admin-link {
  background: #ff6f61;
  color: white !important;
}

.admin-link:hover {
  background: #e55a50;
}

/* ======================
   MENU HAMBURGUESA (MOVIL)
   ====================== */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background: white;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* ======================
   LOGIN
   ====================== */
.login-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-form {
  background: white;
  padding: 40px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.login-form h2 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 10px;
}

.login-form p {
  text-align: center;
  color: #7f8c8d;
  margin-bottom: 30px;
}

/* ======================
   FORMULARIOS
   ====================== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #2c3e50;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
}

.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  min-height: 120px;
  resize: vertical;
}

/* ======================
   BOTONES
   ====================== */
.btn {
  display: inline-block;
  background: #ff6f61;
  color: white;
  padding: 12px 25px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  text-align: center;
}

.btn:hover {
  background: #e55a50;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 111, 97, 0.3);
}

.btn-large {
  padding: 15px 40px;
  font-size: 18px;
}

.btn-outline {
  background: transparent;
  border: 2px solid #ff6f61;
  color: #ff6f61;
}

.btn-outline:hover {
  background: #ff6f61;
  color: white;
}

/* ======================
   PANEL ADMIN
   ====================== */
#admin-panel {
  display: none;
  min-height: 100vh;
  background: #f5f7fa;
}

.admin-header {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 20px 0;
  margin-bottom: 30px;
}

.admin-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.tab-btn {
  background: #e9ecef;
  color: #495057;
  border: 2px solid #dee2e6;
  padding: 12px 25px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tab-btn:hover {
  background: #dee2e6;
}

.tab-btn.active {
  background: #ff6f61;
  color: white;
  border-color: #ff6f61;
}

.admin-section {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
  display: none;
}

.admin-section.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

body.admin-mode #anteriores {
  display: none !important;
}

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

.admin-section h3 {
  color: #2c3e50;
  font-size: 24px;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 3px solid #ff6f61;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ======================
   INPUT DE ARCHIVOS
   ====================== */
.file-input-container {
  position: relative;
  margin-bottom: 15px;
}

.file-input {
  width: 100%;
  padding: 12px 15px;
  border: 2px dashed #ddd;
  border-radius: 6px;
  background: #f9f9f9;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s;
}

.file-input:hover {
  border-color: #ff6f61;
  background: #fff9f8;
}

.file-input i {
  font-size: 24px;
  color: #ff6f61;
  margin-bottom: 10px;
  display: block;
}

.image-preview-container {
  margin-top: 15px;
  text-align: center;
}

.image-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: 6px;
  border: 2px solid #ddd;
  margin-top: 10px;
  display: none;
}

.image-preview.active {
  display: inline-block;
}

/* ======================
   LISTA DE ITEMS ADMIN
   ====================== */
.items-list {
  margin-top: 30px;
}

.item-card {
  background: white;
  border: 2px solid #e9ecef;
  border-left: 5px solid #ff6f61;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.item-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 20px rgba(255, 111, 97, 0.1);
  border-color: #ff6f61;
}

.item-details-container {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.note-image-small,
.issue-cover-small {
  width: 80px;
  height: 110px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #ddd;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.note-image-small img,
.issue-cover-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-content h4 {
  color: #2c3e50;
  font-size: 18px;
  margin-bottom: 8px;
  font-weight: 600;
}

.item-content p {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}

.category-badge {
  display: inline-block;
  background: #3498db;
  color: white;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 8px;
  margin-top: 5px;
}

/* ======================
   BOTONES DE ACCION ADMIN
   ====================== */
.item-actions-group {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.action-btn {
  padding: 10px 18px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  min-width: 100px;
  justify-content: center;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.btn-view {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
}

.btn-edit {
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
  color: #333;
}

.btn-delete {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
}

/* ======================
   MODALES
   ====================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  overflow-y: auto;
  padding: 20px;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 10px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-content h2 {
  color: #2c3e50;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #ff6f61;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #7f8c8d;
}

/* ======================
   REVISTA ACTUAL
   ====================== */
.current-issue {
  padding: 60px 0;
}

.section-title {
  font-family: "Montserrat", sans-serif;
  font-style: italic;
  font-size: 1.8rem;
  color: #2c3e50;
  text-align: center;
  margin-bottom: 35px;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: #4b8b60;
  margin: 10px auto 0;
  border-radius: 2px;
}

.issue-container {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.issue-cover {
  flex: 0 0 auto;
  max-width: 280px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.issue-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.issue-content {
  flex: 1;
}

.issue-content h3 {
  color: #2c3e50;
  font-size: 28px;
  margin-bottom: 15px;
}

.issue-meta {
  color: #ff6f61;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

.issue-description {
  font-size: 16px;
  line-height: 1.6;
  color: #555;
  margin-bottom: 30px;
}

.issue-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

/* ======================
   VISOR DE REVISTA ONLINE
   ====================== */
.magazine-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  z-index: 3000;
  overflow: hidden;
}

.magazine-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(44, 62, 80, 0.9);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 3001;
}

.magazine-header h3 {
  margin: 0;
  font-size: 18px;
}

.close-magazine {
  background: #ff6f61;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-magazine:hover {
  background: #e55a50;
}

.magazine-container {
  position: absolute;
  top: 60px;
  left: 0;
  width: 100%;
  height: calc(100% - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pdf-viewer-container {
  width: 100%;
  height: 100%;
  max-width: 3000px;
  background: #2c3e50;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.pdf-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.pdf-controls button {
  background: #2c3e50;
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
}

.pdf-controls button:hover {
  background: #ff6f61;
  transform: scale(1.05);
}

.pdf-controls select {
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid #ddd;
  background: white;
  font-size: 14px;
}

.page-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(44, 62, 80, 0.9);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

.loading-pdf {
  color: white;
  font-size: 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.loading-pdf i {
  font-size: 40px;
  color: #ff6f61;
}

.loading-pdf p {
  margin: 0;
}

/* ======================
   CATEGORIAS
   ====================== */
.categories {
  padding: 60px 0;
  background: #f8f9fa;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 25px;
  justify-items: center;
}

.category-card {
  width: 100%;
  max-width: 280px;
  background: #fff;
  border-radius: 10px;
  padding: 25px 20px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
  border-top: 3px solid #ff6f61;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.15);
}

.category-card i {
  font-size: 1.6rem;
  color: #ff6f61;
  margin-bottom: 12px;
}

.category-card h3 {
  font-family: "Montserrat", sans-serif;
  font-style: italic;
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: #2c3e50;
}

.category-card p {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
}

/* ======================
   NOTAS PERIODISTICAS
   ====================== */
.featured-notes {
  padding: 70px 0;
  background: #ffffff;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  align-items: stretch;
}

.note-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 360px;
  cursor: pointer;
  position: relative;
}

.note-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.15);
}

.note-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center 20%;
  flex-shrink: 0;
  background-color: #f0f0f0;
}

.note-card .note-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.95);
  max-height: 160px;
  overflow: hidden;
  transition: max-height 0.4s ease, background 0.3s ease;
}

.note-card:hover .note-content {
  max-height: 360px;
  background: rgba(255, 255, 255, 0.95);
  overflow-y: auto;
}

.note-category {
  display: inline-block;
  background: #ff6f61;
  color: #fff;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.note-card h4 {
  font-family: "Montserrat", sans-serif;
  font-style: italic;
  font-size: 1.1rem;
  color: #2c3e50;
  margin-bottom: 10px;
  padding: 0;
}

.note-card p {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 0;
  padding: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-card:hover p {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.note-meta {
  font-size: 0.75rem;
  color: #888;
  display: flex;
  justify-content: space-between;
  margin-top: auto;
}

/* ======================
   ESTADOS ADMIN MODE
   ====================== */
body.admin-mode #public-view {
  display: none !important;
}

body.admin-mode footer {
  display: none !important;
}

body.admin-mode .categories,
body.admin-mode .featured-notes,
body.admin-mode .category-notes,
body.admin-mode .current-issue,
body.admin-mode .past-issues {
  display: none !important;
}

body.admin-mode #admin-panel {
  display: block !important;
}

/* ======================
   MODAL DE NOTA
   ====================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  overflow-y: auto;
}

.modal-content-nota {
  background: #fff;
  margin: auto;
  border-radius: 10px;
  width: 90%;
  max-width: 600px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  animation: fadeIn 0.3s ease;
}

/* ======================
   CARRUSEL DE IMAGENES
   ====================== */
.carousel-container {
  position: relative;
  width: 100%;
  background-color: #f5f5f5;
  overflow: hidden;
}

.carousel-slides {
  position: relative;
  width: 100%;
  min-height: 250px;
}

.carousel-slide {
  display: none;
  width: 100%;
  animation: fadeIn 0.4s ease;
}

.carousel-slide.active {
  display: block;
}

.carousel-slide img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  background-color: #f5f5f5;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  z-index: 10;
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.carousel-prev {
  left: 10px;
}

.carousel-next {
  right: 10px;
}

.carousel-dots {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.carousel-dot.active {
  background: var(--secondary);
  transform: scale(1.2);
}

.carousel-dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* ======================
   PREVISUALIZACION MULTIPLE DE IMAGENES
   ====================== */
.images-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  margin-top: 15px;
  max-width: 100%;
}

.image-preview-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.remove-image-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(231, 76, 60, 0.9);
  color: white;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: background 0.2s ease;
}

.remove-image-btn:hover {
  background: #c0392b;
}

.existing-image-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(46, 204, 113, 0.9);
  color: white;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
}

.modal-body {
  padding: 25px 30px;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-body h4 {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 15px;
  line-height: 1.4;
}

#modal-text {
  font-size: 1rem;
  line-height: 1.8;
  color: #444;
  text-align: justify;
}

#modal-text p {
  margin-bottom: 1em;
}

#modal-text p:last-child {
  margin-bottom: 0;
}

.modal-body .note-meta {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--gray);
}

.close {
  color: #333;
  float: right;
  font-size: 28px;
  font-weight: bold;
  margin: 10px 15px 0 0;
  cursor: pointer;
}

.close:hover {
  color: #ff6f61;
}

/* ======================
   MODAL DE REVISTA
   ====================== */
.modal-content.revista-modal {
  background: #fff;
  max-width: 900px;
  width: 92%;
  border-radius: 16px;
  padding: 30px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: modalFadeUp 0.35s ease;
}

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

.modal-content .close {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  transition: color 0.2s;
  padding: 5px;
}

.modal-content .close:hover {
  color: #ff6f61;
}

.revista-modal .issue-container {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.revista-modal .issue-content {
  flex: 1;
  max-width: 420px;
}

.revista-modal h3 {
  font-size: 1.5rem;
  margin-bottom: 6px;
  color: #2c3e50;
}

.revista-modal .issue-meta {
  font-size: 0.85rem;
  color: #ff6f61;
  margin-bottom: 12px;
}

.revista-modal .issue-description {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.5;
}

.revista-modal .issue-actions {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.revista-modal .btn {
  width: 100%;
  text-align: center;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 0.9rem;
}

.revista-modal .issue-cover {
  max-width: 240px;
  overflow: hidden;
  border-radius: 10px;
  flex-shrink: 0;
}

.revista-modal .issue-cover img {
  width: 100%;
  height: auto;
  display: block;
}

/* ======================
   VISOR PDF - ANIMACIONES
   ====================== */
#pdf-canvas-container {
  width: 100% !important;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 20px;
  overflow-x: auto;
  perspective: 2000px;
  transform-style: preserve-3d;
}

#pdf-canvas-container canvas {
  margin: 0;
  transition: box-shadow 0.4s ease;
}

#pdf-canvas-container.flip-next {
  animation: flipNext 0.6s ease;
}

#pdf-canvas-container.flip-prev {
  animation: flipPrev 0.6s ease;
}

@keyframes flipNext {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(-12deg);
  }
}

@keyframes flipPrev {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(12deg);
  }
}

.pdf-book canvas {
  width: 100% !important;
  height: auto !important;
  display: block;
}

/* ======================
   FOOTER
   ====================== */
footer {
  background: #2c3e50;
  color: white;
  padding: 40px 0;
  text-align: center;
  margin-top: 50px;
}

footer p {
  font-size: 14px;
}

/* ======================
   REVISTAS ANTERIORES
   ====================== */
.past-issues {
  background: #f5f7fa;
}

.past-issues .container > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

/* ============================================
   RESPONSIVE - DESKTOP GRANDE (1200px+)
   ============================================ */
@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
}

/* ============================================
   RESPONSIVE - TABLET LANDSCAPE (1024px - 1199px)
   ============================================ */
@media (max-width: 1199px) {
  .container {
    max-width: 960px;
  }

  #public-view > section:first-of-type {
    margin-top: 100px;
  }

  .issue-container {
    gap: 30px;
  }

  .issue-cover {
    max-width: 250px;
  }

  .issue-content h3 {
    font-size: 24px;
  }
}

/* ============================================
   RESPONSIVE - TABLET (768px - 1023px)
   ============================================ */
@media (max-width: 1023px) {
  .container {
    max-width: 720px;
  }

  #public-view > section:first-of-type {
    margin-top: 90px;
  }

  section {
    padding: 50px 0;
  }

  .header-content {
    flex-direction: column;
    gap: 15px;
  }

  nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  nav a {
    padding: 6px 10px;
    font-size: 13px;
  }

  .issue-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .issue-cover {
    flex: 0 0 auto;
    width: 100%;
    max-width: 280px;
  }

  .issue-content h3 {
    font-size: 22px;
  }

  .issue-actions {
    justify-content: center;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
  }

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

  /* Admin */
  .item-card {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .item-details-container {
    flex-direction: column;
    text-align: center;
  }

  .item-actions-group {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .form-row {
    flex-direction: column;
  }

  .admin-nav {
    justify-content: center;
  }

  .tab-btn {
    padding: 10px 15px;
    font-size: 13px;
  }
}

/* ============================================
   RESPONSIVE - MOVIL GRANDE (576px - 767px)
   ============================================ */
@media (max-width: 767px) {
  .container {
    padding: 0 15px;
  }

  #public-view > section:first-of-type {
    margin-top: 80px;
  }

  section {
    padding: 40px 0;
  }

  /* Header y Menu */
  .header-content {
    flex-direction: row;
    justify-content: space-between;
    position: relative;
  }

  .menu-toggle {
    display: flex;
  }

  nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    padding: 80px 30px 30px;
    transition: right 0.3s ease;
    z-index: 999;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
  }

  nav.active {
    right: 0;
  }

  nav ul {
    flex-direction: column;
    gap: 0;
  }

  nav li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  nav a {
    display: block;
    padding: 15px 0;
    font-size: 16px;
  }

  .logo-image {
    height: 40px;
  }

  .logo p {
    display: none;
  }

  /* Secciones */
  .section-title {
    font-size: 1.3rem;
    margin-bottom: 25px;
  }

  .issue-cover {
    max-width: 220px;
  }

  .issue-content h3 {
    font-size: 20px;
  }

  .issue-meta {
    font-size: 16px;
  }

  .issue-description {
    font-size: 14px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .issue-actions {
    flex-direction: column;
    width: 100%;
  }

  .issue-actions .btn {
    width: 100%;
  }

  /* Categorias y Notas */
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .category-card {
    max-width: 100%;
    padding: 20px 15px;
  }

  .category-card h3 {
    font-size: 1rem;
  }

  .notes-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .note-card {
    max-width: 100%;
  }

  .note-card img {
    height: 180px;
  }

  /* Modales */
  .modal-content-nota img {
    max-height: 280px;
  }

  .revista-modal .issue-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .revista-modal .issue-cover {
    max-width: 200px;
  }

  .revista-modal .issue-content {
    max-width: 100%;
  }

  /* Admin */
  .admin-section {
    padding: 20px 15px;
  }

  .admin-section h3 {
    font-size: 18px;
  }

  .action-btn {
    padding: 8px 12px;
    font-size: 12px;
    min-width: auto;
  }

  .action-btn span {
    display: none;
  }

  /* PDF Viewer */
  .magazine-header {
    padding: 10px 15px;
  }

  .magazine-header h3 {
    font-size: 14px;
  }

  .pdf-controls {
    top: 10px;
    right: 10px;
    padding: 5px;
    gap: 5px;
  }

  .pdf-controls button {
    width: 35px;
    height: 35px;
  }

  #zoom-select,
  #rotate-left,
  #rotate-right,
  #fullscreen-btn {
    display: none;
  }
}

/* ============================================
   RESPONSIVE - MOVIL PEQUENO (menos de 576px)
   ============================================ */
@media (max-width: 575px) {
  .container {
    padding: 0 12px;
  }

  #public-view > section:first-of-type {
    margin-top: 70px;
  }

  section {
    padding: 30px 0;
  }

  header {
    padding: 10px 0;
  }

  .logo-image {
    height: 35px;
  }

  .section-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
  }

  .issue-cover {
    max-width: 180px;
  }

  .issue-content h3 {
    font-size: 18px;
  }

  .issue-meta {
    font-size: 14px;
  }

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

  .category-card {
    padding: 18px 15px;
  }

  .note-card img {
    height: 160px;
  }

  .note-card h4 {
    font-size: 1rem;
  }

  /* Login */
  .login-form {
    padding: 30px 20px;
  }

  .login-form h2 {
    font-size: 20px;
  }

  /* Modal */
  .modal-content {
    padding: 20px 15px;
  }

  .modal-content-nota img {
    max-height: 200px;
  }

  .modal-body {
    padding: 15px;
  }

  /* Admin */
  .tab-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .tab-btn i {
    display: none;
  }

  .note-image-small,
  .issue-cover-small {
    width: 60px;
    height: 80px;
  }

  .item-content h4 {
    font-size: 16px;
  }

  .item-content p {
    font-size: 13px;
  }

  /* Footer */
  footer {
    padding: 30px 0;
  }

  footer p {
    font-size: 12px;
  }
}

/* ============================================
   PDF VIEWER - RESPONSIVE ESPECIFICO
   ============================================ */
@media (max-width: 1023px) {
  .magazine-container {
    top: 55px;
    height: calc(100% - 55px);
    padding: 10px;
  }

  .pdf-viewer-container {
    border-radius: 0;
  }

  .pdf-canvas-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: auto;
  }

  .pdf-canvas-container canvas {
    max-width: 100%;
    height: auto !important;
  }

  #prev-page,
  #next-page {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 45px;
    height: 45px;
  }

  #prev-page {
    left: 10px;
  }

  #next-page {
    right: 10px;
  }

  .page-counter {
    bottom: 10px;
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* ============================================
   UTILIDADES
   ============================================ */
.text-center {
  text-align: center;
}

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

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

.mt-1 {
  margin-top: 1rem;
}

.mt-2 {
  margin-top: 2rem;
}

.mt-3 {
  margin-top: 3rem;
}

.mb-1 {
  margin-bottom: 1rem;
}

.mb-2 {
  margin-bottom: 2rem;
}

.mb-3 {
  margin-bottom: 3rem;
}

.d-block {
  display: block;
}

.d-flex {
  display: flex;
}

.d-none {
  display: none;
}

.w-100 {
  width: 100%;
}

.h-100 {
  height: 100%;
}

/* Overlay para menu movil */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

.menu-overlay.active {
  display: block;
}

/* Ocultar scroll cuando menu esta abierto */
body.menu-open {
  overflow: hidden;
}