/**
 * CCPIX - Solução Agressiva para Tema Dark em Mobile
 * Este CSS sobrescreve todas as regras claras em dispositivos móveis
 */

/* Força aplicação do tema escuro em TODOS os elementos no modo mobile */
@media (max-width: 992px) {
    /* Redefine TODAS as cores e backgrounds */
    html, body, main,
    div, span, p, a, li, ul, ol, table,
    .card, .card-body, .card-header, .card-footer, 
    .container, .row, .col, .col-6, .col-12, .col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-12,
    .list-group, .list-group-item, .dropdown-menu, .dropdown-item {
        background-color: #0d1117 !important;
        border-color: #232830 !important;
    }
    
    /* Redefine TODAS as cores do texto */
    body, div, span, p, a, h1, h2, h3, h4, h5, h6, li, td, th, label, small {
        color: #ffffff !important;
    }
    
    /* Restaura cores dos cards - fundo um pouco mais claro */
    .card, .card-header, .card-body, .card-footer, 
    .list-group-item, .dropdown-menu, .dropdown-item {
        background-color: #1e2329 !important;
    }
    
    /* Especificamente para o card de notícias */
    .news-container, .news-list, .card-body:has(.news-list) {
        background-color: #1e2329 !important;
    }
    
    /* Para os cards de notícias com destaque */
    [style*="background: linear-gradient(135deg, rgba(59, 207, 212, 0.15)"],
    [style*="background:linear-gradient(135deg, rgba(59, 207, 212, 0.15)"] {
        background: linear-gradient(135deg, rgba(59, 207, 212, 0.15), rgba(41, 128, 185, 0.15)) !important;
        border-left: 4px solid #3BCFD4 !important;
    }
    
    /* Para cartões com estatísticas que estavam desaparecendo */
    [style*="background: rgba(30, 35, 40, 0.5)"],
    [style*="background:rgba(30, 35, 40, 0.5)"] {
        background: rgba(30, 35, 40, 0.5) !important;
        color: #ffffff !important;
    }
    
    /* Para os cards de cartões adquiridos */
    [style*="background: linear-gradient(to right, rgba(59, 207, 212, 0.1)"],
    [style*="background:linear-gradient(to right, rgba(59, 207, 212, 0.1)"] {
        background: linear-gradient(to right, rgba(59, 207, 212, 0.1), rgba(41, 128, 185, 0.1)) !important;
    }
    
    /* Para TODOS os elementos <div> dentro de .card-body */
    .card-body > div, .card-body div, .card > div, main > div {
        background-color: transparent !important;
    }
    
    /* Preserva as cores dos ícones específicos */
    i.text-primary, i[style*="color: #3BCFD4"], [style*="color: #3BCFD4"] {
        color: #3BCFD4 !important;
    }
    i.text-success {
        color: #00bc8c !important;
    }
    i.text-danger {
        color: #e74c3c !important;
    }
    i.text-warning {
        color: #f39c12 !important;
    }
    i.text-info {
        color: #3498db !important;
    }
    
    /* Preserva cores do texto com estilos específicos */
    [style*="color: #cccccc"] {
        color: #cccccc !important;
    }
    [style*="color: #aaa"] {
        color: #aaa !important;
    }
    [style*="color: rgba(255,255,255,"] {
        color: rgba(255,255,255,0.7) !important;
    }
    
    /* Preserva fundos dos gradientes nas ações rápidas */
    [style*="background: linear-gradient(135deg, #3BCFD4, #2980B9)"] {
        background: linear-gradient(135deg, #3BCFD4, #2980B9) !important;
    }
    [style*="background: linear-gradient(135deg, #2ECC71, #27AE60)"] {
        background: linear-gradient(135deg, #2ECC71, #27AE60) !important;
    }
    [style*="background: linear-gradient(135deg, #9B59B6, #6610f2)"] {
        background: linear-gradient(135deg, #9B59B6, #6610f2) !important;
    }
    [style*="background: linear-gradient(135deg, #E67E22, #D35400)"] {
        background: linear-gradient(135deg, #E67E22, #D35400) !important;
    }
    
    /* Forçar cores para valores de estatísticas */
    [style*="font-size: 1.8rem; font-weight: 700; margin-bottom: 10px; color: #3BCFD4"] {
        color: #3BCFD4 !important;
    }
    [style*="font-size: 1.8rem; font-weight: 700; margin-bottom: 10px; color: #9B59B6"] {
        color: #9B59B6 !important;
    }
    [style*="font-size: 1.8rem; font-weight: 700; margin-bottom: 10px; color: #E67E22"] {
        color: #E67E22 !important;
    }
    
    /* Para tabelas */
    table, thead, tbody, tr, th, td {
        background-color: #1e2329 !important;
        color: #ffffff !important;
        border-color: #232830 !important;
    }
    
    /* Atributo !important em todas as propriedades inline */
    div[style], span[style], a[style], p[style], h1[style], h2[style], 
    h3[style], h4[style], h5[style], h6[style], i[style] {
        background-color: inherit !important;
        color: inherit !important;
    }
    
    /* Reseta para elementos específicos */
    .badge.bg-success, .badge.bg-warning, .badge.bg-danger, 
    .badge.bg-info, .badge.bg-primary, .badge {
        color: white !important;
    }
    
    /* Cores específicas de texto */
    .text-primary, a.text-primary, .text-primary * {
        color: #375a7f !important;
    }
    .text-success, span.text-success {
        color: #00bc8c !important;
    }
    .text-danger, span.text-danger {
        color: #e74c3c !important;
    }
    .text-warning {
        color: #f39c12 !important;
    }
    .text-info {
        color: #3498db !important;
    }
    .text-muted {
        color: rgba(255,255,255,0.7) !important;
    }
}

/* SEMPRE aplicar cores base independente da resolução */
html, body {
    background-color: #0d1117 !important;
    color: #ffffff !important;
}

/* SEMPRE aplicar para os cards, independente da resolução */
.card, .card-header, .card-body, .card-footer {
    background-color: #1e2329 !important;
    border-color: #232830 !important;
    color: #ffffff !important;
}
