/**
 * CapStyle Website Enhancements Styles
 * Includes: Animations, Accessibility, Mobile optimization, WhatsApp widget
 */

/* ===== VARIABLES ===== */
:root {
    --animation-duration: 0.6s;
    --animation-easing: cubic-bezier(0.4, 0, 0.2, 1);
    --whatsapp-green: #25D366;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
}

/* ===== WHATSAPP FLOATING BUTTON ===== */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--whatsapp-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: all 0.3s var(--animation-easing);
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 30px rgba(37, 211, 102, 0.4);
}

.whatsapp-float svg {
    width: 32px;
    height: 32px;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
}

/* ===== FOOTER SOCIAL LINKS ===== */
.footer-social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
    transition: all 0.3s var(--animation-easing);
    padding: 4px 0;
}

.footer-social-link:hover {
    color: var(--whatsapp-green);
    transform: translateX(5px);
}

.footer-social-link svg {
    flex-shrink: 0;
    transition: transform 0.3s var(--animation-easing);
}

.footer-social-link:hover svg {
    transform: scale(1.2);
}

.icon-whatsapp {
    color: var(--whatsapp-green);
}

.icon-instagram {
    color: #E1306C;
}

/* ===== ACCESSIBILITY: SKIP LINK ===== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #ffbf47;
    outline-offset: 0;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Scroll Animation Classes */
section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--animation-duration) var(--animation-easing),
                transform var(--animation-duration) var(--animation-easing);
}

section.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.benefit-card,
.step,
.testimonial-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--animation-duration) var(--animation-easing),
                transform var(--animation-duration) var(--animation-easing);
}

.benefit-card.animate-in,
.step.animate-in,
.testimonial-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation delays */
.benefit-card:nth-child(1) { transition-delay: 0.1s; }
.benefit-card:nth-child(2) { transition-delay: 0.2s; }
.benefit-card:nth-child(3) { transition-delay: 0.3s; }

.step:nth-child(1) { transition-delay: 0.1s; }
.step:nth-child(2) { transition-delay: 0.2s; }
.step:nth-child(3) { transition-delay: 0.3s; }
.step:nth-child(4) { transition-delay: 0.4s; }

/* ===== IMPROVED HOVER EFFECTS ===== */
.btn {
    transition: all 0.3s var(--animation-easing);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

/* Card Hover Effects */
.benefit-card,
.testimonial-card,
.price-card {
    transition: transform 0.3s var(--animation-easing), 
                box-shadow 0.3s var(--animation-easing);
}

.benefit-card:hover,
.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ===== MOBILE OPTIMIZATION ===== */
@media (max-width: 768px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
    
    .whatsapp-float svg {
        width: 26px;
        height: 26px;
    }
    
    /* Touch target sizing */
    button,
    .btn,
    a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Improved mobile spacing */
    section {
        padding: 3rem 1rem;
    }
}

/* ===== FOCUS INDICATORS (Accessibility) ===== */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid #ffbf47;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .whatsapp-float {
        animation: none;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
        --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
        --shadow-lg: 0 10px 20px rgba(0,0,0,0.4);
    }
}

/* ===== LOADING STATE ===== */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== PRINT STYLES ===== */
@media print {
    .whatsapp-float,
    .lang-nav,
    .skip-link {
        display: none !important;
    }
    
    section {
        page-break-inside: avoid;
    }
}
