/* ===================================
   EFECTOS PREMIUM Y ANIMACIONES 2026
   =================================== */

/* Botón Volver Arriba Flotante */
#scrollToTopBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
    transition: all var(--transition-slow);
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
}

#scrollToTopBtn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#scrollToTopBtn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

#scrollToTopBtn:active {
    transform: translateY(-2px) scale(1.05);
}

/* Sección de Estadísticas Animadas */
.stats-section {
    background-image: url('../img/Constructora Domun Spa/Unihue 2.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(26, 95, 95, 0.92) 0%, 
        rgba(46, 125, 125, 0.88) 50%,
        rgba(26, 95, 95, 0.92) 100%
    );
    z-index: 1;
}

.stats-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    z-index: 1;
}

.stats-section .container {
    position: relative;
    z-index: 2;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
}

.stat-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    padding: 45px 30px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 180, 0, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.12);
}

/* Icono con Wrapper */
.stat-icon-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 25px;
}

.stat-icon {
    font-size: 3.5em;
    color: var(--accent-color);
    display: inline-block;
    position: relative;
    z-index: 2;
    animation: iconPulse 2s ease-in-out infinite;
}

.stat-icon-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 180, 0, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
    animation: iconBgPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes iconBgPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

/* Contenido del Número */
.stat-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 15px;
}

.stat-number {
    font-size: 4em;
    font-weight: 800;
    color: var(--white);
    line-height: 1;
    font-family: 'Poppins', sans-serif;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.stat-plus {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--accent-color);
    margin-top: -10px;
}

.stat-label {
    font-size: 1.15em;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

.stat-description {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    line-height: 1.5;
    margin-top: 5px;
}

/* Responsive para Estadísticas */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .stats-section {
        padding: 60px 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stat-card {
        padding: 35px 25px;
    }
    
    .stat-icon {
        font-size: 2.8em;
    }
    
    .stat-number {
        font-size: 3em;
    }
    
    .stat-plus {
        font-size: 2em;
    }
}

/* Timeline de Proceso */
.process-timeline {
    padding: 100px 0;
    background: var(--light-grey);
    position: relative;
}

.timeline-container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-primary);
    transform: translateX(-50%);
}

.timeline-item {
    display: flex;
    margin-bottom: 60px;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.timeline-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-content {
    flex: 1;
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    margin: 0 30px;
    position: relative;
    transition: all var(--transition-normal);
}

.timeline-content:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    transform: translateY(-50%);
}

.timeline-item:nth-child(odd) .timeline-content::before {
    right: -40px;
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -40px;
}

.timeline-number {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5em;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.timeline-title {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--dark-grey);
    margin-bottom: 15px;
}

.timeline-description {
    color: #666;
    line-height: 1.6;
}

/* Tarjetas 3D con Efecto Hover */
.card-3d {
    perspective: 1000px;
    transition: all var(--transition-normal);
}

.card-3d-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-3d:hover .card-3d-inner {
    transform: rotateY(5deg) rotateX(5deg);
}

/* Efectos de Partículas en el Fondo */
.particles-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 50%;
    opacity: 0.3;
    animation: particle-float 15s infinite;
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100px) translateX(100px);
        opacity: 0;
    }
}

/* Sección de Testimonios */
.testimonials-section {
    padding: 100px 0;
    background: var(--white);
    position: relative;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.testimonial-card {
    background: var(--white);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-md);
    position: relative;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
}

.testimonial-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary-color);
}

.testimonial-quote {
    font-size: 3em;
    color: var(--secondary-color);
    opacity: 0.2;
    line-height: 1;
    margin-bottom: 20px;
}

.testimonial-text {
    font-size: 1.1em;
    line-height: 1.8;
    color: #555;
    margin-bottom: 25px;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 15px;
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5em;
    font-weight: 700;
}

.author-info h4 {
    font-size: 1.1em;
    color: var(--dark-grey);
    margin-bottom: 5px;
}

.author-info p {
    font-size: 0.9em;
    color: #888;
}

/* Efectos de Texto Gradiente */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animación de Entrada desde Abajo */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animación de Entrada desde la Izquierda */
.fade-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease;
}

.fade-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Animación de Entrada desde la Derecha */
.fade-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.6s ease;
}

.fade-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Efecto de Zoom al Hacer Scroll */
.zoom-in {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s ease;
}

.zoom-in.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .timeline-line {
        left: 30px;
    }
    
    .timeline-item,
    .timeline-item:nth-child(even) {
        flex-direction: row;
    }
    
    .timeline-content {
        margin-left: 80px;
        margin-right: 0;
    }
    
    .timeline-number {
        left: 30px;
        transform: translateX(-50%);
    }
    
    .timeline-item:nth-child(odd) .timeline-content::before,
    .timeline-item:nth-child(even) .timeline-content::before {
        left: -40px;
        right: auto;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    #scrollToTopBtn {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 1.2em;
    }
}
