/**
 * ==========================================================================
 *   GOLDEBET - BACBO STYLES
 *   Estilos específicos para o jogo BacBo da HistoricBet
 * ==========================================================================
 */

/* ============================
   SEÇÃO BACBO
   ============================ */

#bacbo-section {
    display: none;
    padding: 20px;
    background: #080301;
    min-height: 100vh;
}

#bacbo-section.active {
    display: block;
}

.bacbo-section {
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================
   HEADER BACBO
   ============================ */

.bacbo-header {
    margin-bottom: 30px;
}

.bacbo-header-top {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.bacbo-header h2 {
    color: var(--primary-gold);
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.bacbo-header h2 i {
    color: var(--accent-blue);
}

.game-description {
    color: var(--text-light);
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.9;
}

/* ============================
   CONTAINER PRINCIPAL
   ============================ */

.bacbo-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* ============================
   PAINEL DE ESTATÍSTICAS
   ============================ */

.bacbo-stats-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stats-header h3 {
    color: var(--primary-gold);
    font-size: 1.4rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-refresh {
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-refresh:hover {
    background: var(--primary-gold);
    transform: translateY(-2px);
}

.btn-refresh i {
    font-size: 1rem;
}

/* Toggle Switch */
.auto-refresh-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--accent-blue);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ============================
   ESTATÍSTICAS
   ============================ */

.bacbo-statistics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-label {
    display: block;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 8px;
    opacity: 0.8;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-gold);
}

.stat-value.red {
    color: #ff4757;
}

.stat-value.blue {
    color: #3742fa;
}

.stat-value.yellow {
    color: #ffa502;
}

/* ============================
   CONTAINER DE RESULTADOS
   ============================ */

.bacbo-results-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-header h3 {
    color: var(--primary-gold);
    font-size: 1.4rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.total-results,
.last-update {
    color: var(--text-light);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ============================
   LOADING E ERROR
   ============================ */

.bacbo-loading {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: var(--primary-gold);
}

.loading-spinner i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

.loading-spinner span {
    font-size: 1.1rem;
}

.bacbo-error {
    text-align: center;
    padding: 20px;
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: 10px;
    margin-bottom: 20px;
}

.error-message {
    color: #ff4757;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.1rem;
}

/* ============================
   GRID DE RESULTADOS
   ============================ */

.bacbo-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
}

.bacbo-result {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.bacbo-result:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.bacbo-result.red {
    border-color: rgba(255, 71, 87, 0.5);
    background: rgba(255, 71, 87, 0.1);
}

.bacbo-result.blue {
    border-color: rgba(55, 66, 250, 0.5);
    background: rgba(55, 66, 250, 0.1);
}

.bacbo-result.yellow {
    border-color: rgba(255, 165, 2, 0.5);
    background: rgba(255, 165, 2, 0.1);
}

.result-content {
    margin-bottom: 10px;
}

.result-score {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-gold);
    margin-bottom: 5px;
}

.result-winner {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 5px;
    opacity: 0.9;
}

.result-time {
    font-size: 0.8rem;
    color: var(--text-light);
    opacity: 0.7;
}

.result-color-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1.2rem;
}

/* ============================
   PAINEL DE INFORMAÇÕES
   ============================ */

.bacbo-info-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.info-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.info-icon {
    color: var(--accent-blue);
    font-size: 1.5rem;
    margin-top: 5px;
}

.info-content h4 {
    color: var(--primary-gold);
    font-size: 1.2rem;
    margin: 0 0 10px 0;
}

.info-content p {
    color: var(--text-light);
    margin: 0;
    line-height: 1.6;
    opacity: 0.9;
}

/* Legenda de cores */
.color-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
}

.color-indicator {
    font-size: 1.2rem;
}

/* ============================
   RESPONSIVIDADE
   ============================ */

@media (max-width: 1200px) {
    .bacbo-container {
        grid-template-columns: 1fr;
    }
    
    .bacbo-stats-panel {
        order: 2;
    }
    
    .bacbo-results-container {
        order: 1;
    }
}

@media (max-width: 768px) {
    #bacbo-section {
        padding: 15px;
    }
    
    .bacbo-header h2 {
        font-size: 2rem;
    }
    
    .bacbo-container {
        gap: 20px;
    }
    
    .bacbo-stats-panel,
    .bacbo-results-container {
        padding: 20px;
    }
    
    .bacbo-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .bacbo-result {
        padding: 12px;
    }
    
    .result-score {
        font-size: 1.5rem;
    }
    
    .stats-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .results-info {
        align-items: flex-start;
    }
    
    .bacbo-info-panel {
        grid-template-columns: 1fr;
    }
    
    .info-card {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .bacbo-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }
    
    .bacbo-result {
        padding: 10px;
    }
    
    .result-score {
        font-size: 1.3rem;
    }
    
    .result-winner {
        font-size: 0.8rem;
    }
    
    .result-time {
        font-size: 0.7rem;
    }
}

/* ============================
   ANIMAÇÕES
   ============================ */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.bacbo-result {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================
   SCROLLBAR CUSTOMIZADA
   ============================ */

.bacbo-results-grid::-webkit-scrollbar {
    width: 8px;
}

.bacbo-results-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.bacbo-results-grid::-webkit-scrollbar-thumb {
    background: var(--primary-gold);
    border-radius: 4px;
}

.bacbo-results-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}
