/* style.css */

/* -------------------------------------------------------------------------- */
/*                                 CSS Variables                              */
/* -------------------------------------------------------------------------- */
:root {
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'DM Sans', sans-serif;

    /* Neutral Corporate Color Palette */
    --color-primary: #0D47A1; /* Deep Blue - Trustworthy, Corporate */
    --color-primary-dark: #002171; /* Darker shade of primary */
    --color-accent: #1976D2; /* A slightly lighter, vibrant blue for accents */
    
    --color-text-light: #FFFFFF;
    --color-text-dark: #212121;  /* Very dark gray for high contrast */
    --color-text-medium: #424242; /* Dark gray */
    --color-text-muted: #757575;  /* Medium gray */

    --color-background-light: #F5F5F5; /* Very light gray for general backgrounds */
    --color-background-medium: #EEEEEE; /* Light gray for cards, sections */
    --color-background-dark: #222831;  /* Dark gray for footer and dark sections */
    
    --color-border: #E0E0E0; /* Light gray for borders */
    --color-success: #4CAF50;
    --color-error: #F44336;
    --color-link: var(--color-primary);
    --color-link-hover: var(--color-primary-dark);

    --header-height: 70px; /* Approximate header height */
    --border-radius-small: 4px;
    --border-radius-medium: 8px;
    --box-shadow-light: 0 2px 10px rgba(0, 0, 0, 0.08);
    --box-shadow-medium: 0 4px 15px rgba(0, 0, 0, 0.12);
}

/* -------------------------------------------------------------------------- */
/*                                 Base Styles                                */
/* -------------------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
    font-size: 16px; /* Base font size for REM calculations */
}

body {
    font-family: var(--font-body);
    color: var(--color-text-medium);
    background-color: var(--color-background-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: var(--header-height); /* For fixed header */
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Adaptive Typography Base */
h1, .title.is-1 { font-size: clamp(2.5rem, 5vw, 3.5rem); }
h2, .title.is-2 { font-size: clamp(2rem, 4vw, 3rem); }
h3, .title.is-3 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h4, .title.is-4 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h5, .title.is-5 { font-size: clamp(1.1rem, 2.5vw, 1.3rem); }
p, .content, .subtitle { font-size: clamp(0.95rem, 2vw, 1.1rem); }


/* -------------------------------------------------------------------------- */
/*                                Typography                                  */
/* -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6,
.title, .subtitle {
    font-family: var(--font-heading);
    color: var(--color-text-dark);
    font-weight: 700;
}

.title {
    color: var(--color-text-dark); /* Bulma override if needed */
}
.subtitle {
    color: var(--color-text-muted); /* Bulma override if needed */
}

p {
    margin-bottom: 1rem;
    color: var(--color-text-medium);
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

.section-title {
    font-family: var(--font-heading);
    color: var(--color-text-dark);
    margin-bottom: 2rem !important; /* Increased margin */
    position: relative;
    padding-bottom: 0.75rem;
    font-weight: 700;
}

.section-title::after {
    content: '';
    display: block;
    width: 70px;
    height: 4px;
    background-color: var(--color-primary);
    margin: 0.75rem auto 0;
    border-radius: 2px;
}

.has-text-light .section-title,
.has-background-dark .section-title {
    color: var(--color-text-light);
}

.has-text-light .section-title::after,
.has-background-dark .section-title::after {
    background-color: var(--color-accent);
}

/* -------------------------------------------------------------------------- */
/*                            Global Button Styles                            */
/* -------------------------------------------------------------------------- */
.button, button, input[type="submit"], input[type="button"] {
    font-family: var(--font-heading);
    font-weight: 500;
    border-radius: var(--border-radius-small);
    padding: 0.75em 1.5em;
    transition: transform 0.2s ease-out, background-color 0.3s ease, box-shadow 0.3s ease;
    letter-spacing: 0.5px;
    box-shadow: var(--box-shadow-light);
    border-width: 1px;
    border-style: solid;
}

.button:hover, button:hover, input[type="submit"]:hover, input[type="button"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-medium);
}

.button.is-primary, button.is-primary { /* Handles Bulma's is-primary */
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-text-light);
}

.button.is-primary:hover, button.is-primary:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: var(--color-text-light);
}

.button.is-link.is-outlined { /* For Saiba Mais buttons */
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.button.is-link.is-outlined:hover {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    border-color: var(--color-primary);
}

.morphing-button { /* Additional class for specific morphing if needed */
    /* Example: slight scale on hover/focus for a subtle "morph" */
}
.morphing-button:active {
    transform: translateY(0px) scale(0.98);
}


/* -------------------------------------------------------------------------- */
/*                                Header & Nav                                */
/* -------------------------------------------------------------------------- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1030; /* Bulma's navbar default is 30, so higher */
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: var(--box-shadow-light);
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.navbar {
    background-color: transparent !important; /* Override Bulma if it sets a color */
    width:100%;
}

.navbar-item img {
    max-height: 2.5rem; /* Adjust logo size */
}

.navbar-item, .navbar-link {
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--color-text-medium);
    transition: color 0.3s ease;
}

.navbar-item:hover, .navbar-link:hover,
.navbar-item.is-active { /* Add is-active class via JS for current page */
    background-color: transparent !important;
    color: var(--color-primary) !important;
}

.navbar-burger {
    color: var(--color-text-dark);
    height: var(--header-height); /* Make burger same height as header */
    width: var(--header-height);
}

.navbar-menu {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: var(--box-shadow-light);
}

@media screen and (max-width: 1023px) {
    .navbar-menu {
        padding: 0.5rem 0;
    }
    .navbar-menu.is-active {
        position: absolute;
        width: 100%;
        left: 0;
        top: var(--header-height);
    }
    .navbar-item {
        padding: 0.75rem 1.5rem;
    }
}

/* -------------------------------------------------------------------------- */
/*                                Hero Section                                */
/* -------------------------------------------------------------------------- */
#hero {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    /* Parallax can be added via JS */
}

#hero .hero-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

#hero .title.is-1 {
    font-size: clamp(2.8rem, 6vw, 4.5rem); /* Larger for hero */
    color: var(--color-text-light) !important;
    font-weight: 700;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
}

#hero .subtitle.is-4 {
    color: var(--color-text-light) !important;
    text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.5);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Animated text (simple fade-in, GSAP can enhance) */
.animated-text {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInText 0.8s 0.5s forwards ease-out;
}
.animated-text-delay {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInText 0.8s 0.8s forwards ease-out;
}

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


/* -------------------------------------------------------------------------- */
/*                               General Sections                             */
/* -------------------------------------------------------------------------- */
.section {
    padding: 4rem 1.5rem; /* Default Bulma padding is 3rem 1.5rem */
}

.section.has-background-light {
    background-color: var(--color-background-medium) !important;
}
.section.has-background-dark {
    background-color: var(--color-background-dark) !important;
    color: var(--color-text-light);
}
.section.has-background-dark .title,
.section.has-background-dark .subtitle,
.section.has-background-dark p,
.section.has-background-dark .label {
    color: var(--color-text-light) !important;
}
.section.has-background-dark a {
    color: var(--color-accent);
}
.section.has-background-dark a:hover {
    color: var(--color-text-light);
}


/* -------------------------------------------------------------------------- */
/*                                Card Styles                                 */
/* -------------------------------------------------------------------------- */
.card {
    background-color: #fff;
    border-radius: var(--border-radius-medium);
    box-shadow: var(--box-shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%; /* For equal height cards in a row */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Ensures child elements like images respect border radius */
}

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

.card .card-image {
    /* This is the Bulma div for the image figure */
    position: relative; /* For potential overlays */
}

.card .card-image .image-container {
    /* This is the custom class from HTML.
       Bulma's figure.image with ratio classes (is-4by3, etc.) is good.
       This container should have a fixed height if not using Bulma's ratio. */
    overflow: hidden; /* Clip image to container bounds */
}

.card .card-image figure.image { /* Bulma's figure element */
    margin: 0; /* Remove any default figure margins */
    background-color: var(--color-background-medium); /* Placeholder bg for images */
}

.card .card-image figure.image img {
    width: 100%;
    height: 100%; /* Fills the figure aspect ratio box */
    object-fit: cover; /* Cover, don't distort */
    display: block;
    transition: transform 0.4s ease;
}

.card:hover .card-image figure.image img {
    transform: scale(1.05);
}

.card .card-content {
    padding: 1.5rem;
    flex-grow: 1; /* Allows content to take available space, pushing card-footer down */
    display: flex;
    flex-direction: column;
}
.card .card-content .title,
.card .card-content .subtitle {
    margin-bottom: 0.75rem;
}
.card .card-content .content {
    margin-bottom: 1rem;
    flex-grow: 1; /* Paragraphs take space */
}
.card .card-content .button {
    margin-top: auto; /* Push button to bottom of card content */
}


/* Centering content within specific cards as per requirement */
#team .card .card-content,
#community .testimonial-carousel .content {
    text-align: center;
}
#team .card .card-image figure.is-1by1 img.is-rounded {
    border-radius: 50% !important; /* Ensure it's fully round */
    border: 3px solid var(--color-text-light); /* Optional border */
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}


/* Service Card specific styles */
.service-card .card-content .title.is-4 {
    color: var(--color-primary);
}

/* Pricing Card specific styles */
.pricing-card {
    border: 1px solid var(--color-border);
}
.pricing-card.is-featured {
    border: 2px solid var(--color-primary);
    box-shadow: 0 0 25px rgba(var(--color-primary-rgb, 13, 71, 161), 0.2); /* Needs --color-primary-rgb */
}
.pricing-card .card-header-title {
    font-size: 1.25rem;
    font-weight: 600;
    background-color: var(--color-background-medium);
}
.pricing-card.is-featured .card-header-title {
    background-color: var(--color-primary);
    color: var(--color-text-light);
}
.pricing-card .card-content ul {
    list-style: none;
    margin-left: 0;
    margin-bottom: 1.5rem;
}
.pricing-card .card-content ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}
.pricing-card .card-content ul li:last-child {
    border-bottom: none;
}
.pricing-card .card-footer-item.button {
    border-radius: 0 0 var(--border-radius-medium) var(--border-radius-medium); /* Match card */
    width: 100%;
}

/* Resource Card */
.resource-card {
    margin-bottom: 1rem;
}
.resource-card .card-content .title.is-5 a {
    color: var(--color-primary);
    font-weight: 600;
}
.resource-card .card-content .title.is-5 a:hover {
    color: var(--color-primary-dark);
}


/* -------------------------------------------------------------------------- */
/*                             Specific Sections                              */
/* -------------------------------------------------------------------------- */

/* Research Section - Statistical Widgets */
.statistical-widget .title.is-1 {
    color: var(--color-primary);
    font-weight: 700;
}
.statistical-widget .subtitle.is-5 {
    color: var(--color-text-muted);
    font-weight: 500;
}

/* Community - Testimonial Carousel */
.testimonial-carousel .card-content {
    text-align: center;
}
.testimonial-carousel img.is-rounded {
    border: 4px solid var(--color-primary);
    padding: 4px; /* Space between image and border */
    background-color: var(--color-text-light);
}
.testimonial-carousel .title.is-5 {
    font-style: italic;
    color: var(--color-text-medium);
    margin-top: 1rem;
}
.testimonial-carousel .subtitle.is-6 {
    color: var(--color-primary);
    font-weight: 600;
}

/* Community - Newsletter Form */
.newsletter-form .input,
.newsletter-form .button {
    border-radius: var(--border-radius-small) !important; /* Bulma's has-addons might remove radius */
}
.newsletter-form .field.has-addons .control:first-child .input {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
.newsletter-form .field.has-addons .control:last-child .button {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}


/* Contact Form Section */
#contact-form-section .label,
#contacts-page .label { /* For contacts.html */
    color: var(--color-text-dark);
    font-weight: 500;
}
#contact-form-section .input, 
#contact-form-section .textarea,
#contacts-page .input,
#contacts-page .textarea {
    border-radius: var(--border-radius-small);
    border-color: var(--color-border);
    box-shadow: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
#contact-form-section .input:focus, 
#contact-form-section .textarea:focus,
#contacts-page .input:focus,
#contacts-page .textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.125em rgba(var(--color-primary-rgb, 13, 71, 161), 0.25); /* Needs --color-primary-rgb */
}


/* -------------------------------------------------------------------------- */
/*                                   Footer                                   */
/* -------------------------------------------------------------------------- */
.footer {
    background-color: var(--color-background-dark);
    color: var(--color-text-light);
    padding: 3rem 1.5rem 2rem; /* Reduced bottom padding */
}

.footer .title.is-5 {
    color: var(--color-text-light) !important;
    margin-bottom: 1rem;
}

.footer p, .footer ul li {
    color: #bdc3c7; /* Lighter gray for readability on dark bg */
    font-size: 0.95rem;
}

.footer a {
    color: #ecf0f1; /* Even lighter for links */
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--color-accent);
    text-decoration: none;
}

.footer ul {
    list-style: none;
    margin-left: 0;
}
.footer ul li {
    margin-bottom: 0.5rem;
}

.footer hr {
    background-color: rgba(255, 255, 255, 0.1);
    height: 1px;
}

.footer .content.has-text-centered p {
    font-size: 0.9rem;
    color: #95a5a6; /* Muted for copyright */
}


/* -------------------------------------------------------------------------- */
/*                                Modal Styles                                */
/* -------------------------------------------------------------------------- */
.modal-card {
    border-radius: var(--border-radius-medium);
    max-width: 700px; /* Limit modal width */
}
.modal-card-head, .modal-card-foot {
    background-color: var(--color-background-medium);
    border-color: var(--color-border);
}
.modal-card-title {
    color: var(--color-text-dark);
    font-family: var(--font-heading);
}
.modal-card-body {
    color: var(--color-text-medium);
}
.modal-card-body .image-container img {
    border-radius: var(--border-radius-small);
}


/* -------------------------------------------------------------------------- */
/*                            Scroll Animations Base                          */
/* -------------------------------------------------------------------------- */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-animate.is-visible { /* Class added by JS (e.g., GSAP ScrollTrigger) */
    opacity: 1;
    transform: translateY(0);
}

/* -------------------------------------------------------------------------- */
/*                              Utility Classes                               */
/* -------------------------------------------------------------------------- */
.has-text-shadow {
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}
.has-light-text-shadow {
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}


/* -------------------------------------------------------------------------- */
/*                             Responsive Styles                              */
/* -------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
    .section {
        padding: 2.5rem 1rem;
    }
    h1, .title.is-1 { font-size: 2rem; }
    h2, .title.is-2 { font-size: 1.75rem; }
    .columns.is-centered .column.is-two-thirds { /* Ensure centered columns take more space on mobile */
        width: 90% !important; 
        flex: none; /* Override Bulma's flex behavior for specific cases */
    }
}


/* -------------------------------------------------------------------------- */
/*                          Cookie Consent Popup                              */
/* -------------------------------------------------------------------------- */
#cookie-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(33, 33, 33, 0.97); /* Darker, less transparent */
    color: var(--color-text-light);
    padding: 15px 20px;
    text-align: center;
    z-index: 9999;
    display: none; /* Initially hidden by JS */
    font-size: 0.9rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

#cookie-popup p {
    margin: 0 0 10px 0;
    display: block; /* Stack text and button on small screens */
}

#cookie-popup a {
    color: var(--color-accent); /* Brighter link color */
    text-decoration: underline;
}
#cookie-popup a:hover {
    color: var(--color-text-light);
}

#cookie-popup button#accept-cookie {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: var(--font-body);
    font-weight: 500;
}

#cookie-popup button#accept-cookie:hover {
    background-color: var(--color-primary-dark);
}

@media (min-width: 768px) {
    #cookie-popup {
        display: none; /* JS will manage this */
        flex-direction: row;
        align-items: center;
        justify-content: center;
        text-align: left;
    }
    #cookie-popup p {
        margin: 0 15px 0 0;
        display: inline;
    }
     #cookie-popup button#accept-cookie {
        margin-left: 10px;
    }
}


/* -------------------------------------------------------------------------- */
/*                        Specific Page Styles (`success.html`)               */
/* -------------------------------------------------------------------------- */
.success-page-container,
.page-container { /* For privacy, terms etc. */
    min-height: calc(100vh - var(--header-height) - 60px); /* Adjust 60px if footer height changes */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}
.success-page-container .title {
    color: var(--color-success);
}
.success-page-container .icon.is-large .fa-check-circle { /* Assuming Font Awesome */
    font-size: 4rem;
    color: var(--color-success);
}
.page-container .content { /* For privacy/terms content */
    max-width: 800px;
    text-align: left;
}
/* .privacy-terms-page, .about-page, .contacts-page-main {
    padding-top: 2rem; /* Space below fixed header, on top of body padding */
/* } */
/* Body padding-top: var(--header-height) should handle this globally */

/* For individual pages to ensure content is not under fixed header,
   if body padding isn't enough or more space is desired specifically */
.page-content-wrapper {
    padding-top: 2rem; /* Extra space if needed */
    padding-bottom: 2rem;
}


/* Helper for Barba.js transitions */
.barba-leave-active,
.barba-enter-active {
  transition: opacity .5s ease-in-out;
}
.barba-leave-to,
.barba-enter-from {
  opacity: 0;
}

/* Ensure Bulma columns are responsive and don't break layout */
.columns.is-multiline .column {
    margin-bottom: 1.5rem; /* Add some space between stacked columns on mobile */
}

/* Final check on image containers to prevent shifting */
.card .card-image figure.image {
    display: block; /* Ensures it behaves as a block for layout */
}