/* Configurações Globais e Variáveis */
:root {
    --primary-color: #0ea5e9; /* sky-500 */
    --primary-hover-color: #0284c7; /* sky-600 */
}

/* Base Reset & Smoothness */
html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
}

/* Utilitários de Gradiente e Efeitos */
.gradient-bg {
    background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
}

.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-glow:hover {
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.6);
}

/* Animações Keyframes */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes pulse-slow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.animate-pulse-slow {
    animation: pulse-slow 8s infinite;
}

@keyframes slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.animate-slide-up {
    animation: slide-up 0.5s ease-out forwards;
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up {
    animation: fade-in-up 0.4s ease-out forwards;
}

/* Elemento Flutuante do App (Mockup) */
.floating-element {
    animation: float 8s ease-in-out infinite;
}

/* Estilos Swiper */
.hero-slider {
    width: 100%;
    height: 90vh;
    min-height: 600px;
    max-height: 900px;
    color: white;
}

@media (max-width: 768px) {
    .hero-slider {
        height: 85vh;
        min-height: 500px;
    }
}

.swiper-slide {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.slide-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transform: scale(1.1); /* Zoom effect start */
    transition: transform 10s ease; /* Slow zoom effect */
}

.swiper-slide-active .slide-background {
    transform: scale(1);
}

.slide-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.7) 100%);
    z-index: 2;
}

/* Botões do Swiper */
.swiper-button-prev, .swiper-button-next {
    color: white;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}
.swiper-button-prev:after, .swiper-button-next:after {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Cards (Estudos, Infra, etc) */
.study-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.study-card:hover {
    transform: translateY(-8px);
}

/* Infra Items */
.infra-item {
    background-color: white;
    padding: 1.5rem;
    text-align: center;
    border-radius: 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #4b5563;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}
.infra-item:hover {
    border-color: #bae6fd;
    box-shadow: 0 10px 30px -10px rgba(14, 165, 233, 0.2);
    transform: translateY(-4px);
    color: var(--primary-color);
}
.infra-item i {
    color: var(--primary-color);
    width: 28px;
    height: 28px;
    margin-bottom: 0.5rem;
}

/* Scroller Infinito */
.scroller {
    max-width: 1200px;
    margin: auto;
    overflow: hidden;
    -webkit-mask: linear-gradient(90deg, transparent, white 10%, white 90%, transparent);
    mask: linear-gradient(90deg, transparent, white 10%, white 90%, transparent);
}
.scroller__inner {
    display: flex;
    flex-wrap: nowrap;
    animation: scroll 40s linear infinite;
}
.scroller:hover .scroller__inner {
    animation-play-state: paused;
}
@keyframes scroll {
    to { transform: translate(calc(-50% - 1rem)); }
}

/* FAQ */
.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
}
.faq-btn.active .icon {
    transform: rotate(180deg);
}
.faq-btn.active {
    background-color: #f8fafc;
}

/* Mobile Menu & ScrollSpy */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, opacity 0.4s ease;
    opacity: 0;
}
#mobile-menu.open {
    max-height: 600px;
    opacity: 1;
}
nav a.active {
    color: var(--primary-color) !important;
}
nav a.active span {
    width: 100%;
}

/* Journal / Artigo Premium */
.journal-article { font-family: var(--font-serif); }
.journal-article p { font-size: 1.125rem; line-height: 1.8; margin-bottom: 1.5rem; color: #374151; }
.journal-article p:first-of-type::first-letter { font-size: 3.5rem; float: left; margin-right: 0.75rem; line-height: 0.8; font-weight: 700; color: var(--primary-color); }
.journal-header h1 { font-family: var(--font-serif); font-weight: 700; letter-spacing: -0.025em; }

/* Cookies */
#cookie-banner.show {
    transform: translateY(0);
}

/* Chatbot Styles */
.scrollbar-thin::-webkit-scrollbar {
    width: 5px;
}
.scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 20px;
}

/* Modal Animations */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalScaleIn {
    from { 
        opacity: 0; 
        transform: scale(0.95) translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

.animate-modal-fade {
    animation: modalFadeIn 0.3s ease-out forwards;
}

.animate-modal-scale {
    animation: modalScaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; /* Efeito elástico sutil */
}

/* Responsividade Fina */
@media (max-width: 640px) {
    h1 { font-size: 2.5rem !important; }
    h2 { font-size: 2rem !important; }
    
    /* Ajustes específicos para o modal do chat em mobile */
    #chat-widget {
        right: 1rem !important;
        left: 1rem !important;
        width: auto !important;
        bottom: 80px !important;
        height: 60vh !important;
    }
}

/* ==========================================================================
   CORREÇÃO DEFINITIVA DE FLASH DO SLIDER (Simplificada e Segura)
   ========================================================================== */

/* 1. Garante que qualquer slide que NÃO seja o primeiro (nth-child(1))
      fique invisível e fora do fluxo (display: none) até o JS carregar. */
.hero-slider:not(.swiper-initialized) .swiper-slide:not(:nth-child(1)) {
    display: none !important;
}

/* 2. Garante que o primeiro slide (o do vídeo) seja o único visível.
      Removemos 'position: absolute' para evitar bugs de layout.
      Mantemos 'relative' para respeitar o fluxo do container. */
.hero-slider:not(.swiper-initialized) .swiper-slide:nth-child(1) {
    display: flex !important;
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10 !important;
}