/* ==========================================================================
   LAYOUT.CSS - Estilos para as grandes áreas do site
   (header, footer, sidebar, container)
   ========================================================================== */

/* --- Container Principal --- */
.container { 
    width: 90%; 
    max-width: 1500px; 
    margin: 0 auto; 
    padding: 0 15px; 
}

main { 
    flex-grow: 1; 
}

/* --- Correção do Espaço entre Menu e Banner --- */
header {
    margin-bottom: 0 !important;
}

main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body > main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

#hero-main, 
.page-banner, 
.page-header, 
.page-banner-internal {
    margin-top: 0 !important;
}

main > .page-content:first-child,
main > .container:first-child {
    padding-top: 0 !important;
}

/* Remove qualquer espaço entre header e main */
header + main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ==========================================================================
   CABEÇALHO PÚBLICO
   ========================================================================== */

header { 
    background-color: var(--cor-primaria); 
    color: var(--cor-fundo); 
    padding: 15px 0; 
    position: sticky; 
    top: 0; 
    width: 100%; 
    z-index: 1000; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
    margin-bottom: 0 !important;
}

header .container { 
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    flex-wrap: nowrap; 
    gap: 20px;
}

.logo { 
    height: 50px; 
    flex-shrink: 0; 
}

.menu-toggle {
    display: none;
}

.nav-wrapper {
    display: flex;
    flex-grow: 1;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
}

.main-nav {
    flex-grow: 1; 
    display: flex;
    justify-content: center;
}

.main-nav ul { 
    list-style: none; 
    display: flex;
    gap: 5px;
}

.main-nav ul li { 
    padding: 0 8px;
}

.main-nav a { 
    font-size: 0.9rem;
    color: var(--cor-fundo); 
    text-decoration: none; 
    font-weight: bold; 
    transition: color 0.3s ease;
    white-space: nowrap;
}

.main-nav a:hover { 
    color: var(--cor-destaque); 
}

.dropdown-toggle {
    white-space: nowrap;
}

.header-right { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    flex-shrink: 0; 
}

.login-link {
    color: var(--cor-fundo);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.login-link:hover {
    color: var(--cor-destaque);
}

.login-link i {
    margin-right: 5px;
}

.social-icons a { 
    font-size: 1.2rem; 
    margin: 0 5px; 
    color: var(--cor-fundo);
}

/* Media query para telas médias */
@media screen and (max-width: 1250px) {
    .container {
        width: 98%;
    }
    .main-nav a {
        font-size: 0.85rem;
    }
    .header-button {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   LAYOUT DO PAINEL ADMIN
   ========================================================================== */

.admin-body { 
    background-color: #f4f7fa; 
}

.admin-grid-container { 
    display: flex; 
    min-height: 100vh; 
}

/* --- Barra Lateral (Sidebar) --- */
.admin-sidebar {
    width: 260px;
    background-color: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header .logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
}

.sidebar-header .logo { 
    height: 40px; 
}

.sidebar-header .logo-link span {
    font-family: var(--fonte-titulos);
    font-size: 1.5rem;
    margin-left: 10px;
}

/* --- Navegação da Sidebar --- */
.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-nav ul { 
    list-style: none; 
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar-nav a:hover {
    background-color: rgba(255,255,255,0.05);
    color: white;
}

.sidebar-nav i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

/* --- Menu Acordeão do Admin --- */
.nav-category > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-category .chevron {
    transition: transform 0.3s ease;
    font-size: 0.8em;
}

.nav-category .submenu {
    list-style: none;
    padding-left: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background-color: rgba(0,0,0,0.2);
}

.nav-category .submenu a {
    color: #aeb2b7;
    font-size: 0.9em;
    padding-left: 65px;
    position: relative;
}

.nav-category .submenu a:hover {
    color: var(--cor-destaque);
}

.nav-category.active > a {
    background-color: #34495e;
    color: white;
}

.nav-category.active > a .chevron {
    transform: rotate(90deg);
}

.nav-category.active > .submenu {
    max-height: 500px;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* --- Conteúdo Principal do Admin --- */
.admin-main-content { 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
}

.admin-header {
    background-color: white;
    padding: 15px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.admin-header h2 { 
    font-family: var(--fonte-titulos); 
    font-size: 1.8rem; 
    margin: 0; 
}

.admin-header .header-right { 
    gap: 20px; 
}

.admin-page-content { 
    flex-grow: 1; 
    padding: 30px; 
}

/* ==========================================================================
   LAYOUT ÁREA DE MEMBROS
   ========================================================================== */

.dashboard-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 20px 5%; 
}

.dashboard-header nav { 
    display: flex; 
    align-items: center; 
    gap: 20px; 
}

.dashboard-header nav a { 
    color: white; 
    text-decoration: none; 
    font-weight: bold; 
}

.member-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 15px;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-dropdown-toggle i {
    transition: transform 0.3s ease;
}

.user-dropdown:hover .user-dropdown-toggle {
    background-color: rgba(255, 255, 255, 0.2);
}

.user-dropdown:hover .user-dropdown-toggle i {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--cor-primaria);
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    min-width: 180px;
    z-index: 100;
    overflow: hidden;
    margin-top: 5px;
}

.user-dropdown:hover .user-dropdown-menu {
    display: block;
}

.user-dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--cor-primaria);
    text-decoration: none;
    font-size: 0.9rem;
}

.user-dropdown-menu a:hover {
    background-color: var(--cor-primaria);
    color: #f8f9fa;
}

/* ==========================================================================
   RODAPÉ (FOOTER)
   ========================================================================== */

footer {
    background-color: #2c3e50;
    color: #bdc3c7;
    padding-top: 60px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 50px;
}

.footer-col h4 {
    color: white;
    font-family: var(--fonte-titulos);
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.footer-col p {
    line-height: 1.8;
    font-size: 0.9rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul a {
    color: #bdc3c7;
    text-decoration: none;
    display: block;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.footer-col ul a:hover {
    color: var(--cor-destaque);
}

.footer-logo {
    height: 50px;
    margin-bottom: 20px;
}

.footer-social {
    margin-top: 20px;
}

.footer-social a {
    color: white;
    font-size: 1.5rem;
    margin-right: 15px;
    transition: color 0.3s ease;
}

.footer-social a:hover {
    color: var(--cor-destaque);
}

.map-container iframe {
    border-radius: 8px;
    width: 100%;
    height: 180px;
}

.footer-bottom {
    background-color: #233140;
    padding: 15px 0;
    text-align: center;
    font-size: 0.8rem;
}
