/**
 * CCPIX - Versão customizada do Bootstrap Dark
 * Este arquivo sobrescreve o bootstrap-dark.min.css para garantir consistência
 * entre desktop e mobile
 */

/* Forçando o tema escuro para todos os elementos fundamentais */

/* Cores de fundo e texto base */
body, html,
.bg-light, .bg-white,
.card, .card-header, .card-body, .card-footer,
.list-group, .list-group-item, .dropdown-menu, .dropdown-item,
.modal-content, .modal-header, .modal-body, .modal-footer,
.toast, .toast-header, .toast-body,
.popover, .popover-header, .popover-body,
.accordion, .accordion-item, .accordion-header, .accordion-button,
.btn-light, .btn-outline-light,
.table, thead, tbody, tr, th, td,
.input-group, .input-group-text, .form-control, .form-select,
input, select, textarea, button,
.navbar, .navbar-brand, .navbar-toggler, .navbar-nav, .nav-link,
.pagination, .page-link, .page-item,
.breadcrumb, .breadcrumb-item,
.progress, .alert {
    background-color: #0d1117 !important;
    color: #ffffff !important;
    border-color: #232830 !important;
}

/* Cards e containers */
.card, .card-header, .card-body, .card-footer {
    background-color: #1e2329 !important;
}

/* Elementos de formulário */
.form-control, .form-select, 
input[type="text"], input[type="email"], input[type="password"], 
input[type="date"], input[type="number"], input[type="search"], 
textarea, select {
    background-color: #0d1117 !important;
    color: #ffffff !important;
    border-color: #232830 !important;
}

/* Dropdown menus */
.dropdown-menu {
    background-color: #1e2329 !important;
    border-color: #232830 !important;
}

.dropdown-item, .dropdown-header {
    color: #ffffff !important;
}

.dropdown-item:hover, .dropdown-item:focus, 
.dropdown-item:active, .dropdown-item.active {
    background-color: #2c313a !important;
    color: #ffffff !important;
}

/* List groups */
.list-group-item {
    background-color: #1e2329 !important;
    color: #ffffff !important;
    border-color: #232830 !important;
}

.list-group-item-action:hover, .list-group-item-action:focus, 
.list-group-item-action:active, .list-group-item-action.active {
    background-color: #2c313a !important;
}

/* Tabelas */
.table, .table-striped > tbody > tr:nth-of-type(odd) > * {
    color: #ffffff !important;
    border-color: #232830 !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #232830 !important;
}

.table-hover > tbody > tr:hover > * {
    background-color: #2c313a !important;
    color: #ffffff !important;
}

/* Sobrescrever os estilos específicos que causam problemas em mobile */
@media (max-width: 992px) {
    /* Reforçando o tema dark em dispositivos móveis */
    .card, .card-header, .card-body, .card-footer {
        background-color: #1e2329 !important;
        border-color: #232830 !important;
        color: #ffffff !important;
    }
    
    /* Garantir que todos os containers usem o fundo escuro em mobile */
    div, main, section, article, aside, header, footer {
        background-color: #0d1117 !important;
        color: #ffffff !important;
    }
    
    /* Especialmente para os contêineres problemáticos */
    .container > div, .container > .row > div, .container > .row > .col {
        background-color: transparent !important;
    }
    
    /* Texto em dispositivos móveis */
    p, h1, h2, h3, h4, h5, h6, span, a, label, small {
        color: #ffffff !important;
    }
    
    /* Forçar transparência para elementos aninhados dentro de cartões */
    .card > div, .card-body > div {
        background-color: transparent !important;
    }
    
    /* Garantir que listas e tabelas dentro de cards sejam escuras */
    .card .list-group-item, .card .table {
        background-color: #1e2329 !important;
    }
    
    /* Elementos de noticias - problema específico identificado */
    div[class*="news"], .news-container, .news-list {
        background-color: #1e2329 !important;
        color: #ffffff !important;
    }
    
    /* Sobrescrever os estilos inline que podem ter cor clara */
    [style*="background-color: #fff"],
    [style*="background-color: white"],
    [style*="background-color: #ffffff"],
    [style*="background-color:#fff"],
    [style*="background-color:white"],
    [style*="background-color:#ffffff"],
    [style*="background-color: rgb(255, 255, 255)"],
    [style*="background-color:rgb(255, 255, 255)"],
    [style*="background-color: rgba(255, 255, 255"],
    [style*="background-color:rgba(255, 255, 255"] {
        background-color: #1e2329 !important;
    }
}

/* Preservar cores específicas de elementos do tema que não devem ser sobrescritas */
.text-primary, .text-primary * {
    color: #3BCFD4 !important;
}

.text-success, .text-success * {
    color: #00bc8c !important;
}

.text-danger, .text-danger * {
    color: #e74c3c !important;
}

.text-warning, .text-warning * {
    color: #f39c12 !important;
}

.text-info, .text-info * {
    color: #3498db !important;
}

/* Badges e botões com cores específicas */
.badge.bg-primary, .bg-primary, .btn-primary, .nav-pills .nav-link.active {
    background-color: #375a7f !important;
    color: white !important;
    border-color: #375a7f !important;
}

/* Hover para botões */
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: #2c4a69 !important;
    border-color: #2c4a69 !important;
}

.badge.bg-success, .bg-success {
    background-color: #00bc8c !important;
    color: white !important;
}

.badge.bg-warning, .bg-warning {
    background-color: #f39c12 !important;
    color: white !important;
}

.badge.bg-danger, .bg-danger {
    background-color: #e74c3c !important;
    color: white !important;
}

.badge.bg-info, .bg-info {
    background-color: #3498db !important;
    color: white !important;
}

/* Estilos da variante dark do Bootstrap */
[data-bs-theme=dark] {
    --bs-body-color: #fff;
    --bs-body-color-rgb: 255, 255, 255;
    --bs-body-bg: #0d1117;
    --bs-body-bg-rgb: 13, 17, 23;
    --bs-emphasis-color: #fff;
    --bs-emphasis-color-rgb: 255, 255, 255;
    --bs-secondary-color: rgba(255, 255, 255, 0.75);
    --bs-secondary-color-rgb: 255, 255, 255;
    --bs-secondary-bg: #1e2329;
    --bs-secondary-bg-rgb: 30, 35, 41;
    --bs-tertiary-color: rgba(255, 255, 255, 0.5);
    --bs-tertiary-color-rgb: 255, 255, 255;
    --bs-tertiary-bg: #232830;
    --bs-tertiary-bg-rgb: 35, 40, 48;
    --bs-primary-text-emphasis: #3BCFD4;
    --bs-secondary-text-emphasis: #8D95A3;
    --bs-success-text-emphasis: #00bc8c;
    --bs-info-text-emphasis: #3498db;
    --bs-warning-text-emphasis: #f39c12;
    --bs-danger-text-emphasis: #e74c3c;
    --bs-light-text-emphasis: #f8f9fa;
    --bs-dark-text-emphasis: #dee2e6;
    --bs-primary-bg-subtle: rgba(59, 207, 212, 0.15);
    --bs-secondary-bg-subtle: rgba(141, 149, 163, 0.15);
    --bs-success-bg-subtle: rgba(0, 188, 140, 0.15);
    --bs-info-bg-subtle: rgba(52, 152, 219, 0.15);
    --bs-warning-bg-subtle: rgba(243, 156, 18, 0.15);
    --bs-danger-bg-subtle: rgba(231, 76, 60, 0.15);
    --bs-light-bg-subtle: #1e2329;
    --bs-dark-bg-subtle: #2c313a;
    --bs-primary-border-subtle: rgba(59, 207, 212, 0.3);
    --bs-secondary-border-subtle: rgba(141, 149, 163, 0.3);
    --bs-success-border-subtle: rgba(0, 188, 140, 0.3);
    --bs-info-border-subtle: rgba(52, 152, 219, 0.3);
    --bs-warning-border-subtle: rgba(243, 156, 18, 0.3);
    --bs-danger-border-subtle: rgba(231, 76, 60, 0.3);
    --bs-light-border-subtle: #2c313a;
    --bs-dark-border-subtle: #343a40;
    --bs-link-color: #3BCFD4;
    --bs-link-hover-color: #2980B9;
    --bs-link-color-rgb: 59, 207, 212;
    --bs-link-hover-color-rgb: 41, 128, 185;
    --bs-code-color: #e685b5;
    --bs-border-color: #232830;
    --bs-border-color-translucent: rgba(255, 255, 255, 0.15);
}

/* Força o atributo data-bs-theme=dark em todos os elementos */
html, body, .card, .list-group, .dropdown-menu, .modal, .toast, .popover, .accordion {
    data-bs-theme: dark !important;
}
