@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    /* --- AJUSTES DESKTOP --- */
    /* Espaçamento Vertical (Ajuste os vãos cima/baixo) */
    --espaco-titulo-topo: -20px;
    --espaco-titulo-base: 20px;

    /* Sombras (Text Shadow) */
    --reis-shadow: 12px 15px 10px rgba(0, 0, 0, 0.85), -2px -2px 15px rgba(0, 0, 0, 0.3);

    /* Sombra compatível com FILTRO (drop-shadow não aceita vírgula) */
    --reis-shadow-filter: drop-shadow(12px 15px 10px rgba(0, 0, 0, 0.85)) drop-shadow(-2px -2px 15px rgba(0, 0, 0, 0.3));

    /* Sombra da Seta Mobile */
    --arrow-shadow: 8px 8px 10px rgba(0, 0, 0, 0.8);

    /* Ajustes Finos Mobile (Padrão Desktop: sem efeito) */
    --mobile-videos-y: 0px;
    --mobile-arrow-y: 0px;
    --mobile-arrow-x: 0px;
    --mobile-arrow-rotate: 0deg;
    --mobile-arrow-size: 7rem;
    --mobile-menu-x: 1.5rem;
    /* Recuo do menu hambúrguer para a ESQUERDA */
    --mobile-menu-top: 100%;
    /* Distância do balão do menu em relação ao topo */
    --mobile-menu-left: 0px;
    /* Recuo da ESQUERDA do balão */
    --mobile-menu-right: 0px;
    /* Recuo da DIREITA do balão */
    --mobile-menu-padding: 2.5rem;
    /* Espaçamento interno do menu (respiro) */
}

/* Responsividade de Variáveis Design Tokens */
@media (max-width: 768px) {
    :root {
        /* AJUSTE OS VÃOS NO CELULAR AQUI */
        --espaco-titulo-topo: 0px;
        --espaco-titulo-base: 55px;
        --mobile-arrow-size: 10rem;
        --mobile-menu-x: 2rem;
        --mobile-menu-top: 5.5rem;
        /* Posição sugerida para o mobile */
        --mobile-menu-left: 0px;
        --mobile-menu-right: 0px;
        --mobile-menu-padding: 2rem;
        /* Respiro interno no mobile */
    }
}

html,
body {
    font-family: 'Inter', sans-serif;
    background-color: #0a0a0a;
    color: #ffffff;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Ocultar controles APENAS no vídeo de fundo do Hero */
.hero-video-loop::-webkit-media-controls {
    display: none !important;
}

.hero-video-loop::-webkit-media-controls-enclosure {
    display: none !important;
}

.hero-video-loop::-webkit-media-controls-panel {
    display: none !important;
}

/* Ocultar botão de play central que o iOS/Android força às vezes */
.hero-video-loop::-webkit-media-controls-start-playback-button {
    display: none !important;
    -webkit-appearance: none;
}

.hero-video-loop::-webkit-media-controls-play-button {
    display: none !important;
}

.hero-video-loop::-webkit-media-controls-status-display {
    display: none !important;
}

/* Fontes Customizadas (Mantendo apenas as usadas no restante do site) */
.font-serif {
    font-family: 'Playfair Display', serif !important;
}

.font-montserrat {
    font-family: 'Montserrat', sans-serif;
}

.glass {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
}

.text-gradient {
    background: linear-gradient(to bottom, #ffffff, #71717a);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Animações de Revelação (Reveal) */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.17, 0.55, 0.55, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Aspect Ratio Helpers */
.video-wrapper {
    position: relative;
    width: 100%;
    border-radius: 1rem;
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.aspect-9-16 {
    padding-bottom: 177.77%;
}

.aspect-16-9 {
    padding-bottom: 56.25%;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Scrollbar customizada */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #dc2626;
}

/* Custom spacing for fixed header */
.scroll-mt-header {
    scroll-margin-top: 80px;
}

/* Mantém proporção original no Fullscreen nativo (Remove crop) */
video:-webkit-full-screen {
    object-fit: contain !important;
}

video:fullscreen {
    object-fit: contain !important;
}

/* Correção para manter proporção e centralizar no Fullscreen */
:fullscreen {
    background-color: black !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

:fullscreen video {
    object-fit: contain !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

:-webkit-full-screen {
    background-color: black !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

:-webkit-full-screen video {
    object-fit: contain !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Efeito Glitch de Troca de Fonte Melhorado e Centralizado */
@keyframes fontGlitch {
    0% {
        font-family: 'Playfair Display', serif;
        transform: translate(-50%, -50%) skewX(0deg);
        text-shadow: none;
    }

    15% {
        font-family: 'Space Mono', monospace;
        font-style: italic;
        transform: translate(-50%, -50%) skewX(-5deg);
        text-shadow: 2px 0 red, -2px 0 cyan;
    }

    30% {
        font-family: 'Anton', sans-serif;
        transform: translate(-50%, -50%) skewX(5deg) scale(1.0);
        text-shadow: none;
    }

    45% {
        font-family: 'Permanent Marker', cursive;
        transform: translate(-50%, -50%) skewX(-2deg);
        text-shadow: 2px 2px 0px rgba(255, 0, 0, 0.5);
    }

    60% {
        font-family: 'Cinzel', serif;
        font-weight: 700;
        transform: translate(-50%, -50%) skewX(0deg);
        text-shadow: -1px 0 red;
    }

    75% {
        font-family: 'Bebas Neue', sans-serif;
        font-style: normal;
        transform: translate(-50%, -50%) skewX(2deg) scale(1.02);
        text-shadow: none;
    }

    90% {
        font-family: 'Space Mono', monospace;
        transform: translate(-50%, -50%) skewX(0deg);
        text-shadow: -2px 0 red;
    }

    100% {
        font-family: 'Playfair Display', serif;
        transform: translate(-50%, -50%) skewX(0deg);
        text-shadow: none;
    }
}

.glitch-font {
    animation: fontGlitch 1.2s infinite steps(1);
    display: inline-block;
    white-space: nowrap;
}

.preserve-3d {
    transform-style: preserve-3d;
    transform: perspective(1000px);
}

/* Glassmorphism Inner Gradient */
.inner-gradient {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
}

/* Behind Glow Effect */
.behind-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, var(--glow-color, rgba(220, 38, 38, 0.15)) 0%, transparent 60%);
    filter: blur(25px);
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    z-index: -1;
    pointer-events: none;
}

.group:hover .behind-glow {
    opacity: 1;
}

/* Glow Border (Spotlight) */
/* Magic Bento Effects */
.magic-bento-card {
    --glow-x: 50%;
    --glow-y: 50%;
    --glow-intensity: 0;
    --glow-radius: 400px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
}

.magic-bento-card::after {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1.5px;
    background: radial-gradient(var(--glow-radius) circle at var(--glow-x) var(--glow-y),
            rgba(220, 38, 38, calc(var(--glow-intensity) * 0.8)) 0%,
            rgba(220, 38, 38, calc(var(--glow-intensity) * 0.4)) 30%,
            transparent 60%);
    border-radius: inherit;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.magic-bento-card:hover {
    box-shadow: 0 0 30px rgba(220, 38, 38, 0.15);
}

/* Global spotlight styles */
.global-spotlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle,
            rgba(220, 38, 38, 0.08) 0%,
            rgba(220, 38, 38, 0.04) 25%,
            rgba(220, 38, 38, 0.01) 65%,
            transparent 70%);
    z-index: 100;
    opacity: 0;
    transform: translate(-50%, -50%);
    mix-blend-mode: screen;
    will-change: transform, opacity;
}

/* Particles */
.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #dc2626;
    box-shadow: 0 0 8px #dc2626;
    pointer-events: none;
    z-index: 5;
}

/* Ripple effect */
.ripple-effect {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.7) 0%, transparent 70%);
    pointer-events: none;
    z-index: 10;
    transform: translate(-50%, -50%) scale(0);
    filter: blur(5px);
}

/* Magnet Lines */
.magnet-container {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(10, 1fr);
    pointer-events: none;
    opacity: 0.4;
    z-index: 0;
}

.magnet-line {
    width: 2px;
    height: 30px;
    background: tomato;
    margin: auto;
    transition: transform 0.1s ease-out;
}

/* Advanced Tilted Card Overlay (Fixed) */
.tilted-card-caption {
    pointer-events: none;
    position: absolute;
    left: 50%;
    right: auto;
    top: 2.5rem;
    transform: translateX(-50%) translateZ(10px);
    border-radius: 6px;
    background-color: white;
    padding: 6px 12px;
    font-size: 10px;
    font-weight: 900;
    color: #0c0c0c;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0;
    z-index: 50;
    white-space: nowrap;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    will-change: transform, opacity;
}

/* Layers for Parallax Effect */
.advanced-tilt-card {
    transform-style: preserve-3d !important;
    perspective: 800px;
    will-change: transform;
}

/* Ícones e Textos internos */
.advanced-tilt-card svg,
.advanced-tilt-card .relative.z-10 {
    transform: translateZ(20px);
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), filter 0.6s ease;
    will-change: transform, filter;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
}

.advanced-tilt-card .relative.z-10 span {
    display: block;
    transform: translateZ(10px);
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.advanced-tilt-card .relative.z-10 p {
    transform: translateZ(10px);
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.group:hover>.advanced-tilt-card svg {
    transform: translateZ(30px) scale(1.02);
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.5));
}

.group:hover>.advanced-tilt-card .relative.z-10 span {
    transform: translateZ(10px);
}

.group:hover>.advanced-tilt-card .relative.z-10 p {
    transform: translateZ(20px);
    filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.4));
}

.advanced-tilt-card .tilted-card-caption {
    transition: opacity 0.3s ease, transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    transform: translateX(-50%) translateZ(10px);
    /* Início sem rotação */
    opacity: 0;
}

.advanced-tilt-card:hover .tilted-card-caption {
    transform: translateX(-50%) translateZ(50px) scale(1.03);
    /* Distância solicitada: 50px, Sem rotação */
    opacity: 1;
}

/* O override para o WhatsApp agora é igual aos outros para uniformidade */
.advanced-tilt-card:hover .tilted-card-caption.boost-jump {
    transform: translateX(-50%) translateZ(50px) scale(1.05);
    /* Mantido leve escala maior no WhatsApp para destaque */
}

/* --- Mobile Optimizations --- */
@media (max-width: 768px) {

    .advanced-tilt-card,
    .preserve-3d {
        transform: none !important;
        transform-style: flat !important;
        perspective: none !important;
    }

    .advanced-tilt-card svg,
    .advanced-tilt-card .relative.z-10 {
        transform: none !important;
        scale: 1 !important;
    }

    .tilted-card-caption {
        display: none !important;
    }

    section#contato h2 {
        font-family: 'Playfair Display', serif !important;
    }

    .advanced-tilt-card {
        padding: 1.5rem !important;
        min-height: auto !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        text-align: left !important;
        gap: 1.5rem !important;
    }

    section#contato .advanced-tilt-card svg {
        width: 64px !important;
        height: 64px !important;
        margin-bottom: 0 !important;
        flex-shrink: 0 !important;
        filter: drop-shadow(4px 4px 8px rgba(0, 0, 0, 0.8)) !important;
        position: relative;
        z-index: 20;
    }

    section#contato .advanced-tilt-card p {
        font-family: 'Montserrat', sans-serif !important;
        font-size: 1.3rem !important;
        line-height: 1.2 !important;
        filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.7)) !important;
        position: relative;
        z-index: 20;
    }

    /* Redução específica para o e-mail, que é muito longo no mobile */
    section#contato .advanced-tilt-card.email-card p {
        font-size: 0.8rem !important;
    }

    section#contato .advanced-tilt-card .relative.z-10 span {
        font-family: 'Montserrat', sans-serif !important;
        font-size: 10px !important;
        margin-bottom: 8px !important;
        filter: drop-shadow(1px 1px 3px rgba(0, 0, 0, 0.6)) !important;
        position: relative;
        z-index: 20;
    }

    section#contato .advanced-tilt-card .relative.z-10 {
        z-index: 20 !important;
    }

    .video-controls-overlay {
        opacity: 1 !important;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, transparent 100%);
        z-index: 20;
    }

    .magic-bento-card video {
        z-index: 5;
        min-height: 480px;
        background: black;
        position: relative;
    }
}

/* --- CUSTOM PLAYER --- */
.video-controls-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.magic-bento-card:hover .video-controls-overlay {
    opacity: 1;
}

.custom-player-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
}

.custom-player-btn:hover {
    background: rgba(220, 20, 60, 0.8);
    border-color: #dc143c;
    transform: scale(1.1);
}

.video-progress-container {
    height: 15px;
    background: transparent;
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    cursor: pointer;
}

.video-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #dc143c;
    width: 0%;
    transition: width 0.1s linear;
    z-index: 1;
    transform-origin: left;
}

/* Icons Styling */
.custom-yt-icon {
    width: 21px;
    height: 21px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: all 0.3s ease;
}

.custom-ig-icon {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.custom-ig-icon path {
    fill: #ffffff !important;
}

/* Hover fixes requested by user */
.custom-player-btn:hover .custom-ig-icon path {
    fill: #ffffff !important;
    /* Mantém branco no hover */
}

.custom-player-btn:hover .custom-yt-icon {
    filter: brightness(0) invert(1) brightness(1.5);
}

/* Otimizações Mobile e Correções de Título (Migrados do index.html) */
@media (max-width: 768px) {
    .contact-card {
        padding: 1.5rem !important;
        /* Respiro interno no mobile */
    }
}

/* Título Estático: Força a visibilidade imediata sem animação */
.spray-mask-container {
    clip-path: none !important;
    -webkit-clip-path: none !important;
}

#spray-glow {
    display: none !important;
}