/**
 * NovaSaúde - Custom CSS
 * Estilos customizados complementares ao Tailwind CSS
 */

/* Variáveis CSS customizadas */
:root {
    --primary-50: #f0f2f7;
    --primary-100: #e1e6ef;
    --primary-200: #c3cddf;
    --primary-300: #a5b4cf;
    --primary-400: #879bbf;
    --primary-500: #6982af;
    --primary-600: #031e70;
    --primary-700: #021a5f;
    --primary-800: #02164e;
    --primary-900: #01123d;
    
    --secondary-50: #fef2f2;
    --secondary-100: #fde2e2;
    --secondary-200: #fbc5c5;
    --secondary-300: #f9a8a8;
    --secondary-400: #f78b8b;
    --secondary-500: #f56e6e;
    --secondary-600: #cb1b1b;
    --secondary-700: #a31616;
    --secondary-800: #7b1111;
    --secondary-900: #530c0c;
    
    --accent-50: #fef9f0;
    --accent-100: #fdf3e1;
    --accent-200: #fbe7c3;
    --accent-300: #f19d39;
    --accent-400: #f19d39;
    --accent-500: #f19d39;
    --accent-600: #f19d39;
    --accent-700: #d47d2f;
    --accent-800: #b86d26;
    --accent-900: #9c5d1d;
}

/* Smooth scrolling global */
html {
    scroll-behavior: smooth;
}

/* Animações customizadas */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

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

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

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

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

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

/* Intersection Observer animations */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Gradientes customizados com transição orgânica */
.gradient-primary {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
}

/* Gradiente do logo: Vermelho com degradê */
.gradient-logo {
    background: linear-gradient(135deg, #b81717 0%, #cb1b1b 50%, #d83636 100%);
}

/* Gradiente accent baseado no logo */
.gradient-accent {
    background: linear-gradient(135deg, #b81717 0%, #cb1b1b 100%);
}

.gradient-hero {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 50%, var(--primary-800) 100%);
}

/* Gradiente orgânico: Azul → Vermelho → Vermelho-quente */
.gradient-organic {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--secondary-600) 50%, var(--accent-600) 100%);
}

/* Gradiente suave para elementos de destaque */
.gradient-warm {
    background: linear-gradient(135deg, #b81717 0%, #cb1b1b 100%);
}

/* Gradiente para botões principais */
.gradient-button {
    background: linear-gradient(135deg, #b81717 0%, #cb1b1b 50%, #d83636 100%);
}

.gradient-button:hover {
    background: linear-gradient(135deg, #a31616 0%, #b81717 50%, #cb1b1b 100%);
}

/* Efeitos de hover customizados */
.hover-lift {
    transition: all 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);
}

.hover-scale {
    transition: transform 0.3s ease;
}

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

/* Botões customizados */
.btn-primary {
    @apply bg-primary-600 hover:bg-primary-700 text-white font-semibold px-6 py-3 rounded-lg transition-all duration-200 shadow-md hover:shadow-lg transform hover:-translate-y-1;
}

.btn-accent {
    @apply bg-accent-500 hover:bg-accent-600 text-white font-semibold px-6 py-3 rounded-lg transition-all duration-200 shadow-md hover:shadow-lg transform hover:-translate-y-1;
}

.btn-outline {
    @apply border-2 border-primary-600 text-primary-600 hover:bg-primary-600 hover:text-white font-semibold px-6 py-3 rounded-lg transition-all duration-200;
}

/* Cards customizados */
.card {
    @apply bg-white rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 transform hover:-translate-y-2;
}

.card-gradient {
    @apply bg-gradient-to-br from-white to-gray-50 rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 transform hover:-translate-y-2;
}

/* Formulários customizados */
.form-input {
    @apply w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent transition-all duration-200;
}

.form-input:focus {
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-input.error {
    @apply border-red-500 focus:ring-red-500;
}

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

/* Modal customizado */
.modal-backdrop {
    backdrop-filter: blur(4px);
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal responsiva sem scroll interno */
#leadModal {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#leadModal .modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#leadModal .modal-content form {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#leadModal .step-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

#leadModal .step-content::-webkit-scrollbar {
    width: 4px;
}

#leadModal .step-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

#leadModal .step-content::-webkit-scrollbar-thumb {
    background: #435079;
    border-radius: 2px;
}

/* Botões sempre visíveis */
#leadModal form > .flex.justify-between {
    flex-shrink: 0;
    background: white;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* Melhor comportamento em mobile */
@media (max-width: 640px) {
    #leadModal .relative {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    #leadModal .modal-content {
        margin: 0;
        border-radius: 1rem;
        max-height: 95vh;
    }
    
    #leadModal .rounded-t-2xl {
        border-radius: 1rem 1rem 0 0;
    }
    
    #leadModal .step-content {
        max-height: 50vh;
    }
    
    /* Reduzir padding em mobile */
    #leadModal .p-6 {
        padding: 1rem;
    }
    
    #leadModal .bg-gradient-to-r {
        padding: 1.5rem 1rem;
    }
}

/* Progress bar customizado */
.progress-bar {
    transition: width 0.3s ease;
    background: linear-gradient(90deg, var(--accent-400) 0%, var(--accent-500) 100%);
}

/* Navegação customizada */
.nav-link {
    @apply text-gray-700 hover:text-primary-600 font-medium transition-colors duration-200 relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background-color: var(--primary-600);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

/* Dropdown customizado */
.dropdown {
    @apply relative;
}

.dropdown-content {
    @apply absolute top-full left-0 mt-2 w-64 bg-white rounded-lg shadow-lg border border-gray-200 opacity-0 invisible transition-all duration-200 transform translate-y-2;
}

.dropdown:hover .dropdown-content {
    @apply opacity-100 visible translate-y-0;
}

/* Notificações */
.notification {
    animation: notificationSlideIn 0.3s ease-out;
}

@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Skeleton loading */
.skeleton {
    @apply bg-gray-200 animate-pulse rounded;
}

.skeleton-text {
    @apply h-4 bg-gray-200 animate-pulse rounded;
}

.skeleton-avatar {
    @apply w-12 h-12 bg-gray-200 animate-pulse rounded-full;
}

/* Lazy loading images */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

img.lazy.loaded {
    opacity: 1;
}

/* Scrollbar customizado */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-600);
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* Acessibilidade */
.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;
}

/* Focus states melhorados */
.focus-visible:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

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

/* 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;
    }
}

/* Dark mode support (futuro) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
    }
}

/* Responsive utilities extras */
@media (max-width: 640px) {
    .mobile-full {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .mobile-text-center {
        text-align: center !important;
    }
    
    .mobile-hidden {
        display: none !important;
    }
}

/* Utilities para performance */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Efeitos especiais */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--secondary-600) 50%, var(--accent-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Gradiente de texto baseado no logo */
.text-gradient-logo {
    background: linear-gradient(135deg, #b81717 0%, #cb1b1b 50%, #d83636 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Player de vídeo customizado */
.video-player {
    width: 100%;
    aspect-ratio: 16/9;
    min-height: 400px;
    background: #1a1a1a;
    border-radius: 0;
}

.video-player video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #1a1a1a;
}

/* Garantir que o poster seja exibido corretamente */
.video-player video[poster] {
    background-image: url('/static/img/video-poster.webp');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #1a1a1a;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.shadow-glow {
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.3);
}

.shadow-glow-accent {
    box-shadow: 0 0 20px rgba(243, 115, 22, 0.3);
}

/* Selos de Autoridade */
.selos-autoridade {
    position: relative;
}

.selos-autoridade::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-500), var(--accent-500));
    border-radius: 1px;
}

.selo-item {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.selo-item::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.6s ease;
    z-index: 1;
}

.selo-item:hover::before {
    left: 100%;
}

.selo-item img {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.9;
    filter: brightness(1.5) contrast(1.3) saturate(1.2);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.selo-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.selo-item:hover img {
    opacity: 1;
    filter: brightness(1.4) contrast(1.3) saturate(1.2) drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
    transform: scale(1.05) rotate(2deg);
    background: rgba(255, 255, 255, 1);
}

.selo-item:nth-child(even):hover img {
    transform: scale(1.05) rotate(-2deg);
}

/* Animação de entrada dos selos */
.selo-item {
    opacity: 0;
    transform: translateY(20px);
    animation: sealFadeIn 0.6s ease-out forwards;
}

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

@keyframes sealFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsividade específica para selos */
@media (max-width: 768px) {
    .selos-autoridade .selo-item {
        margin: 0.5rem;
    }
    
    .selos-autoridade .selo-item img {
        height: 3rem;
    }
}

@media (max-width: 480px) {
    .selos-autoridade {
        padding: 1rem 0;
    }
    
    .selos-autoridade .selo-item img {
        height: 2.5rem;
    }
}

/* Foto do Diretor */
.diretor-foto {
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    max-width: 384px;
    max-height: 384px;
}

.diretor-foto::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(243, 115, 22, 0.15) 100%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.diretor-foto:hover::before {
    opacity: 1;
}

.diretor-foto img {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 0;
}

.diretor-foto:hover img {
    transform: scale(1.03);
}

/* Responsividade para foto do diretor */
@media (max-width: 1024px) {
    .diretor-foto {
        max-width: 320px;
        max-height: 320px;
    }
}

@media (max-width: 768px) {
    .diretor-foto {
        max-width: 280px;
        max-height: 280px;
    }
}

@media (max-width: 640px) {
    .diretor-foto {
        max-width: 240px;
        max-height: 240px;
    }
}

@media (max-width: 480px) {
    .diretor-foto {
        max-width: 200px;
        max-height: 200px;
    }
}

/* Efeito de estrelas */
.rating-stars {
    animation: starGlow 2s ease-in-out infinite alternate;
}

@keyframes starGlow {
    0% {
        filter: brightness(1);
    }
    100% {
        filter: brightness(1.2) drop-shadow(0 0 3px rgba(243, 115, 22, 0.5));
    }
}

/* Aspas do depoimento */
.quote-mark {
    transition: all 0.3s ease;
}

.quote-mark:hover {
    transform: scale(1.1);
    color: var(--accent-500);
}
