/* ============================================
   HEADER COMPONENT - ESTILOS GLOBAIS
   ============================================ */

/* Variáveis CSS definidas pelo tema centralizado (config/theme.php) */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    padding-top: 80px;
    padding-bottom: 64px;
    /* espaço para bottom nav no mobile */
}

/* ============================================
   HEADER FIXO TOPO
   ============================================ */

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    animation: slideDown 0.3s ease;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.header-brand:hover {
    transform: translateY(-2px);
}

.header-logo {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.header-name {
    display: none;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-dark);
}

.header-nav {
    display: none;
    gap: 0.5rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.nav-btn i {
    font-size: 1.1rem;
}

.nav-btn:hover {
    background: var(--bg-light);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.nav-btn.active {
    background: var(--primary-color);
    color: #fff;
}

.nav-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger-color);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* ============================================
   AÇÕES DE TOPO (CHIPS COM ÍCONES)
   ============================================ */

.header-actions {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.5rem;
}

.btn-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-chip i {
    font-size: 1rem;
}

.btn-chip:hover {
    background: var(--bg-light);
    color: var(--primary-color);
    border-color: var(--primary-light);
}

/* ============================================
   BOTÃO USUÁRIO
   ============================================ */

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.user-btn:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
}

/* ============================================
   BOTTOM NAVIGATION (MOBILE)
   ============================================ */

.mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-white);
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 0.25rem 0.5rem;
    z-index: 1000;
    display: grid;
    /* grid-template-columns é definido dinamicamente pelo PHP baseado nos itens ativos */
    gap: 0.25rem;
}

.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border-radius: 12px;
    background: transparent;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    position: relative;
}

.mobile-nav-btn i {
    font-size: 1.4rem;
}

.mobile-nav-btn.active {
    background: var(--primary-color);
    color: #fff;
}

.mobile-nav .nav-badge {
    top: 4px;
    right: 18%;
}


/* ============================================
   FORM KIT COMPARTILHADO
   ============================================ */

.form-label {
    font-weight: 700;
    color: #374151;
}

.form-control,
.form-select,
textarea.form-control {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #1f2937;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.card {
    border: 0;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: transparent;
    font-weight: 800;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }

    .header-name {
        display: block;
    }

    .header-nav {
        display: flex;
    }

    .header-actions {
        display: flex;
    }

    .mobile-nav {
        display: none;
    }

    .header-logo {
        width: 55px;
        height: 55px;
    }
}

@media (min-width: 1024px) {
    .header-name {
        font-size: 1.5rem;
    }

    .nav-btn {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
    }
}

/* ============================================
   ANIMAÇÕES
   ============================================ */

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

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