/* =============================================
   PHYSIO4ALL - Premium Custom Styles
   ============================================= */

/* --- Base & Scroll --- */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    width: 100%;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #0d9488, #14b8a6);
    border-radius: 5px;
    border: 2px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0f766e, #0d9488);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #0d9488 #f1f5f9;
}

/* --- Selection --- */
::selection {
    background-color: #ccfbf1;
    color: #0f766e;
}

::-moz-selection {
    background-color: #ccfbf1;
    color: #0f766e;
}

/* --- Alpine.js Cloak --- */
[x-cloak] {
    display: none !important;
}

/* --- Glass Morphism --- */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* --- Gradient Text --- */
.gradient-text {
    background: linear-gradient(135deg, #0d9488 0%, #06b6d4 50%, #0d9488 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-gold {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 50%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Animated Gradient Background --- */
.gradient-bg {
    background: linear-gradient(-45deg, #0d9488, #14b8a6, #06b6d4, #0891b2);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Card Effects --- */
.card-lift {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s ease;
}

.card-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08),
                0 12px 24px -8px rgba(13, 148, 136, 0.06);
}

/* --- Staggered Animation Delays --- */
.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; }

/* --- Hero Overlay --- */
.hero-overlay {
    position: relative;
}

.hero-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.75) 0%,
        rgba(15, 23, 42, 0.45) 40%,
        rgba(13, 148, 136, 0.15) 100%
    );
    z-index: 1;
}

.hero-overlay > * {
    position: relative;
    z-index: 2;
}

/* --- Section Divider Wave --- */
.section-wave {
    position: relative;
    overflow: hidden;
}

.section-wave::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    height: 80px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80'%3E%3Cpath fill='%23ffffff' d='M0,40 C360,80 720,0 1080,40 C1260,60 1380,50 1440,40 L1440,0 L0,0 Z'/%3E%3C/svg%3E") no-repeat;
    background-size: cover;
    z-index: 1;
}

.section-wave-bottom {
    position: relative;
    overflow: hidden;
}

.section-wave-bottom::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 80px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80'%3E%3Cpath fill='%23ffffff' d='M0,40 C360,0 720,80 1080,40 C1260,20 1380,30 1440,40 L1440,80 L0,80 Z'/%3E%3C/svg%3E") no-repeat;
    background-size: cover;
    z-index: 1;
}

.section-wave-slate::before {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80'%3E%3Cpath fill='%23f8fafc' d='M0,40 C360,80 720,0 1080,40 C1260,60 1380,50 1440,40 L1440,0 L0,0 Z'/%3E%3C/svg%3E") no-repeat;
    background-size: cover;
}

/* --- WhatsApp Pulse Animation --- */
.whatsapp-pulse {
    animation: whatsappPulse 2s ease-in-out infinite;
}

@keyframes whatsappPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* --- Loading Skeleton --- */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Image Zoom on Hover --- */
.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.img-zoom:hover img {
    transform: scale(1.08);
}

/* --- Focus Visible Styles (Accessibility) --- */
:focus-visible {
    outline: 2px solid #0d9488;
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid #0d9488;
    outline-offset: 2px;
}

/* --- Smooth Link Underline --- */
.link-underline {
    position: relative;
    text-decoration: none;
}

.link-underline::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, #0d9488, #06b6d4);
    transition: width 0.3s ease;
}

.link-underline:hover::after {
    width: 100%;
}

/* --- Badge Glow --- */
.badge-glow {
    box-shadow: 0 0 12px rgba(13, 148, 136, 0.3);
}

/* --- Stat Counter --- */
.stat-number {
    font-variant-numeric: tabular-nums;
}

/* --- Service Card Icon Container --- */
.service-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
    transition: all 0.5s ease;
}

.group:hover .service-icon {
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    transform: scale(1.1) rotate(-3deg);
}

.group:hover .service-icon svg {
    color: white;
}

/* --- Testimonial Card --- */
.testimonial-card {
    position: relative;
}

.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 80px;
    font-family: 'Outfit', sans-serif;
    color: #ccfbf1;
    line-height: 1;
    z-index: 0;
}

/* --- CTA Section Background Pattern --- */
.cta-pattern {
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.04) 0%, transparent 40%);
}

/* --- Subtle Float Animation --- */
.float-animation {
    animation: floatUpDown 6s ease-in-out infinite;
}

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

/* --- Counter Flip Effect --- */
.counter-animate {
    display: inline-block;
    transition: transform 0.3s ease;
}

/* --- Navigation Active Indicator --- */
.nav-active-dot {
    position: relative;
}

.nav-active-dot::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #0d9488;
    border-radius: 50%;
}

/* --- Print Styles --- */
@media print {
    header,
    footer,
    .whatsapp-pulse,
    [x-data],
    button[aria-label="Voltar ao topo"] {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    main {
        padding: 0;
        margin: 0;
    }

    a[href]::after {
        content: ' (' attr(href) ')';
        font-size: 0.8em;
        color: #666;
    }

    .shadow-lg,
    .shadow-xl,
    .shadow-2xl {
        box-shadow: none !important;
    }

    img {
        max-width: 100% !important;
    }

    @page {
        margin: 2cm;
    }
}

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

    html {
        scroll-behavior: auto;
    }

    .whatsapp-pulse {
        animation: none;
    }

    .gradient-bg {
        animation: none;
    }

    .float-animation {
        animation: none;
    }
}
