:root {
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
    --color-primary: #c28b1a; /* Dourado/Âmbar */
    --color-text: #334155;
    --color-bg: #f1f5f9;

    /* Cores dos menus */
    --color-institucional: #0072bc;
    --color-formacao: #7b1fa2;
    --color-pos: #ff9800;
    --color-livres: #4caf50;
    --color-ambulatorio: #e63946;
    --color-depoimentos: #d32f2f;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    /* Adiciona algum conteúdo para o efeito de blur ser visível */
    background-image: url('https://image.pollinations.ai/prompt/abstract%20background%20with%20soft%20gradients%20of%20beige%20and%20light%20gray,%20minimalist,%20calm?width=1920&height=1080');
    background-size: cover;
    min-height: 200vh;
}

body.mobile-menu-is-open {
    overflow: hidden;
}

.header {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 1000;
    transition: all 0.3s ease;
}

/* --- Main Navigation Bar --- */
.main-nav {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 0 1rem;
    position: relative;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.logo-img {
    height: 45px;
    width: auto;
    padding-left: 15px;
}

.nav-links {
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
    transition: color 0.3s ease;
    height: 100%;
}

.nav-item:hover .nav-link {
    color: var(--color-primary);
}

/* --- Floating Indicator --- */
#nav-indicator {
    position: absolute;
    bottom: 0;
    height: 3px;
    background-color: var(--color-primary);
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0;
}

.nav-item:hover ~ #nav-indicator {
    opacity: 1;
}

/* --- Nav Actions --- */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.nav-actions .social-icon {
     color: #94a3b8;
     transition: color 0.3s ease;
}
.nav-actions .social-icon:hover {
    color: var(--color-primary);
}
.matricule-se-btn {
    background-color: var(--color-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.matricule-se-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(194, 139, 26, 0.4);
}

/* --- Mega Menu --- */
.megamenu-wrapper {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    perspective: 1000px;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.header.megamenu-active .megamenu-wrapper {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.megamenu-bg {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem;
    overflow: hidden;
}

.megamenu-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.megamenu-content.active {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    opacity: 1;
}

.megamenu-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

/* Card Styling & Staggered Animation */
.megamenu-card {
    background-color: rgba(241, 245, 249, 0.7);
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: cardFadeIn 0.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    position: relative;
    overflow: hidden;
}

.megamenu-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--card-color, var(--color-primary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.megamenu-card:hover::before {
    transform: scaleX(1);
}

/* Staggered animation delays */
.megamenu-content.active .megamenu-card:nth-child(1) { animation-delay: 0.1s; }
.megamenu-content.active .megamenu-card:nth-child(2) { animation-delay: 0.15s; }
.megamenu-content.active .megamenu-card:nth-child(3) { animation-delay: 0.2s; }
.megamenu-content.active .megamenu-card:nth-child(4) { animation-delay: 0.25s; }
.megamenu-content.active .megamenu-card:nth-child(5) { animation-delay: 0.3s; }
.megamenu-content.active .megamenu-card:nth-child(6) { animation-delay: 0.35s; }


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

.megamenu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.05);
}

.card-icon {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--card-color, var(--color-primary));
}

.megamenu-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.megamenu-description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #64748b;
}

/* Featured Section */
.megamenu-featured {
    background-color: #f8fafc;
    border-radius: 10px;
    padding: 2rem;
    background-image: url('https://image.pollinations.ai/prompt/serene%20zen%20garden%20with%20acupuncture%20needles%20as%20elements,%20soft%20light,%20minimalist,%20vertical?width=600&height=800');
    background-size: cover;
    background-position: center;
    position: relative;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    transform: translateY(20px);
    animation: cardFadeIn 0.5s cubic-bezier(0.23, 1, 0.32, 1) 0.3s forwards;
}
.megamenu-featured::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    border-radius: 10px;
}
.featured-content {
    position: relative;
    z-index: 2;
}
.featured-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}


/* --- Mobile Menu Button (Hamburger) --- */
.mobile-menu-btn {
    display: none; /* Hidden on desktop */
    position: relative;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    transition: all 0.3s ease;
}

.menu-icon {
    top: 50%;
    transform: translate(-50%, -50%);
}

.menu-icon::before {
    top: -7px;
}

.menu-icon::after {
    top: 7px;
}

/* Hamburger to 'X' animation */
.mobile-menu-open .menu-icon {
    background-color: transparent;
}

.mobile-menu-open .menu-icon::before {
    top: 0;
    transform: translate(-50%, 0) rotate(45deg);
}

.mobile-menu-open .menu-icon::after {
    top: 0;
    transform: translate(-50%, 0) rotate(-45deg);
}

/* --- Mobile Menu Panel (Advanced) --- */

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

body.mobile-menu-is-open .mobile-menu-overlay {
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: min(90vw, 400px);
    height: 100%;
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 999;
    visibility: hidden;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), visibility 0.4s;
    display: flex;
    flex-direction: column;
}

.mobile-menu.active {
    transform: translateX(0);
    visibility: visible;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.mobile-nav-links {
    flex-grow: 1;
    overflow-y: auto;
    padding: 80px 2rem 2rem 2rem;
}

@keyframes mobileLinkFadeIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-menu.active .mobile-nav-item {
    animation: mobileLinkFadeIn 0.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.mobile-menu.active .mobile-nav-item:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu.active .mobile-nav-item:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu.active .mobile-nav-item:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu.active .mobile-nav-item:nth-child(4) { animation-delay: 0.25s; }
.mobile-menu.active .mobile-nav-item:nth-child(5) { animation-delay: 0.3s; }

.mobile-nav-item {
    opacity: 0;
    transform: translateX(20px);
}

.mobile-nav-item > a, .mobile-nav-item > span {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    cursor: pointer;
}

.mobile-nav-item .submenu-toggle {
    transition: transform 0.3s ease;
    font-size: 1rem;
}

.mobile-nav-item.open > span .submenu-toggle {
    transform: rotate(180deg);
}

.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out, margin 0.4s ease-out;
    padding-left: 1.5rem;
    border-left: 2px solid var(--color-primary);
    margin-left: 4px;
}

.mobile-nav-item.open .mobile-submenu {
    max-height: 500px; /* Adjust as needed */
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    margin-top: 0.5rem;
}

.mobile-submenu a {
    display: block;
    padding: 0.75rem 0;
    color: #475569;
    font-weight: 500;
    font-size: 1rem;
}

.mobile-menu-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    transform: translateY(20px);
}

.mobile-menu.active .mobile-menu-footer {
    animation: mobileLinkFadeIn 0.5s cubic-bezier(0.23, 1, 0.32, 1) 0.35s forwards;
}

.mobile-menu-footer .social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.mobile-menu-footer .social-links a {
    font-size: 1.5rem;
    color: #94a3b8;
    transition: color 0.3s ease;
}

.mobile-menu-footer .social-links a:hover {
    color: var(--color-primary);
}

.mobile-menu-footer .matricule-se-btn {
    width: 100%;
    justify-content: center;
}

/* --- RESPONSIVE STYLES --- */
@media (max-width: 1023px) {
    .header {
        top: 0;
        left: 0;
        right: 0;
        padding: 0 0rem;
    }
    .main-nav {
        border-radius: 0;
        padding: 0;
    }
    .nav-links {
        display: none;
    }
    .nav-actions .social-icon, .nav-actions .matricule-se-btn {
        display: none;
    }
    .mobile-menu-btn {
        display: block;
    }
    .megamenu-content.active {
        grid-template-columns: 1fr;
    }
    .megamenu-featured {
        display: none;
    }
}

