/* ==========================================================
   Botões Globais
========================================================== */
.btn-custom {
    background-color: var(--primary-color) !important;
    color: white !important;
    transition: all 0.3s ease !important;
}

.btn-custom:hover {
    background-color: var(--primary-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(79, 70, 229, 0.35) !important;
}

.btn-custom i {
    transition: transform 0.3s ease;
}

.btn-custom:hover i {
    transform: translateX(5px);
}

.transition-hover {
    transition: transform 0.2s ease, filter 0.2s ease;
}

.transition-hover:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.btn-sidebar-action {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
    border: none !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
    white-space: nowrap !important;
}

.btn-sidebar-action:hover,
.btn-sidebar-action:active {
    background-color: #bae6fd !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

.btn-sidebar-action i {
    transition: transform 0.3s ease;
}

/* Força aparência consistente do ícone do toggle de tema */
.theme-toggle-icon {
    color: inherit !important;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-sidebar-action:hover i,
.btn-sidebar-action:active i {
    transform: scale(1.15);
}

/* Cor customizada para o botão de sair */
.btn-sidebar-action.text-logout {
    color: #212529 !important;
}
.btn-sidebar-action.text-logout i {
    color: #212529 !important;
}

/* Sobrescritas para o Tema Escuro (Dark Mode) */
[data-bs-theme="dark"] .btn-sidebar-action {
    background-color: rgba(14, 165, 233, 0.15) !important;
    color: #38bdf8 !important;
    border: none !important;
}

[data-bs-theme="dark"] .btn-sidebar-action.text-logout {
    color: #f8fafc !important;
}
[data-bs-theme="dark"] .btn-sidebar-action.text-logout i {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .btn-sidebar-action i {
    color: #38bdf8 !important;
}

/* Ajuste específico para o ícone de toggle em dark mode */
[data-bs-theme="dark"] .theme-toggle-icon {
    color: #f8fafc !important;
}

/* Força aparência consistente do ícone de toggle e do "Retornar Perfil" */
#themeToggleBtn .theme-toggle-icon {
    color: inherit !important;
    font-size: 1.05rem !important;
    line-height: 1 !important;
    filter: none !important;
    opacity: 1 !important;
    min-width: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-sidebar-action>i.fa-circle-arrow-left {
    color: inherit !important;
    font-size: 1.05rem !important;
    line-height: 1 !important;
    min-width: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Garantir cor apropriada no modo escuro para ambos */
[data-bs-theme="dark"] #themeToggleBtn .theme-toggle-icon,
[data-bs-theme="dark"] .btn-sidebar-action>i.fa-circle-arrow-left {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .btn-sidebar-action:hover,
[data-bs-theme="dark"] .btn-sidebar-action:active {
    background-color: rgba(56, 189, 248, 0.2) !important;
    color: #f8fafc !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 25px -5px rgba(0, 0, 0, 0.4) !important;
}

[data-bs-theme="dark"] .btn-sidebar-action:hover i,
[data-bs-theme="dark"] .btn-sidebar-action:active i {
    color: #f8fafc !important;
}

/* Desktop: forçar altura consistente dos botões na base da sidebar */
@media (min-width: 992px) {
    .student-sidebar .btn-sidebar-action {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 40px !important;
        height: 40px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #themeToggleBtn {
        height: 40px !important;
        width: 40px !important;
        flex-shrink: 0 !important;
    }
}

/* Mobile: forçar tamanho consistente dos botões na base da sidebar */
@media (max-width: 991.98px) {
    .student-sidebar .btn-sidebar-action {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0.5rem 0.85rem !important;
        min-height: 44px !important;
        height: 44px !important;
        font-size: 0.95rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .student-sidebar .btn-sidebar-action i,
    .student-sidebar .btn-sidebar-action .theme-toggle-icon {
        font-size: 1.05rem !important;
        line-height: 1 !important;
        flex-shrink: 0 !important;
    }

    /* garante que o botão menor (toggle) não encolha verticalmente */
    #themeToggleBtn {
        height: 44px !important;
        width: 44px !important;
        padding: 0.45rem !important;
        flex-shrink: 0 !important;
    }
}

/* ==========================================================
   Botões de Gerenciamento (Compartilhados entre Dashboards)
========================================================== */
.management-btn-box {
    background-color: rgba(14, 165, 233, 0.08) !important;
    color: var(--primary-color) !important;
    border: 1px solid rgba(14, 165, 233, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer;
}

.management-btn-box i {
    color: var(--primary-color) !important;
}

/* Ícone de Sucesso sempre verde */
.management-btn-box .text-success,
.management-btn-box .fa-circle-dollar-to-slot {
    color: #198754 !important;
}

.management-btn-box:hover {
    background-color: rgba(241, 245, 249, 0.95) !important;
    color: #334155 !important;
    border: 1px solid #334155 !important;
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 12px 25px -5px rgba(0, 0, 0, 0.15) !important;
}

.management-btn-box:hover i {
    color: #334155 !important;
}

/* Estado Ativo */
.management-btn-box.active {
    background-color: #334155 !important;
    color: #ffffff !important;
    border: 1px solid #334155 !important;
}

.management-btn-box.active i,
.management-btn-box.active span {
    color: #ffffff !important;
}

/* ==========================================================
   Sobrescrita Global de Botões Escuros (.btn-dark) no Tema Escuro
   Para garantir contraste e visualização clara.
========================================================== */
[data-bs-theme="dark"] .btn-dark {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-dark:hover,
[data-bs-theme="dark"] .btn-dark:focus {
    background-color: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
}