/**
 * Sistema de Alternância de Temas
 */

/* Tema Claro (padrão Bootstrap) */
body.theme-light {
    background-color: #f8f9fa;
    color: #212529 !important;
}

body.theme-light * {
    color: inherit;
}

body.theme-light .bg-dark {
    background-color: #ffffff !important;
}

body.theme-light .card {
    background-color: #ffffff;
    border-color: #dee2e6 !important;
    color: #212529;
}

body.theme-light .card-header {
    background-color: #f8f9fa;
    border-color: #dee2e6 !important;
    color: #212529;
}

body.theme-light .form-control,
body.theme-light .form-select {
    background-color: #ffffff;
    border-color: #ced4da;
    color: #212529;
}

body.theme-light .form-control:focus,
body.theme-light .form-select:focus {
    background-color: #ffffff;
    border-color: #86b7fe;
    color: #212529;
}

body.theme-light .table-dark {
    --bs-table-bg: #ffffff;
    --bs-table-striped-bg: #f8f9fa;
    --bs-table-hover-bg: #e9ecef;
    color: #212529 !important;
    border-color: #dee2e6;
}

/* No tema claro, usar tabela padrão ao invés de table-dark */
body.theme-light .table {
    --bs-table-bg: #ffffff;
    --bs-table-striped-bg: #f8f9fa;
    --bs-table-hover-bg: #e9ecef;
    color: #212529 !important;
    border-color: #dee2e6;
}

body.theme-light .navbar-dark {
    background-color: #343a40 !important;
}

body.theme-light .navbar-brand,
body.theme-light .nav-link {
    color: #ffffff !important;
}

body.theme-light .navbar {
    border-bottom: 1px solid #dee2e6 !important;
}

body.theme-light .dropdown-menu-dark {
    background-color: #343a40;
    border-color: #495057;
    color: #ffffff !important;
}

body.theme-light .dropdown-menu {
    background-color: #ffffff;
    border-color: #dee2e6;
}

body.theme-light .dropdown-item {
    color: #212529 !important;
}

body.theme-light .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #212529 !important;
}

body.theme-light .text-muted {
    color: #6c757d !important;
}

body.theme-light .border-secondary {
    border-color: #dee2e6 !important;
}

body.theme-light .alert-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

body.theme-light .alert-danger {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

body.theme-light .alert-info {
    background-color: #cff4fc;
    border-color: #b6effb;
    color: #055160;
}

body.theme-light .alert-warning {
    background-color: #fff3cd;
    border-color: #ffecb5;
    color: #664d03;
}

body.theme-light ::-webkit-scrollbar-track {
    background: #f1f1f1;
}

body.theme-light ::-webkit-scrollbar-thumb {
    background: #888;
}

body.theme-light ::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Garantir que todos os textos sejam visíveis no tema claro */
body.theme-light label,
body.theme-light .form-label,
body.theme-light small,
body.theme-light .small {
    color: #212529 !important;
}

body.theme-light h1,
body.theme-light h2,
body.theme-light h3,
body.theme-light h4,
body.theme-light h5,
body.theme-light h6 {
    color: #212529 !important;
}

body.theme-light p,
body.theme-light span,
body.theme-light div,
body.theme-light td,
body.theme-light th {
    color: #212529 !important;
}

/* Botão de alternância de tema */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

body.theme-dark .theme-toggle {
    background-color: #0d6efd;
    color: white;
}

body.theme-light .theme-toggle {
    background-color: #343a40;
    color: white;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* Corrigir contraste no tema escuro */
body.theme-dark {
    background-color: #0d1117;
    color: #e6edf3 !important; /* Fonte mais clara */
}

body.theme-dark .card {
    background-color: #161b22;
    border-color: #30363d !important;
    color: #e6edf3 !important; /* Fonte mais clara */
}

body.theme-dark .card-header {
    background-color: #21262d;
    border-color: #30363d !important;
    color: #e6edf3 !important; /* Fonte mais clara */
}

body.theme-dark .form-control,
body.theme-dark .form-select {
    background-color: #0d1117;
    border-color: #30363d;
    color: #e6edf3 !important; /* Fonte mais clara */
}

body.theme-dark .table-dark {
    color: #e6edf3 !important; /* Fonte mais clara */
}

body.theme-dark .text-muted {
    color: #8b949e !important;
}

body.theme-dark h1, 
body.theme-dark h2, 
body.theme-dark h3, 
body.theme-dark h4, 
body.theme-dark h5, 
body.theme-dark h6 {
    color: #e6edf3 !important;
}

body.theme-dark p,
body.theme-dark span,
body.theme-dark div,
body.theme-dark td,
body.theme-dark th {
    color: #e6edf3 !important;
}

body.theme-dark .navbar-brand,
body.theme-dark .nav-link {
    color: #e6edf3 !important;
}

/* Modais no tema escuro */
body.theme-dark .modal-content {
    background-color: #161b22;
    color: #e6edf3 !important;
    border-color: #30363d;
}

body.theme-dark .modal-header {
    border-bottom-color: #30363d;
    color: #e6edf3 !important;
}

body.theme-dark .modal-footer {
    border-top-color: #30363d;
}

body.theme-dark .modal-body {
    color: #e6edf3 !important;
}

body.theme-dark .modal-title {
    color: #e6edf3 !important;
}

body.theme-dark .btn-close {
    filter: invert(1);
}

