@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
    body {
        @apply bg-background text-primary antialiased;
        font-family: 'Inter', 'Poppins', system-ui, -apple-system, sans-serif;
    }
    
    h1, h2, h3, h4, h5, h6 {
        @apply font-bold text-primary tracking-tight;
    }
}

@layer components {
    /* Custom utility classes that can be used across the theme */
    .glass-effect {
        @apply bg-white/10 backdrop-blur-md border border-white/20;
    }
    
    .card-hover {
        @apply transition-all duration-300 hover:-translate-y-2 hover:shadow-xl;
    }
    
    .btn-primary {
        @apply bg-accent hover:bg-sky-600 text-white font-bold py-3 px-6 rounded-lg transition-all duration-300 hover:scale-105 hover:shadow-lg active:scale-95 inline-flex items-center justify-center;
    }

    .portal-card {
        border-radius: 1.5rem;
        border: 1px solid rgba(31, 61, 43, 0.08);
        background-color: #ffffff;
        box-shadow: 0 20px 45px rgba(31, 61, 43, 0.08);
        transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    }

    .portal-card:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 35px 60px rgba(31, 61, 43, 0.15);
    }

    .portal-hero-card {
        border-radius: 32px;
        overflow: hidden;
        position: relative;
    }

    .portal-hero-card::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.85) 100%);
        pointer-events: none;
    }

    .portal-hero-label {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.3);
        backdrop-filter: blur(8px);
        border-radius: 999px;
    }

    .portal-subnav {
        gap: 1rem;
        font-weight: 600;
    }

    .portal-subnav a {
        color: #F5F5F5;
        transition: color 0.2s ease;
    }

    .portal-subnav a:hover {
        color: #FFFFFF;
    }

    .section-heading {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .section-heading h2 {
        font-size: clamp(1.5rem, 2vw, 2rem);
    }

    .portal-pill {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        padding: 0.4rem 0.9rem;
        border-radius: 999px;
        background: #E8F1EC;
        color: #1F3D2B;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-size: 0.7rem;
    }

    .portal-meta {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        font-size: 0.85rem;
        color: #64748b;
        font-weight: 500;
    }

    .portal-cta {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        font-weight: 700;
        color: #1F3D2B;
        transition: color 0.2s ease, transform 0.2s ease;
    }

    .portal-cta:hover {
        color: #3F7D58;
        transform: translateX(2px);
    }

    .portal-tag {
        display: inline-flex;
        padding: 0.35rem 0.75rem;
        border-radius: 999px;
        background: rgba(63, 125, 88, 0.12);
        color: #1F3D2B;
        font-weight: 700;
        font-size: 0.75rem;
        letter-spacing: 0.05em;
    }

    .portal-grid {
        display: grid;
        gap: 1.5rem;
    }

    @media (min-width: 640px) {
        .portal-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }

    @media (min-width: 1024px) {
        .portal-grid {
            grid-template-columns: repeat(3, minmax(0, 1fr));
        }
    }

    .card-outline {
        border: 1px solid rgba(31, 61, 43, 0.05);
        background: linear-gradient(180deg, #fff 0%, #f5f5f5 100%);
        box-shadow: 0 16px 40px rgba(31, 61, 43, 0.05);
        border-radius: 20px;
        transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    }

    .card-outline:hover {
        transform: translateY(-6px) scale(1.01);
        box-shadow: 0 25px 50px rgba(31, 61, 43, 0.1);
    }

    .card-media {
        position: relative;
        overflow: hidden;
        border-radius: 16px;
    }

    .card-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.5s ease;
    }

    .card-outline:hover .card-media img {
        transform: scale(1.05);
    }

    .card-badge {
        position: absolute;
        top: 14px;
        left: 14px;
        padding: 0.35rem 0.8rem;
        border-radius: 999px;
        background: rgba(15, 23, 42, 0.6);
        color: #fff;
        font-weight: 700;
        font-size: 0.7rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        backdrop-filter: blur(6px);
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

    .portal-line {
        display: inline-block;
        width: 48px;
        height: 2px;
        background: linear-gradient(90deg, #3F7D58 0%, #1F3D2B 100%);
        border-radius: 999px;
    }

    /* Botão Flutuante do WhatsApp */
    .whatsapp-bot-icon {
        position: fixed !important;
        bottom: 30px !important; /* Distância do fundo */
        right: 30px !important;  /* Distância da direita */
        width: 60px !important;
        height: 60px !important;
        background-color: #25d366 !important; /* Verde WhatsApp */
        color: #fff !important;
        border-radius: 50px !important;
        text-align: center !important;
        font-size: 30px !important;
        line-height: 60px !important; /* Centraliza o ícone verticalmente */
        box-shadow: 0px 4px 15px rgba(37, 211, 102, 0.5) !important;
        z-index: 99999 !important;
        transition: all 0.3s ease !important;
        text-decoration: none !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        pointer-events: auto !important;
        opacity: 1 !important;
    }

    /* Efeito de Pulsar */
    .whatsapp-bot-icon::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: #25d366;
        border-radius: 50px;
        animation: pulse 1.5s infinite;
        z-index: -1;
    }

    @keyframes pulse {
        0% {
            transform: scale(1);
            opacity: 0.7;
        }
        100% {
            transform: scale(1.4);
            opacity: 0;
        }
    }

    /* Efeito ao passar o mouse (Hover) */
    .whatsapp-bot-icon:hover {
        background-color: #128c7e;
        transform: scale(1.1);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

@keyframes pulse-whatsapp {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    50% {
        transform: scale(1.1);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.whatsapp-pulse {
    animation: pulse-whatsapp 2s infinite !important;
}

/* Utility Fallbacks */
.aspect-video {
    aspect-ratio: 16 / 9;
}

@supports not (aspect-ratio: 16 / 9) {
    .aspect-video {
        position: relative;
        padding-bottom: 56.25%; /* 16:9 fallback */
        height: 0;
        overflow: hidden;
    }
    .aspect-video img, .aspect-video div {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

/* Base Swiper Styles - Included directly for performance if needed */
.swiper-container {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Hide scrollbars for horizontal scrolling areas */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}