/* Estilos adicionais e otimizações para o site do Dr. Enrico Rotter */

/* ============================================
   VARIÁVEIS CSS - Design System
   ============================================ */
:root {
    /* Cores Principais - Ajustadas para WCAG AA */
    --primary-dark: #1e3a8a;
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    
    --secondary-dark: #065f46;
    --secondary: #10b981;
    --secondary-light: #34d399;
    
    --accent-gold: #d97706;
    
    /* Tons Neutros - Melhor Contraste */
    --neutral-50: #fafafa;
    --neutral-100: #f5f5f5;
    --neutral-200: #e5e5e5;
    --neutral-300: #d4d4d4;
    --neutral-400: #a3a3a3;
    --neutral-500: #737373;
    --neutral-600: #525252;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --neutral-900: #171717;
    
    /* Tipografia */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;
    
    /* Espaçamento */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Transições */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ============================================
   ACESSIBILIDADE - Focus States
   ============================================ */
*:focus {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

button:focus,
a:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
}

/* Skip to main content - para leitores de tela */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1em;
    background-color: var(--primary);
    color: white;
    text-decoration: none;
}

.skip-to-main:focus {
    left: 50%;
    transform: translateX(-50%);
    top: 1em;
}

/* ============================================
   ANIMAÇÕES PERSONALIZADAS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* Classes de animação */
.animate-fade-in {
    animation: fadeInUp 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

.animate-pulse-custom {
    animation: pulse 2s infinite;
}

/* Otimizações de performance */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
    loading: lazy;
}

/* Melhorias na tipografia */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Efeitos de hover aprimorados */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Botões com efeitos especiais */
.btn-gradient {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-gradient::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;
}

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

.btn-gradient:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(5, 150, 105, 0.4);
}

/* Melhorias no chatbot */
.chatbot-message {
    animation: fadeInUp 0.4s ease-out;
}

.chatbot-option {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.chatbot-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.3s;
}

.chatbot-option:hover::before {
    left: 100%;
}

/* Indicadores de carregamento */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

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

/* Melhorias na responsividade */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .section-padding {
        padding: 3rem 0;
    }
    
    .floating-whatsapp {
        bottom: 15px;
        right: 15px;
        padding: 12px;
    }
    
    .chatbot-trigger {
        bottom: 75px;
        right: 15px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .testimonial-card {
        margin-bottom: 1rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
}

/* Melhorias na acessibilidade */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Otimizações para impressão */
@media print {
    .floating-whatsapp,
    .chatbot-trigger,
    nav,
    #chatbot-modal {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    .section-padding {
        padding: 1rem 0;
    }
}

/* Melhorias no contraste para acessibilidade */
.high-contrast {
    filter: contrast(1.2);
}

/* Efeitos de transição suaves */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gradientes        .gradient-bg {
            background: linear-gradient(135deg, #0f204d 0%, #1a4a8a 100%); /* Tons mais escuros de azul */
        }-webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Sombras personalizadas */
.shadow-custom {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.shadow-custom-lg {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Melhorias no mapa */
.map-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
}

.map-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 49%, rgba(59, 130, 246, 0.1) 50%, transparent 51%);
    pointer-events: none;
    z-index: 1;
}

/* Indicadores de status */
.status-online {
    position: relative;
}

.status-online::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid white;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Melhorias nos formulários */
.form-input {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Otimizações para dispositivos de alta densidade */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Melhorias na navegação */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #3b82f6;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link:focus::after {
    width: 100%;
}

/* ============================================
   MELHORIAS DE CONTRASTE - WCAG AA
   ============================================ */

/* Substituir classes Tailwind de baixo contraste */
.text-gray-500 {
    color: var(--neutral-600) !important; /* Era #6b7280, agora #525252 */
}

.text-gray-600 {
    color: var(--neutral-700) !important; /* Era #4b5563, agora #404040 */
}

.text-gray-700 {
    color: var(--neutral-800) !important; /* Aumentar contraste */
}

/* ============================================
   INDICADOR DE PROGRESSO DE LEITURA
   ============================================ */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 9999;
    transition: width 0.1s ease;
}

/* ============================================
   BOTÃO VOLTAR AO TOPO
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base), 
                transform var(--transition-base);
    z-index: 998;
    box-shadow: var(--shadow-lg);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    background: var(--primary-dark);
}

/* ============================================
   ESTATÍSTICAS - Nova Seção
   ============================================ */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    padding: 3rem 0;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 1rem;
    border: 1px solid #bae6fd;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.stat-item h3 {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.stat-item p {
    font-size: var(--font-size-lg);
    color: var(--neutral-700);
    font-weight: 500;
}

/* ============================================
   MELHORIAS NOS CARDS DE DEPOIMENTO
   ============================================ */
.testimonial-card {
    position: relative;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 4rem;
    color: var(--neutral-200);
    font-family: Georgia, serif;
    line-height: 1;
    z-index: 0;
}

.testimonial-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

/* ============================================
   MELHORIAS NOS CARDS DE SERVIÇOS
   ============================================ */
.service-card {
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* ============================================
   LOADING STATES PARA IMAGENS
   ============================================ */
.image-loading {
    background: linear-gradient(90deg, 
        var(--neutral-200) 0%, 
        var(--neutral-100) 50%, 
        var(--neutral-200) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* ============================================
   OTIMIZAÇÕES PARA MOTION REDUZIDO
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   MODO ESCURO (preparação futura)
   ============================================ */
@media (prefers-color-scheme: dark) {
    .dark-mode-ready {
        --background: var(--neutral-900);
        --foreground: var(--neutral-50);
        transition: background-color var(--transition-base), 
                    color var(--transition-base);
    }
}

/* ============================================
   MELHORIAS DE PERFORMANCE
   ============================================ */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Otimização de scroll */
.scroll-smooth {
    scroll-behavior: smooth;
}

@supports (scroll-behavior: smooth) {
    html {
        scroll-behavior: smooth;
    }
}

/* ============================================
   UTILITÁRIOS RESPONSIVOS
   ============================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .hero h1 {
        font-size: 2.5rem !important;
    }
    
    .service-card {
        padding: 1.5rem !important;
    }
    
    /* Ajustar grid para tablets */
    .grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .floating-whatsapp,
    .chatbot-trigger,
    .back-to-top,
    nav {
        display: none !important;
    }
    
    body {
        color: black;
        background: white;
    }
    
    a {
        text-decoration: underline;
    }
    
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        font-weight: normal;
    }
}
.nav-link.active::after {
    width: 100%;
}

/* Melhorias nos cards de depoimento */
.testimonial-card {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 4rem;
    color: #e2e8f0;
    font-family: serif;
    line-height: 1;
}

/* Otimizações para modo escuro (futuro) */
@media (prefers-color-scheme: dark) {
    .dark-mode-ready {
        transition: background-color 0.3s ease, color 0.3s ease;
    }
}

/* Melhorias na performance de scroll */
.scroll-smooth {
    scroll-behavior: smooth;
}

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

/* Indicadores de carregamento de imagem */
.image-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Melhorias nos botões de ação */
.cta-button {
    position: relative;
    overflow: hidden;
    transform: perspective(1px) translateZ(0);
}

.cta-button::before {
    content: '';
    position: absolute;
    z-index: -1;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 0.3s ease-out;
}

.cta-button:hover::before {
    transform: scaleX(1);
}

/* Melhorias na tipografia responsiva */
.responsive-text {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
}

.responsive-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

.responsive-subtitle {
    font-size: clamp(1.125rem, 3vw, 1.5rem);
}
