/*D:\www\GEDService\PortalCliente\main\static\css\header.css*/

/* === HEADER PRINCIPAL === */
header {
    margin-bottom: 32px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-md) 0;
}

/* === CONTAINER DO LOGO === */
.logo-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    width: 100%;
    position: relative;
}

.logo-container img {
    max-height: 100px;
    max-width: 100%;
    height: auto;
    transition: transform var(--transition-base),
                filter var(--transition-base),
                max-height var(--transition-base);
    filter: drop-shadow(var(--shadow-sm));
}

.logo-container img:hover {
    transform: scale(1.05);
    filter: drop-shadow(var(--shadow-md));
}

/* Dark mode - ajustar brilho do logo */
[data-theme="dark"] .logo-container img {
    filter: drop-shadow(var(--shadow-md)) brightness(1.1);
}

[data-theme="dark"] .logo-container img:hover {
    filter: drop-shadow(var(--shadow-lg)) brightness(1.2);
}

/* === CONTAINER DO NOME === */
.prefeitura-nome-container {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.prefeitura-nome {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    text-align: center;
    max-width: 80%;
    line-height: 1.4;
    transition: font-size var(--transition-base),
                color var(--transition-base),
                transform var(--transition-base);
    position: relative;
    background: linear-gradient(135deg,
        var(--text-color) 0%,
        var(--link-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Efeito de brilho no hover */
.prefeitura-nome::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--gradient-blue);
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
}

.prefeitura-nome:hover::after {
    width: 60%;
}

/* Dark mode - gradiente diferente */
[data-theme="dark"] .prefeitura-nome {
    background: linear-gradient(135deg,
        var(--text-color) 0%,
        var(--link-color) 50%,
        #66b3ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === BOTÃO DE TEMA === */
#theme-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-color);
    cursor: pointer;
    padding: 10px 12px;
    font-size: 20px;
    transition: transform var(--transition-base),
                background var(--transition-base),
                box-shadow var(--transition-base),
                color var(--transition-base);
    box-shadow: var(--shadow-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    z-index: 100;
}

/* Fallback para navegadores sem backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
    #theme-toggle {
        background: var(--search-bg);
    }
}

#theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: var(--shadow-md);
    background: var(--button-bg);
}

#theme-toggle:active {
    transform: scale(0.95);
    transition-duration: 100ms;
}

/* Animação de rotação ao trocar tema */
#theme-toggle.switching {
    animation: theme-switch-spin 400ms ease-out;
}

@keyframes theme-switch-spin {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.15);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* Estado de foco para acessibilidade */
#theme-toggle:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus), var(--shadow-sm);
}

/* Dark mode */
[data-theme="dark"] #theme-toggle {
    background: rgba(30, 30, 30, 0.8);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] #theme-toggle:hover {
    background: var(--filters-bg);
}

/* === RESPONSIVO === */
@media (max-width: 768px) {
    header {
        margin-bottom: 24px;
        padding: var(--spacing-sm) 0;
    }

    .logo-container {
        margin-bottom: 16px;
    }

    .logo-container img {
        max-height: 75px;
    }

    .prefeitura-nome {
        font-size: 17px;
        max-width: 85%;
    }

    #theme-toggle {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 18px;
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    header {
        margin-bottom: 20px;
    }

    .logo-container {
        margin-bottom: 12px;
    }

    .logo-container img {
        max-height: 50px;
    }

    .prefeitura-nome {
        font-size: 14px;
        max-width: 90%;
    }

    #theme-toggle {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
        font-size: 16px;
        padding: 6px 8px;
    }
}

@media (max-width: 320px) {
    .logo-container {
        display: none;
    }

    .prefeitura-nome {
        font-size: 12px;
        max-width: 95%;
    }

    #theme-toggle {
        top: 4px;
        right: 4px;
        width: 32px;
        height: 32px;
        font-size: 14px;
        padding: 4px 6px;
    }
}

/* === MOTION REDUCE === */
@media (prefers-reduced-motion: reduce) {
    .logo-container img,
    .prefeitura-nome,
    .prefeitura-nome::after,
    #theme-toggle {
        transition: none;
    }

    .logo-container img:hover {
        transform: none;
    }

    #theme-toggle:hover {
        transform: none;
    }

    #theme-toggle.switching {
        animation: none;
    }
}
