/* MODAL MODULE */
.media-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(147, 112, 219, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 80% 70%, rgba(218, 112, 214, 0.18) 0%, transparent 45%),
    radial-gradient(ellipse 60% 70% at 50% 50%, rgba(177, 156, 217, 0.15) 0%, transparent 40%),
    rgba(147, 112, 219, 0.25);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
  overscroll-behavior-y: contain;
  overflow: hidden;
  touch-action: pan-x pinch-zoom;
  /* GPU acceleration */
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.media-modal::before {
  content: '🌸';
  position: fixed;
  top: 30px;
  left: 30px;
  font-size: 2rem;
  opacity: 0.3;
  z-index: 1001;
  pointer-events: none;
  animation: modalFlowerFloat 6s ease-in-out infinite;
}

.media-modal::after {
  content: '🌺';
  position: fixed;
  bottom: 30px;
  right: 30px;
  font-size: 2rem;
  opacity: 0.3;
  z-index: 1001;
  pointer-events: none;
  animation: modalFlowerFloat 6s ease-in-out infinite 3s;
}

@keyframes modalFlowerFloat {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0.2;
  }
  50% {
    transform: translate(2px, -3px) rotate(5deg);
    opacity: 0.25;
  }
}

.modal-close {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  left: auto !important;
  bottom: auto !important;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(248, 244, 255, 0.85) 100%
  );
  backdrop-filter: blur(10px);
  color: var(--primary-purple);
  border: 2px solid rgba(255, 182, 193, 0.3);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 3003 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 
    0 4px 15px rgba(255, 182, 193, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  margin: 0 !important;
  transform: none !important;
}

.modal-close::before {
  content: '🌿';
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 0.8rem;
  opacity: 0.5;
  pointer-events: none;
  animation: leafSway 3s ease-in-out infinite;
}

@keyframes leafSway {
  0%, 100% {
    transform: rotate(-3deg);
    opacity: 0.4;
  }
  50% {
    transform: rotate(3deg);
    opacity: 0.5;
  }
}

.modal-close:hover {
  transform: rotate(90deg) scale(1.15);
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(221, 160, 221, 0.4);
  box-shadow: 
    0 6px 20px rgba(255, 182, 193, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.modal-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(5px);
  color: var(--primary-purple);
  border: 1px solid rgba(147, 112, 219, 0.2);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 3002;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modal-nav:hover {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(147, 112, 219, 0.4);
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

.modal-prev {
  left: 10px;
}

.modal-next {
  right: 10px;
}

.modal-content {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  position: relative;
  touch-action: pan-y;
  box-sizing: border-box;
  gap: 0;
  overflow: hidden;
  padding: 0;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 0;
  border: none;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 60% 40% at 10% 20%, rgba(147, 112, 219, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 50% 60% at 90% 80%, rgba(218, 112, 214, 0.06) 0%, transparent 45%),
    radial-gradient(ellipse 40% 50% at 50% 50%, rgba(177, 156, 217, 0.05) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
  border-radius: 20px;
  animation: modalContentBloom 20s ease-in-out infinite;
}

@keyframes modalContentBloom {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.02);
  }
}

.modal-media-container {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 20px;
  overflow: hidden;
  position: relative;
  background: transparent;
  touch-action: none;
  box-sizing: border-box;
}

.modal-media-container::before {
  content: '✨';
  position: absolute;
  top: 15px;
  left: 15px;
  font-size: 1.2rem;
  opacity: 0.2;
  z-index: 1;
  pointer-events: none;
  animation: modalSparkle 3s ease-in-out infinite;
}

.modal-media-container::after {
  content: '✨';
  position: absolute;
  bottom: 15px;
  right: 15px;
  font-size: 1.2rem;
  opacity: 0.2;
  z-index: 1;
  pointer-events: none;
  animation: modalSparkle 3s ease-in-out infinite 1.5s;
}

@keyframes modalSparkle {
  0%, 100% {
    opacity: 0.2;
    transform: scale(1) rotate(0deg);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.2) rotate(180deg);
  }
}

.modal-media-container img,
.modal-media-container video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
  border: none !important;
  outline: none !important;
  position: relative;
  z-index: 10;
  will-change: transform; /* Optimización para animaciones de zoom */
  visibility: hidden; /* Ocultar hasta que cargue para evitar flash */
  /* Prevenir líneas de cuadrícula al hacer zoom - renderizado suave */
  image-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  /* Prevenir artefactos de renderizado */
  -webkit-perspective: 1000;
  perspective: 1000;
}

/* Cuando la imagen está zoomed, permitir overflow */
.modal-media-container img[style*="scale"] {
  cursor: grab;
  /* Asegurar renderizado suave sin líneas de cuadrícula */
  image-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.modal-media-container img[style*="scale"]:active {
  cursor: grabbing;
}

/* Botón X para cerrar zoom - Estilo del tema */
.zoom-reset-button {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid rgba(255, 182, 193, 0.3);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 244, 255, 0.85) 100%);
  backdrop-filter: blur(10px);
  color: var(--primary-purple);
  cursor: pointer;
  z-index: 3004;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  line-height: 1;
  box-shadow: 0 4px 15px rgba(255, 182, 193, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.zoom-reset-button.active {
  display: flex;
}

.zoom-reset-button:hover {
  transform: rotate(90deg) scale(1.15);
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(221, 160, 221, 0.4);
  box-shadow: 0 6px 20px rgba(255, 182, 193, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.zoom-reset-button:active {
  transform: rotate(90deg) scale(0.95);
}

@media (max-width: 768px) {
  .zoom-reset-button {
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    font-size: 1.6rem;
  }
  
  .zoom-reset-button:hover {
    transform: none;
  }
}

/* Loading indicators siempre detrás del video */
.modal-media-container > div:not(#modal-video-player) {
  z-index: 1 !important;
}

#modal-video-player {
  z-index: 100 !important;
}

/* Modal Comments Container */
.modal-comments-container {
  width: 380px;
  max-width: 380px;
  min-width: 380px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  background: rgba(255, 255, 255, 0.98);
  border-left: 1px solid rgba(147, 112, 219, 0.15);
  display: flex !important;
  flex-direction: column;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 10;
}

.modal-comments-container.hidden {
  display: none !important;
}

.modal-comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  margin-bottom: 15px;
}

.modal-comments-form-container {
  flex-shrink: 0;
  padding-top: 15px;
  border-top: 1px solid rgba(147, 112, 219, 0.1);
}

/* Estilos para comentarios más pequeños pero legibles */
.modal-comments-container .comment-item {
  padding: 10px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  border: 1px solid rgba(147, 112, 219, 0.15);
  font-size: 0.85rem;
}

.modal-comments-container .comment-item .comment-author {
  font-size: 0.9rem;
  font-weight: 600;
  color: #9370db;
  margin-bottom: 4px;
}

.modal-comments-container .comment-item .comment-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #666;
  margin-bottom: 4px;
}

.modal-comments-container .comment-item .comment-text {
  font-size: 0.8rem;
  color: #333;
  line-height: 1.4;
  margin-bottom: 6px;
}

.modal-comments-container .comment-item .comment-date {
  font-size: 0.7rem;
  color: #999;
  margin-top: 6px;
}

@media (max-width: 1024px) {
  .modal-comments-container {
    width: 320px;
    max-width: 320px;
    min-width: 320px;
    padding: 15px;
  }
}

@media (max-width: 768px) {
  .modal-content {
    flex-direction: column;
  }
  
  .modal-info {
    right: 20px;
    max-width: calc(100% - 40px);
  }
  
  .modal-comments-container {
    width: 100%;
    max-width: 100%;
    min-width: 100%;
    height: 40vh;
    border-left: none;
    border-top: 1px solid rgba(147, 112, 219, 0.15);
  }
}

.modal-info {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-purple);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(147, 112, 219, 0.2);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 15px;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 100;
  font-size: 0.85rem;
  max-width: calc(100% - 40px);
  min-width: auto;
}

.modal-info::before {
  content: '💜';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.2;
  z-index: 0;
  pointer-events: none;
  animation: modalHeartFloat 4s ease-in-out infinite;
}

.modal-info::after {
  content: '💜';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.2;
  z-index: 0;
  pointer-events: none;
  animation: modalHeartFloat 4s ease-in-out infinite 2s;
}

@keyframes modalHeartFloat {
  0%, 100% {
    transform: translateY(-50%) scale(1);
    opacity: 0.2;
  }
  50% {
    transform: translateY(-50%) scale(1.1);
    opacity: 0.3;
  }
}

.modal-info-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 0;
  max-width: none;
  width: auto;
  gap: 4px;
  overflow: hidden;
  padding-right: 15px;
  padding-left: 15px;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  text-align: center;
}

.modal-info-content::before {
  content: '🌸';
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  opacity: 0.15;
  z-index: 0;
  pointer-events: none;
  animation: contentFlowerFloat 5s ease-in-out infinite;
}

@keyframes contentFlowerFloat {
  0%, 100% {
    transform: translateY(-50%) translateX(0) rotate(0deg);
    opacity: 0.15;
  }
  50% {
    transform: translateY(-50%) translateX(2px) rotate(10deg);
    opacity: 0.2;
  }
}

.modal-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-purple);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  width: 100%;
  padding: 0;
  box-sizing: border-box;
  text-align: left;
  line-height: 1.3;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.modal-info h3::before {
  content: '💜';
  position: absolute;
  left: -18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6rem;
  opacity: 0.2;
  z-index: 0;
  pointer-events: none;
}
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-family: "Quicksand", sans-serif;
}

.modal-info p {
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0;
  color: var(--accent-violet);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
  padding: 0;
  box-sizing: border-box;
  text-align: left;
  line-height: 1.2;
  font-family: "Quicksand", sans-serif;
}

/* Contenedor de botones del modal - mejorado */
#modal-buttons-container {
  display: flex !important;
  gap: 8px !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  width: auto !important;
  min-width: auto !important;
  max-width: none !important;
  flex-wrap: nowrap !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  box-sizing: border-box !important;
  position: relative !important;
  z-index: 1 !important;
  height: auto !important;
  align-self: center !important;
}

#modal-buttons-container::before {
  content: '✨';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  opacity: 0.3;
  z-index: 0;
  pointer-events: none;
  animation: buttonSparkle 3s ease-in-out infinite;
}

@keyframes buttonSparkle {
  0%, 100% {
    opacity: 0.3;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 0.5;
    transform: translateX(-50%) scale(1.2);
  }
}

/* Botones del modal - Mayor especificidad para sobrescribir admin.css */
.modal-info .modal-highlight-btn,
.modal-info .modal-date-btn,
.modal-info .highlight-btn,
.modal-info .date-btn,
#modal-buttons-container .modal-highlight-btn,
#modal-buttons-container .modal-date-btn,
#modal-buttons-container .highlight-btn,
#modal-buttons-container .date-btn {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(248, 244, 255, 0.9) 100%
  ) !important;
  border: 1.5px solid var(--border-purple) !important;
  box-shadow: 
    0 2px 8px var(--shadow-purple),
    inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(5px) !important;
  border-radius: 10px !important;
  backdrop-filter: blur(10px) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  vertical-align: middle !important;
  line-height: 1 !important;
}

.modal-info .modal-highlight-btn,
.modal-info .highlight-btn,
#modal-buttons-container .modal-highlight-btn,
#modal-buttons-container .highlight-btn {
  color: var(--primary-purple) !important;
}

.modal-info .modal-date-btn,
.modal-info .date-btn,
#modal-buttons-container .modal-date-btn,
#modal-buttons-container .date-btn {
  color: var(--primary-purple) !important;
}

.modal-info .modal-highlight-btn svg,
.modal-info .modal-date-btn svg,
.modal-info .highlight-btn svg,
.modal-info .date-btn svg,
#modal-buttons-container .modal-highlight-btn svg,
#modal-buttons-container .modal-date-btn svg,
#modal-buttons-container .highlight-btn svg,
#modal-buttons-container .date-btn svg {
  width: 18px !important;
  height: 18px !important;
  transition: transform 0.2s ease !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

.modal-info .modal-highlight-btn:hover,
.modal-info .modal-date-btn:hover,
.modal-info .highlight-btn:hover,
.modal-info .date-btn:hover,
#modal-buttons-container .modal-highlight-btn:hover,
#modal-buttons-container .modal-date-btn:hover,
#modal-buttons-container .highlight-btn:hover,
#modal-buttons-container .date-btn:hover {
  transform: translateY(-1px) scale(1.05) !important;
  box-shadow: 0 4px 12px var(--shadow-purple-dark) !important;
  border-color: var(--border-purple-dark) !important;
  background: var(--bg-white) !important;
  color: var(--primary-purple-dark) !important;
}

.modal-info .modal-highlight-btn:hover svg,
.modal-info .modal-date-btn:hover svg,
.modal-info .highlight-btn:hover svg,
.modal-info .date-btn:hover svg,
#modal-buttons-container .modal-highlight-btn:hover svg,
#modal-buttons-container .modal-date-btn:hover svg,
#modal-buttons-container .highlight-btn:hover svg,
#modal-buttons-container .date-btn:hover svg {
  transform: scale(1.1) !important;
}

.modal-info .modal-highlight-btn:active,
.modal-info .modal-date-btn:active,
.modal-info .highlight-btn:active,
.modal-info .date-btn:active,
#modal-buttons-container .modal-highlight-btn:active,
#modal-buttons-container .modal-date-btn:active,
#modal-buttons-container .highlight-btn:active,
#modal-buttons-container .date-btn:active {
  transform: translateY(0) scale(0.95) !important;
}

/* Responsive para modal-info */
@media (max-width: 768px) {
  .modal-info {
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
    padding: 12px 16px !important;
    min-height: 60px !important;
    gap: 12px !important;
    max-width: calc(100% - 40px) !important;
  }
  
  .modal-info-content {
    gap: 3px !important;
  }
  
  .modal-info h3 {
    font-size: 0.9rem !important;
    -webkit-line-clamp: 1 !important;
  }
  
  .modal-info p {
    font-size: 0.75rem !important;
  }
  
  #modal-buttons-container {
    gap: 6px !important;
  }
  
  .modal-highlight-btn,
  .modal-date-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
  }
  
  .modal-highlight-btn svg,
  .modal-date-btn svg {
    width: 16px !important;
    height: 16px !important;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Cuando el modal está abierto, prevenir pull-to-refresh */
body.modal-open {
  overscroll-behavior-y: none !important;
  touch-action: pan-x pinch-zoom !important;
  overflow: hidden !important;
}

html:has(body.modal-open) {
  overscroll-behavior-y: none !important;
}

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

/* Animación simplificada sin transformaciones costosas */
@keyframes fadeInSimple {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0.3rem;
  }

  header {
    margin-bottom: 0.3rem;
  }

  .calendar-section {
    padding: 0.5rem;
    border-radius: 12px;
  }

  .calendar-header {
    margin-bottom: 0.3rem;
  }

  .calendar-grid {
    gap: 0.2rem;
  }

  .calendar-day {
    padding: 0.1rem;
    border-radius: 6px;
  }

  .calendar-day.has-photos::after {
    bottom: 1px;
    right: 1px;
  }

  .gallery-section {
    padding: 1rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.8rem;
    padding-top: 70px;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .gallery-header {
    padding: 0.75rem;
    padding-top: max(0.75rem, env(safe-area-inset-top));
  }

  .gallery-header h2 {
    font-size: 1.3rem;
  }

  .close-btn {
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
  }

  .flower-decoration {
    width: 60px;
    height: 60px;
    opacity: 0.08;
  }

  /* Modal responsive */
  .modal-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .modal-nav {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .modal-prev {
    left: 10px;
  }

  .modal-next {
    right: 10px;
  }

  .modal-content {
    width: 98%;
    max-width: 98%;
    height: 96%;
    max-height: 96%;
    box-sizing: border-box;
  }

  .modal-media-container {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0.2rem;
  }

  .calendar-section {
    padding: 0.4rem;
  }

  .gallery-section {
    padding: 0.5rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
    padding-top: 65px;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  }

  .gallery-header {
    padding: 0.5rem;
    padding-top: max(0.5rem, env(safe-area-inset-top));
  }

  .gallery-header h2 {
    font-size: 0.9rem;
  }

  .close-btn {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
  }

  /* Modal extra small */
  .modal-nav {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .modal-close {
    width: 35px;
    height: 35px;
    font-size: 1.3rem;
  }

  .modal-content {
    width: 100%;
    max-width: 100%;
    height: 98%;
    max-height: 98%;
  }

  .modal-media-container {
    padding: 5px;
  }
  
  /* Estilos responsive de botones admin están en responsive.css - no duplicar aquí */
}

/* Video Loading Indicator */
.video-loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate3d(-50%, -50%, 0);
  text-align: center;
  z-index: 5;
  pointer-events: none;
  width: 90%;
  max-width: 320px;
  padding: 30px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  will-change: transform;
  backface-visibility: hidden;
}

/* Modal Video Player */
.modal-video-player {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: #1a1a2e;
  position: relative;
  z-index: 10;
}

.modal-video-player.loaded {
  opacity: 1;
  visibility: visible;
  display: block;
  z-index: 100;
}

/* Modal Image with Zoom */
.modal-image-zoom {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  cursor: zoom-in;
  user-select: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translate3d(0, 0, 0);
  transform-origin: center center;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.modal-image-zoom.loaded {
  opacity: 1;
  visibility: visible;
  display: block;
}

.modal-image-zoom.zoomed {
  cursor: grab;
}

.modal-image-zoom.zoomed:active {
  cursor: grabbing;
}

/* Image Loading Indicator */
.image-loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 1.2rem;
  text-align: center;
  z-index: 1;
}

/* Body State Classes */
body.modal-scroll-locked {
  overscroll-behavior-y: none;
  touch-action: pan-x pinch-zoom;
  overflow: hidden;
}

html:has(body.modal-scroll-locked) {
  overscroll-behavior-y: none;
}

/* Date Picker Modal */
.date-picker-modal {
  position: fixed;
  z-index: 999999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.date-picker-modal.reset-position {
  position: fixed;
  z-index: 999999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ============================================================================
