/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a1a;
    color: #e0e0e0;
    min-height: 100vh;
}

.app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 12px;
    padding: 30px 40px;
    margin-bottom: 30px;
    border: 1px solid #2a2a4a;
}

.header-content h1 {
    font-size: 2.2rem;
    color: #4CAF50;
    font-weight: 300;
    margin-bottom: 5px;
}

.header-content p {
    color: #888;
    font-size: 0.95rem;
}

/* Filtros */
.filters-section {
    background: #1a1a2e;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #2a2a4a;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #aaa;
    font-weight: 600;
}

.filter-group select,
.filter-group input {
    padding: 10px 12px;
    background: #12122a;
    border: 1px solid #2a2a4a;
    color: #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.filter-group select option {
    background: #1a1a2e;
}

.filter-actions {
    flex-direction: row;
    align-items: flex-end;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    flex: 1;
}

.btn-primary {
    background: #4CAF50;
    color: #12122a;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-secondary {
    background: #2a2a4a;
    color: #ccc;
}

.btn-secondary:hover {
    background: #3a3a5a;
    transform: translateY(-2px);
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 15px;
    background: #12122a;
    border-radius: 8px;
    border: 1px solid #2a2a4a;
    font-size: 0.9rem;
    color: #888;
}

.status-bar span:first-child {
    color: #4CAF50;
    font-weight: 600;
}

#sortInfo {
    color: #ffb74d;
    font-size: 0.8rem;
}

/* Tabela */
.table-section {
    background: #1a1a2e;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #2a2a4a;
}

.table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead {
    background: #12122a;
    border-bottom: 2px solid #4CAF50;
}

thead th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    color: #888;
}

thead th.r {
    text-align: right;
}

/* Estilos para cabeçalhos ordenáveis */
#gamesTable thead th[data-sort] {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
    position: relative;
}

#gamesTable thead th[data-sort]:hover {
    color: #4CAF50;
}

#gamesTable thead th[data-sort] .sort-icon {
    display: inline-block;
    margin-left: 5px;
    font-size: 0.7rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

#gamesTable thead th[data-sort]:hover .sort-icon {
    opacity: 1;
}

/* Indicador de ordenação ativa */
#gamesTable thead th[data-sort].sort-active {
    color: #4CAF50;
}

#gamesTable thead th[data-sort].sort-active .sort-icon {
    opacity: 1;
    font-weight: bold;
}

tbody tr {
    border-bottom: 1px solid #2a2a4a;
    transition: background 0.2s;
}

tbody tr:hover {
    background: #252545;
}

tbody td {
    padding: 12px;
    vertical-align: middle;
}

tbody td.r {
    text-align: right;
}

.match-name {
    font-weight: 500;
    color: #fff;
}

.league-tag {
    font-size: 0.7rem;
    background: #2a2a4a;
    padding: 3px 12px;
    border-radius: 20px;
    color: #bbb;
    display: inline-block;
    white-space: nowrap;
}

.tc-tip {
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    background: #1a3a1a;
    color: #8bc34a;
    display: inline-block;
    font-size: 0.8rem;
}

.odds-cell {
    font-weight: 600;
    color: #ffb74d;
}

.conf-hi { 
    color: #4CAF50; 
    font-weight: 700; 
}

.conf-mid { 
    color: #ffb74d; 
    font-weight: 600; 
}

.conf-low { 
    color: #ef5350; 
    font-weight: 500; 
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #888;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 3px solid #2a2a4a;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Paginação */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid #2a2a4a;
}

.page-info {
    color: #888;
    font-size: 0.9rem;
}

.page-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.page-controls a,
.page-controls span {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    background: #12122a;
    color: #ccc;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
    border: 1px solid #2a2a4a;
    cursor: pointer;
}

.page-controls a:hover:not(.disabled):not(.active) {
    background: #2a2a4a;
    border-color: #4CAF50;
    color: #fff;
}

.page-controls a.active {
    background: #4CAF50;
    color: #12122a;
    border-color: #4CAF50;
    font-weight: 700;
}

.page-controls a.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.page-controls .page-ellipsis {
    background: transparent;
    border: none;
    color: #666;
}

/* Footer */
.footer {
    margin-top: 30px;
    text-align: center;
    padding: 20px;
    color: #555;
    font-size: 0.85rem;
    border-top: 1px solid #1a1a2e;
}

.footer a {
    color: #4CAF50;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsividade */
@media (max-width: 768px) {
    .app { padding: 10px; }
    
    .header { padding: 20px; }
    .header-content h1 { font-size: 1.5rem; }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .status-bar {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .pagination {
        flex-direction: column;
        align-items: stretch;
    }
    
    .page-info {
        text-align: center;
    }
    
    .page-controls {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    table { font-size: 0.75rem; }
    thead th, tbody td { padding: 8px 6px; }
    .league-tag { font-size: 0.6rem; padding: 2px 8px; }
    .tc-tip { font-size: 0.7rem; padding: 2px 8px; }
}
/* Estilos para campos de número (Odds) */
.filter-group input[type="number"] {
    padding: 10px 12px;
    background: #12122a;
    border: 1px solid #2a2a4a;
    color: #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s;
    width: 100%;
    -moz-appearance: textfield;
}

.filter-group input[type="number"]::-webkit-outer-spin-button,
.filter-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.filter-group input[type="number"]:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.filter-group input[type="number"]::placeholder {
    color: #555;
    font-size: 0.8rem;
}

/* Ajuste para os campos de odds ficarem lado a lado */
.filter-group.odds-group {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: flex-end;
}

.filter-group.odds-group .odd-input {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group.odds-group .odd-input label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #aaa;
    font-weight: 600;
}

.filter-group.odds-group .odd-input input {
    width: 100%;
}

/* Indicador de filtro ativo */
.filter-active {
    border-color: #4CAF50 !important;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* Responsividade para odds */
@media (max-width: 768px) {
    .filter-group.odds-group {
        flex-direction: column;
    }
}
/* Botões de ação */
.btn-success {
    background: #2196F3;
    color: #fff;
}

.btn-success:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-danger {
    background: #f44336;
    color: #fff;
}

.btn-danger:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

/* Estilos para resultados */
.result-select {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #2a2a4a;
    background: #12122a;
    color: #e0e0e0;
    font-size: 0.8rem;
    cursor: pointer;
    width: 100%;
    max-width: 90px;
}

.result-select option {
    background: #1a1a2e;
    color: #e0e0e0;
}

.result-select option[value="GREEN"] { color: #4CAF50; }
.result-select option[value="RED"] { color: #f44336; }
.result-select option[value="VOID"] { color: #ffb74d; }

.result-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-badge.green {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.result-badge.red {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.result-badge.void {
    background: rgba(255, 183, 77, 0.2);
    color: #ffb74d;
}

.profit-positive {
    color: #4CAF50;
    font-weight: 700;
}

.profit-negative {
    color: #f44336;
    font-weight: 700;
}

.profit-zero {
    color: #888;
    font-weight: 700;
}

/* Lucro total no status */
#profitInfo {
    font-size: 0.9rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    background: #12122a;
    border: 1px solid #2a2a4a;
}

#profitInfo.positive {
    color: #4CAF50;
    border-color: #4CAF50;
}

#profitInfo.negative {
    color: #f44336;
    border-color: #f44336;
}

#profitInfo.zero {
    color: #888;
    border-color: #444;
}

/* Ajuste para a tabela com mais colunas */
@media (max-width: 768px) {
    .filter-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    table {
        font-size: 0.7rem;
    }
    
    thead th, tbody td {
        padding: 6px 4px;
    }
    
    .result-select {
        font-size: 0.65rem;
        padding: 2px 4px;
        max-width: 60px;
    }
}

@media (max-width: 480px) {
    table {
        font-size: 0.6rem;
    }
    
    .result-select {
        font-size: 0.55rem;
        padding: 2px 3px;
        max-width: 50px;
    }
}
/* Mercados Grid */
.markets-grid {
    background: #12122a;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    border: 1px solid #2a2a4a;
}

.markets-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #aaa;
    font-weight: 600;
    margin-bottom: 10px;
}

.markets-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.market-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1a1a2e;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #2a2a4a;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
}

.market-checkbox:hover {
    border-color: #4CAF50;
    background: #252545;
}

.market-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4CAF50;
    cursor: pointer;
}

.market-checkbox.selected {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.market-checkbox .market-label {
    color: #e0e0e0;
    font-size: 0.8rem;
}

.market-checkbox .submarket-badge {
    font-size: 0.55rem;
    background: #2a2a4a;
    padding: 1px 8px;
    border-radius: 10px;
    color: #888;
}

.markets-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 5px 14px;
    font-size: 0.75rem;
    border-radius: 6px;
}

.btn-sm.btn-primary {
    background: #4CAF50;
    color: #12122a;
}

.btn-sm.btn-secondary {
    background: #2a2a4a;
    color: #ccc;
}

.btn-sm.btn-secondary:hover {
    background: #3a3a5a;
}

/* Badge de mercado na tabela */
.market-badge {
    display: inline-block;
    font-size: 0.6rem;
    padding: 2px 10px;
    border-radius: 12px;
    background: #2a2a4a;
    color: #aaa;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.market-badge.primary { background: rgba(76, 175, 80, 0.2); color: #4CAF50; }
.market-badge.secondary { background: rgba(33, 150, 243, 0.2); color: #2196F3; }
.market-badge.warning { background: rgba(255, 183, 77, 0.2); color: #ffb74d; }
.market-badge.danger { background: rgba(244, 67, 54, 0.2); color: #f44336; }
.market-badge.purple { background: rgba(156, 39, 176, 0.2); color: #ce93d8; }

/* Ajustes responsivos */
@media (max-width: 768px) {
    .markets-checkboxes {
        gap: 6px;
    }
    
    .market-checkbox {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
    
    .market-checkbox .submarket-badge {
        display: none;
    }
    
    .markets-actions {
        flex-direction: column;
    }
    
    .btn-sm {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .market-checkbox {
        font-size: 0.6rem;
        padding: 3px 8px;
    }
    
    .market-checkbox input[type="checkbox"] {
        width: 12px;
        height: 12px;
    }
}
/* Mercados com Submercados */
.markets-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.market-card {
    background: #12122a;
    border: 1px solid #2a2a4a;
    border-radius: 10px;
    padding: 12px 16px;
    min-width: 160px;
    flex: 1 1 auto;
    transition: all 0.3s;
}

.market-card:hover {
    border-color: #4CAF50;
}

.market-card .market-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}

.market-card .market-header input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4CAF50;
    cursor: pointer;
}

.market-card .market-header .market-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #e0e0e0;
    user-select: none;
}

.market-card .market-header .market-count {
    font-size: 0.6rem;
    color: #888;
    background: #1a1a2e;
    padding: 1px 8px;
    border-radius: 10px;
    margin-left: auto;
}

.market-card .submarkets {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding-left: 24px;
}

.market-card .submarket-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: #aaa;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 12px;
    background: #1a1a2e;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.market-card .submarket-item:hover {
    border-color: #4CAF50;
}

.market-card .submarket-item input[type="checkbox"] {
    width: 12px;
    height: 12px;
    accent-color: #4CAF50;
    cursor: pointer;
}

.market-card .submarket-item.selected {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.market-card .submarket-item .sub-label {
    user-select: none;
}

.market-card .submarket-item .sub-count {
    font-size: 0.55rem;
    color: #666;
}

/* Market card quando selecionado */
.market-card.selected {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.05);
}

.market-card.partial {
    border-color: #ffb74d;
    background: rgba(255, 183, 77, 0.05);
}

/* Responsividade */
@media (max-width: 768px) {
    .market-card {
        min-width: 100%;
        flex: 1 1 100%;
    }
    
    .market-card .submarkets {
        padding-left: 0;
    }
}

@media (max-width: 480px) {
    .market-card .submarket-item {
        font-size: 0.6rem;
        padding: 1px 6px;
    }
}
/* Estilo para os badges de tips na tabela */
.tip-badge {
    display: inline-block;
    margin: 2px 4px 2px 0;
    padding: 2px 10px;
    border-radius: 12px;
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    font-size: 0.7rem;
    white-space: nowrap;
}

.tip-badge .tc-tip {
    background: transparent;
    padding: 0;
    font-size: 0.7rem;
}

.tip-badge .odds-cell {
    font-size: 0.65rem;
    margin-left: 4px;
}

.tip-badge .conf-hi,
.tip-badge .conf-mid,
.tip-badge .conf-low {
    font-size: 0.6rem;
    margin-left: 4px;
}

/* Ajuste para coluna de Tips */
#gamesTable td:nth-child(5) {
    min-width: 200px;
}
/* Estilo para os badges de tips na tabela */
.tip-badge {
    display: inline-block;
    margin: 2px 4px 2px 0;
    padding: 2px 10px;
    border-radius: 12px;
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    font-size: 0.7rem;
    white-space: nowrap;
}

.tip-badge .tc-tip {
    background: transparent;
    padding: 0;
    font-size: 0.7rem;
}

.tip-badge .odds-cell {
    font-size: 0.65rem;
    margin-left: 4px;
}

.tip-badge .conf-hi,
.tip-badge .conf-mid,
.tip-badge .conf-low {
    font-size: 0.6rem;
    margin-left: 4px;
}

/* Destaque para tips recomendados */
.tip-badge.recommended {
    background: rgba(76, 175, 80, 0.15) !important;
    border-color: #4CAF50 !important;
}

.tip-badge.recommended .tc-tip {
    color: #4CAF50 !important;
    font-weight: 700 !important;
}

/* Ajuste para coluna de Tips */
#gamesTable td:nth-child(5) {
    min-width: 200px;
}

/* Top 3 Scores */
.top-scores {
    font-size: 0.7rem;
    color: #888;
    margin-top: 2px;
}

.top-scores .score {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    margin: 1px 2px;
    font-family: 'JetBrains Mono', monospace;
}

.top-scores .score.highlight {
    border-color: #4CAF50;
    color: #4CAF50;
}