/* Estilos Personalizados para Invitación de Boda */

/* Familias de Fuentes */
.font-dancing {
    font-family: 'Dancing Script', cursive;
}

.font-playfair {
    font-family: 'Playfair Display', serif;
}

.font-inter {
    font-family: 'Inter', sans-serif;
}

/* Patrón de Fondo Personalizado - Tema Playa */
.bg-hero-pattern {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(251, 191, 36, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(34, 211, 238, 0.1) 0%, transparent 50%);
}

/* Desplazamiento Suave */
html {
    scroll-behavior: smooth;
}

/* Botones de Radio Personalizados */
.radio-custom {
    transition: all 0.3s ease;
}

input[type="radio"]:checked + .radio-custom {
    border-color: #0891b2;
    background-color: #ecfeff;
}

input[type="radio"]:checked + .radio-custom > div {
    display: block !important;
}

/* Efectos Hover de la Galería */
.gallery-item {
    cursor: pointer;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item:hover .absolute {
    background-color: rgba(0, 0, 0, 0.2);
}

.gallery-item:hover i {
    opacity: 1 !important;
}

/* Animaciones Personalizadas */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes pulse-soft {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.animate-pulse-soft {
    animation: pulse-soft 2s ease-in-out infinite;
}

/* Estilos del Contador Regresivo */
#countdown-timer > div {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Estilos de Formulario */
input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

/* Efectos Hover de Botones */
button {
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Estilos de Modal */
#bank-modal.show {
    display: flex !important;
}

/* Tipografía Responsive */
@media (max-width: 640px) {
    .font-dancing {
        line-height: 1.1;
    }
}

/* Fondos con Gradientes Personalizados - Tema Playa */
.bg-gradient-ocean {
    background: linear-gradient(135deg, #0891b2 0%, #22d3ee 100%);
}

.bg-gradient-soft {
    background: linear-gradient(135deg, #ecfeff 0%, #fafaf9 100%);
}

/* Espaciado de Secciones */
section {
    position: relative;
}

/* Elementos Decorativos */
.decorative-border {
    position: relative;
}

.decorative-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #0891b2, transparent);
}

/* Estados de Carga */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Estados de Éxito */
.success {
    background-color: #10b981 !important;
}

.success:hover {
    background-color: #059669 !important;
}

/* Estados de Error */
.error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

/* Barra de Desplazamiento Personalizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0891b2, #22d3ee);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0e7490, #06b6d4);
}

/* Estilos para Impresión */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    section {
        page-break-inside: avoid;
        margin-bottom: 2rem;
    }
}

/* Modo de Alto Contraste */
@media (prefers-contrast: high) {
    .text-gray-600 {
        color: #374151 !important;
    }
    
    .text-gray-700 {
        color: #1f2937 !important;
    }
    
    .bg-cyan-50 {
        background-color: #ecfeff !important;
    }
    
    .bg-amber-50 {
        background-color: #fffbeb !important;
    }
}

/* Movimiento Reducido */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Soporte para Modo Oscuro (Opcional) */
@media (prefers-color-scheme: dark) {
    /* Keep light theme for wedding invitation */
    /* This ensures the romantic light theme is maintained */
}

/* Focus Visible para Accesibilidad */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #0891b2;
    outline-offset: 2px;
}

/* Utilidades Personalizadas */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.backdrop-blur-light {
    backdrop-filter: blur(8px);
}

.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, #0891b2, #22d3ee) border-box;
}

/* Retrasos de Animación para Efectos Escalonados */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* Estilos del Reproductor de Música - Tema Playa */
#volume-slider {
    background: linear-gradient(to right, #0891b2 0%, #0891b2 70%, #e5e7eb 70%, #e5e7eb 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0891b2;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0891b2;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#progress-slider {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

#progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0891b2;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#progress-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#progress-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0891b2;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#progress-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Animación de Notas Musicales */
#music-notes {
    animation: musicFloat 2s ease-in-out infinite;
}

@keyframes musicFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Efecto Hover de la Portada del Álbum */
#album-cover {
    transition: transform 0.3s ease;
}

#album-cover:hover {
    transform: scale(1.05) rotate(2deg);
}

/* Efectos Hover de los Botones del Reproductor */
#play-pause-btn {
    position: relative;
    overflow: hidden;
}

#play-pause-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

#play-pause-btn:hover::before {
    width: 100%;
    height: 100%;
}

/* Animación del Botón de Volumen */
#volume-btn {
    transition: all 0.3s ease;
}

#volume-btn:hover {
    transform: scale(1.1);
    background-color: #f3f4f6;
}

/* Reproductor de Música Responsive */
@media (max-width: 640px) {
    #volume-slider {
        width: 60px;
    }
    
    .flex-1.mx-4 {
        margin-left: 0.75rem;
        margin-right: 0.75rem;
    }
    
    #play-pause-btn {
        width: 3.5rem;
        height: 3.5rem;
    }
    
    #play-pause-btn i {
        width: 1.75rem;
        height: 1.75rem;
    }
}

/* Optimizaciones para Móvil */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Ensure touch targets are large enough */
    button, input, select, textarea {
        min-height: 44px;
    }
    
    /* Optimize font sizes for mobile */
    .font-dancing {
        font-size: clamp(2rem, 8vw, 4rem);
    }
    
    /* Improve spacing on mobile */
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

/* Optimizaciones para Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Mejoras para Escritorio */
@media (min-width: 1024px) {
    /* Efecto parallax para la sección hero */
    #hero {
        background-attachment: scroll; /* evitar overflow en algunos navegadores */
    }
    
    /* Efectos hover para escritorio */
    .hover-lift:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    }
}

/* Animación de Carga */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Animación de Desvanecimiento */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Animación de Escala */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-in {
    animation: scaleIn 0.4s ease-out;
}

/* Imagen de Fondo del Hero con Fallbacks - Tema Playa */
.hero-bg-image {
    /* Gradiente de respaldo con colores de playa */
    background: linear-gradient(135deg, #cffafe 0%, #fafaf9 100%);
    
    /* Intentar cargar la imagen desde la carpeta images */
    background-image: url('https://images.pexels.com/photos/34241577/pexels-photo-34241577.png');
    background-size: cover;
    background-position: center 60%;
    background-repeat: no-repeat;
    /* fixed puede provocar overflow/scroll en iOS; lo desactivamos por estabilidad */
    background-attachment: scroll;
}

/* Ajuste de posicionamiento vertical del contenido del Hero
   (evitar offsets que causen overflow horizontal en ciertos móviles) */
#hero .relative.z-10 {
    margin-top: -35vh;
}

/* Mantener los botones en posición sin desplazar fuera del viewport */
#hero .flex.flex-col.sm\:flex-row {
    margin-top: 0;
    position: relative;
    top: 35vh;
}


/* Optimización para móvil - desactivar adjunto fijo para mejor rendimiento */
@media (max-width: 768px) {
    .hero-bg-image {
        background-attachment: scroll;
    }
    /* Subir la tarjeta en móvil, sin pegar al borde */
    #hero .relative.z-10 { margin-top: -25vh; }
    #hero .flex.flex-col.sm\:flex-row { top: 30vh; }
}

/* Estilos de la Tarjeta del Footer integrada */
.invitation-footer-card {
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Animación del corazón en el footer */
@keyframes heartbeat {
    0%, 100% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.1); 
    }
}

.made-with-love i {
    animation: heartbeat 2s ease-in-out infinite;
}

/* Efectos hover para los botones del footer */
.action-btn {
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.action-btn:hover::before {
    left: 100%;
}

/* Modal de carga - estilo acorde al tema */
#loading-modal {
    display: none;
}

#loading-modal.show {
    display: flex;
}

.loading-card {
    background: linear-gradient(135deg, rgba(236, 254, 255, 0.95) 0%, rgba(254, 243, 199, 0.95) 100%);
    border: 2px solid #0891b2;
    border-radius: 1.25rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.loading-heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

.loading-glow {
    box-shadow: 0 0 0 0 rgba(8, 145, 178, 0.6);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(8, 145, 178, 0.6); }
    70% { box-shadow: 0 0 0 20px rgba(8, 145, 178, 0); }
    100% { box-shadow: 0 0 0 0 rgba(8, 145, 178, 0); }
}

/* Responsive para la tarjeta del footer integrada */
@media (max-width: 768px) {
    .invitation-footer-card {
        padding: 1.5rem;
    }
    
    .footer-actions {
        width: 100%;
        max-width: 300px;
    }
    
    .action-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .invitation-footer-card {
        padding: 1.2rem;
    }
    
    .studio-name {
        font-size: 1rem;
    }
    
    .description {
        font-size: 0.8rem;
    }
    
    .action-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .made-with-love,
    .studio-credits {
        font-size: 0.8rem;
    }
}

/* Estilos mejorados para el slider de volumen - Tema Playa */
#volume-slider {
    background: linear-gradient(to right, #0891b2 0%, #0891b2 var(--volume-percent, 70%), #e5e7eb var(--volume-percent, 70%), #e5e7eb 100%);
    border-radius: 9999px;
    height: 8px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0891b2;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

#volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0891b2;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

#volume-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Estilos mejorados para el slider de progreso - Tema Playa */
#progress-slider {
    background: linear-gradient(to right, #0891b2 0%, #0891b2 var(--progress-percent, 0%), #e5e7eb var(--progress-percent, 0%), #e5e7eb 100%);
    border-radius: 9999px;
    height: 8px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

/* ======== Integración de invitation-footer.css (sin cambios de diseño) ======== */
/* Villa Digital Events - Footer Component CSS */
/* Este archivo mantiene el diseño original del footer sin afectar la invitación */

.invitation-footer-card {
    /* Tarjeta del footer integrada en la sección de agradecimiento */
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
    position: relative;
}

.invitation-footer-card .footer-content {
    padding: 2.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    background: linear-gradient(135deg, rgba(236, 254, 255, 0.8) 0%, rgba(254, 243, 199, 0.8) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(8, 145, 178, 0.2);
}

/* Left Side - Text Content */
.footer-text {
    flex: 1;
    text-align: left;
}

.made-with-love {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #0891b2;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.made-with-love i {
    font-size: 1rem;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.studio-credits {
    margin-bottom: 0.75rem;
}

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

.studio-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.studio-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0891b2;
    font-family: 'Poppins', sans-serif;
}

.description {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #6c757d;
    max-width: 320px;
}

/* Right Side - Action Buttons */
.footer-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 240px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.portfolio-btn {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(8, 145, 178, 0.3);
}

.portfolio-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.4);
    background: linear-gradient(135deg, #0e7490 0%, #0891b2 100%);
}

.whatsapp-btn {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.whatsapp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    background: linear-gradient(135deg, #128c7e 0%, #075e54 100%);
}

.action-btn i {
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1.5rem;
    }

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

    .made-with-love {
        justify-content: center;
    }

    .studio-info {
        justify-content: center;
    }

    .description {
        max-width: 100%;
        margin: 0 auto;
    }

    .footer-actions {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .action-btn {
        flex: 1;
        min-width: 140px;
    }
}

@media (max-width: 480px) {
    .footer-content {
        padding: 1.5rem 1rem;
    }

    .footer-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }
}

/* Asegurar que no afecte el resto de la página */
.invitation-footer-card * {
    box-sizing: border-box;
}

.invitation-footer-card a {
    cursor: pointer;
}

.invitation-footer-card a:focus {
    outline: 2px solid #0891b2;
    outline-offset: 2px;
}

#progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0891b2;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

#progress-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#progress-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0891b2;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

#progress-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Nuevo Collage Gallery - Distribución Específica */
.new-collage-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 150px 200px 200px 150px;
    gap: 1rem;
    height: 720px;
}

/* Elementos base de la galería */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
}

.gallery-item img {
    transition: all 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Posicionamiento específico según la distribución: 1 1 2 / 3 4 4 / 3 4 4 / 5 6 7 */
.img-1 {
    grid-column: 1 / 3;
    grid-row: 1;
}

.img-2 {
    grid-column: 3;
    grid-row: 1;
}

.img-3 {
    grid-column: 1;
    grid-row: 2 / 4;
}

.img-4 {
    grid-column: 2 / 4;
    grid-row: 2 / 4;
}

.img-5 {
    grid-column: 1;
    grid-row: 4;
}

.img-6 {
    grid-column: 2;
    grid-row: 4;
}

.img-7 {
    grid-column: 3;
    grid-row: 4;
}

/* Ajuste de posición de las imágenes dentro de sus marcos */
/* Para ajustar la posición de cada foto, usa object-position */
/* Valores: top, center, bottom para vertical | left, center, right para horizontal */
/* O usa porcentajes: 50% 20% (horizontal vertical) */

.img-1 img {
    object-position: center 70%; /* Centrada horizontal y verticalmente */
}

.img-2 img {
    object-position: center 60%;
}

.img-3 img {
    object-position: center top; /* Muestra más la parte superior */
}

.img-4 img {
    object-position: center 35%;
}

.img-5 img {
    object-position: center center;
}

.img-6 img {
    object-position: center 30%;
}

.img-7 img {
    object-position: center 65%;
}

/* Ajuste de posición para fotos en la sección "Nosotros" */
/* Foto de María (novia) */
img[src*="novia.jpg"] {
    object-position: center center;
}

/* Foto de Carlos (novio) */
img[src*="novio.jpg"] {
    object-position: center center;
}

/* Ajuste de posición para foto en la sección "Nuestra Historia" */
/* Foto principal de la historia */
#historia .w-full.h-96.object-cover {
    object-position: center center;
}

/* ========================================
   OPTIMIZACIONES DE RENDIMIENTO DE IMÁGENES
   ======================================== */

/* Optimización de carga de imágenes con placeholders - Tema Playa */
.gallery-item img,
#historia img {
    background: linear-gradient(135deg, #ecfeff 0%, #fafaf9 100%);
    transition: opacity 0.3s ease-in-out;
}

/* Estado de carga de imágenes */
.gallery-item img:not(.loaded),
#historia img:not(.loaded) {
    opacity: 0;
}

.gallery-item img.loaded,
#historia img.loaded {
    opacity: 1;
}

/* Animación suave al cargar */
@keyframes fadeInImage {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-item img.loaded {
    animation: fadeInImage 0.4s ease-out forwards;
}

/* Prevenir layout shift mientras las imágenes cargan */
.gallery-item {
    contain: content;
}

/* Optimizar rendimiento de hover y transiciones */
.gallery-item,
.gallery-item img {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Resetear will-change después del hover para liberar recursos */
.gallery-item:not(:hover) {
    will-change: auto;
}

/* Reducir el impacto de las sombras en el rendimiento usando filter */
.gallery-item {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.gallery-item:hover {
    filter: drop-shadow(0 12px 25px rgba(0, 0, 0, 0.2));
}

/* Optimizar scrolling suave - SOLO UNA BARRA DE SCROLL */
html {
    /* Evitar cualquier scroll horizontal a nivel global */
    overflow-x: clip !important;
    overflow-y: scroll;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 100%;
    height: 100%;
}

body {
    /* Asegurar que el body no cree barras extra */
    overflow-x: clip !important;
    overflow-y: visible;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Prevenir overflow en secciones sin crear barras de scroll */
section {
    position: relative;
    overflow: visible;
}

.container {
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

/* Defensa adicional: cualquier ancho basado en viewport no exceda el viewport real */
[class*="w-screen"],
[class*="max-w-screen"],
[class*="min-w-screen"] {
    max-width: 100vw;
}

/* Evitar que paddings sumen ancho extra en el layout */
body, section, .container, .flex, .grid {
    box-sizing: border-box;
}

/* Asegurar que ningún elemento sobresalga */
* {
    box-sizing: border-box;
}

/* Prevenir que las imágenes causen overflow */
img {
    max-width: 100%;
    height: auto;
}

/* Mejoras de rendimiento para animaciones */
@media (prefers-reduced-motion: no-preference) {
    .gallery-item:hover img {
        transform: scale(1.05) translateZ(0);
    }
}

/* Optimización: Reducir repaints en elementos decorativos */
.decorative-border::before,
#hero .absolute {
    content-visibility: auto;
}

/* Optimización: GPU acceleration para elementos que se animan frecuentemente */
button,
.action-btn {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Prevenir cambios de layout innecesarios */
img {
    display: block;
}

/* Responsive Design - Optimizado para Móviles */

/* Optimizaciones móviles generales */
@media (max-width: 768px) {
    /* Reducir efectos costosos en móviles */
    .gallery-item {
        will-change: auto;
        filter: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .gallery-item:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    /* Desactivar transformaciones costosas en móviles */
    .gallery-item:hover img {
        transform: none;
    }
    
    /* Reducir backdrop-blur en móviles para mejor rendimiento */
    .backdrop-blur-sm,
    .backdrop-blur-light {
        backdrop-filter: none;
    }
}

/* Tablet (768px y menos) */
@media (max-width: 768px) {
    .new-collage-gallery {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: 180px 180px 180px 180px;
        gap: 0.75rem;
        height: auto;
        padding: 0 1rem;
    }
    
    /* Layout 2x4 para tablets */
    .img-1 {
        grid-column: 1 / 3;
        grid-row: 1;
    }
    
    .img-2 {
        grid-column: 1;
        grid-row: 2;
    }
    
    .img-3 {
        grid-column: 2;
        grid-row: 2;
    }
    
    .img-4 {
        grid-column: 1 / 3;
        grid-row: 3;
    }
    
    .img-5 {
        grid-column: 1;
        grid-row: 4;
    }
    
    .img-6 {
        grid-column: 2;
        grid-row: 4;
    }
    
    .img-7 {
        grid-column: 1 / 3;
        grid-row: 5;
    }
}

/* Móvil (480px y menos) - Layout optimizado */
@media (max-width: 480px) {
    .new-collage-gallery {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: 140px 140px 140px 140px 140px;
        gap: 0.5rem;
        height: auto;
        padding: 0 0.5rem;
    }
    
    /* Layout 2x5 para móviles - más compacto */
    .img-1 {
        grid-column: 1 / 3;
        grid-row: 1;
        border-radius: 0.75rem;
    }
    
    .img-2 {
        grid-column: 1;
        grid-row: 2;
        border-radius: 0.75rem;
    }
    
    .img-3 {
        grid-column: 2;
        grid-row: 2;
        border-radius: 0.75rem;
    }
    
    .img-4 {
        grid-column: 1 / 3;
        grid-row: 3;
        border-radius: 0.75rem;
    }
    
    .img-5 {
        grid-column: 1;
        grid-row: 4;
        border-radius: 0.75rem;
    }
    
    .img-6 {
        grid-column: 2;
        grid-row: 4;
        border-radius: 0.75rem;
    }
    
    .img-7 {
        grid-column: 1 / 3;
        grid-row: 5;
        border-radius: 0.75rem;
    }
    
    /* Ajustes adicionales para móviles */
    .gallery-item {
        border-radius: 0.75rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .gallery-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    }
    
    .gallery-item img {
        transition: all 0.3s ease;
    }
    
    .gallery-item:hover img {
        transform: scale(1.03);
    }
}

/* Móvil muy pequeño (320px y menos) */
@media (max-width: 320px) {
    .new-collage-gallery {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(7, 120px);
        gap: 0.5rem;
        padding: 0 0.25rem;
    }
    
    .img-1,
    .img-2,
    .img-3,
    .img-4,
    .img-5,
    .img-6,
    .img-7 {
        grid-column: 1;
        grid-row: auto;
        border-radius: 0.5rem;
    }
}

/* Control de Volumen Vertical (Móvil) */
.volume-vertical-container {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 10px;
    z-index: 100;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.volume-vertical-container.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    animation: slideUpFade 0.3s ease forwards;
}

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

.volume-vertical-slider {
    background: linear-gradient(135deg, rgba(236, 254, 255, 0.95) 0%, rgba(254, 243, 199, 0.95) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid #0891b2;
    border-radius: 20px;
    padding: 1rem 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.volume-slider-vertical-input {
    -webkit-appearance: slider-vertical;
    appearance: slider-vertical;
    writing-mode: bt-lr;
    width: 8px;
    height: 120px;
    background: linear-gradient(to top, #0891b2 0%, #0891b2 var(--volume-percent, 70%), #e5e7eb var(--volume-percent, 70%), #e5e7eb 100%);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.volume-slider-vertical-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0891b2;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.volume-slider-vertical-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0891b2;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.volume-percentage {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0891b2;
}

/* Estilos responsive para el reproductor de música */
@media (max-width: 768px) {
    /* Ocultar slider horizontal en móvil */
    .volume-slider-horizontal {
        display: none !important;
    }
    
    /* Mostrar contenedor de volumen vertical solo en móvil */
    .volume-control-container {
        position: relative;
    }
    
    /* Ajustes del botón de play */
    #play-pause-btn {
        width: 56px !important;
        height: 56px !important;
    }
    
    #play-pause-btn i {
        width: 28px !important;
        height: 28px !important;
    }
    
    /* Ajustes del botón de volumen */
    #volume-btn {
        width: 44px !important;
        height: 44px !important;
    }
    
    /* Mejorar el progreso en móvil */
    #progress-slider {
        height: 12px;
    }
    
    /* Mejorar tamaño de texto de tiempo */
    .flex-1.mx-3 .text-xs {
        font-size: 0.75rem;
    }
    
    /* Asegurar que el player no se desborde */
    .bg-white.rounded-xl.p-6 {
        padding: 1rem !important;
    }
}

/* Desktop: mostrar horizontal, ocultar vertical */
@media (min-width: 769px) {
    .volume-vertical-container {
        display: none !important;
    }
    
    .volume-slider-horizontal {
        display: inline-block !important;
    }
}

@media (max-width: 480px) {
    /* Ajustes más pequeños para móviles */
    #play-pause-btn {
        width: 48px !important;
        height: 48px !important;
    }
    
    #play-pause-btn i {
        width: 24px !important;
        height: 24px !important;
    }
    
    #volume-btn {
        width: 40px !important;
        height: 40px !important;
    }
    
    #volume-btn i {
        width: 18px !important;
        height: 18px !important;
    }
    
    /* Reducir margen en móviles pequeños */
    .flex-1.mx-3 {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }
    
    /* Ajustar tamaño de thumbs en móvil */
    #progress-slider::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
    }
    
    #progress-slider::-moz-range-thumb {
        width: 20px;
        height: 20px;
    }
}

