/* ===== PINBET DOUBLE HISTORY - CSS OTIMIZADO ===== */

/* ===== 1. VARIÁVEIS CSS CENTRALIZADAS ===== */
:root {
    /* Cores Principais */
    --bg-dark: #1a1a1a;
    --bg-darker: #0d0d0d;
    --bg-darkest: #000000;
    --purple: #6f42c1;
    --purple-dark: #5a359a;
    --purple-light: #8e44ad;
    
    /* Cores de Resultados */
    --red: #dc3545;
    --red-dark: #c82333;
    --black: #212529;
    --black-dark: #1a1a1a;
    --white: #ffffff;
    --white-bg: #f8f9fa;
    
    /* Cores de Status */
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    --gray: #6c757d;
    --gray-light: #adb5bd;
    
    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.4);
    
    /* Transições */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Breakpoints */
    --bp-xl: 1200px;
    --bp-lg: 992px;
    --bp-md: 768px;
    --bp-sm: 576px;
}

/* ===== 2. RESET E BASE ===== */
* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 50%, var(--bg-darkest) 100%);
    color: var(--white);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(111, 66, 193, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(220, 53, 69, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ===== 2.1. SEÇÃO HERO MODERNA ===== */
.hero-section {
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-darkest) 100%);
    border-radius: 0 0 30px 30px;
    padding: 3rem 0;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(111, 66, 193, 0.05) 50%, transparent 70%);
    animation: heroShimmer 4s ease-in-out infinite;
}

@keyframes heroShimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--white) 0%, var(--purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.2rem;
    text-align: center;
    color: var(--gray-light);
    margin-bottom: 2rem;
    font-weight: 500;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.hero-stat {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.hero-stat:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.hero-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.hero-stat-label {
    font-size: 0.9rem;
    color: var(--gray-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== 3. NAVEGAÇÃO MODERNA ===== */
.navbar {
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
    box-shadow: 0 4px 20px rgba(111, 66, 193, 0.3);
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--white);
    text-decoration: none;
    transition: var(--transition-normal);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.navbar-brand:hover {
    color: var(--white);
    transform: scale(1.05);
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.navbar-brand-container {
    flex: 1;
    display: flex;
    justify-content: center;
}

.navbar-nav-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    width: 100%;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 0;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: var(--white) !important;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all var(--transition-normal);
    position: relative;
    text-decoration: none;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--white);
    transition: all var(--transition-normal);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* Responsividade para navegação centralizada */
@media (max-width: 991px) {
    .navbar-brand-container {
        justify-content: flex-start;
    }
    
    .navbar-nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
    }
    
    .navbar-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .navbar-actions {
        justify-content: center;
    }
}

/* ===== 4. GRID DE RESULTADOS MODERNO ===== */
.results-section {
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-darkest) 100%);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.results-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--purple), var(--red), var(--warning));
    border-radius: 20px 20px 0 0;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 20px;
    padding: 30px 0 40px 0;
    max-width: 100%;
    overflow-x: auto;
    position: relative;
    margin-top: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.empty-state {
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.result-item {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    box-shadow: var(--shadow-sm);
    border: 2px solid rgba(255, 255, 255, 0.1);
    will-change: transform, opacity;
}

.result-item:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

/* Cores dos Resultados */
.result-red {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: var(--white);
    border: 2px solid rgba(220, 53, 69, 0.3);
}

.result-black {
    background: linear-gradient(135deg, var(--black) 0%, var(--black-dark) 100%);
    color: var(--white);
    border: 2px solid var(--white);
    box-shadow: var(--shadow-md);
}

.result-white {
    background: linear-gradient(135deg, var(--white) 0%, var(--white-bg) 100%);
    color: var(--black);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.result-white i {
    color: #ff6b35;
    font-size: 20px;
}

/* Bordas para resultados pretos */
.result-item.bg-dark,
.result-item[data-color="2"] {
    border: 2px solid var(--white) !important;
    box-shadow: var(--shadow-md) !important;
}

.result-item.bg-dark:hover,
.result-item[data-color="2"]:hover {
    border: 2px solid var(--white) !important;
    box-shadow: var(--shadow-lg) !important;
}

/* ===== 5. TIMESTAMPS E TOOLTIPS ===== */
.result-time {
    font-size: 0.75rem !important;
    color: var(--white) !important;
    text-align: center;
    margin-top: 3px;
    white-space: nowrap;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    width: 100%;
    display: block;
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 4px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    z-index: 5;
    line-height: 1.2;
    min-height: 16px;
}

.result-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: var(--white);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
    margin-bottom: 15px;
    margin-top: 30px;
}

.result-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.result-item:hover .result-tooltip {
    opacity: 1;
}

/* ===== 6. CARDS DE ESTATÍSTICAS MODERNOS ===== */
.statistics-card {
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-darkest) 100%);
    border-radius: 20px;
    padding: 2rem;
    margin: 1rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.statistics-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--purple), var(--red), var(--warning));
    border-radius: 20px 20px 0 0;
}

.statistics-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.statistics-card h6 {
    color: var(--white);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--purple);
    padding-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.statistics-card .stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin: 1rem 0;
}

.statistics-card .stat-label {
    color: var(--gray-light);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.statistics-card .stat-percentage {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.statistics-card .stat-percentage.red {
    color: var(--red);
}

.statistics-card .stat-percentage.black {
    color: var(--white);
}

.statistics-card .stat-percentage.white {
    color: var(--warning);
}

/* ===== 7. FORMULÁRIOS E CONTROLES MODERNOS ===== */
.controls-section {
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-darkest) 100%);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.controls-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--purple), var(--red), var(--warning), var(--purple));
    background-size: 200% 100%;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.form-select, .form-control {
    background: linear-gradient(135deg, var(--bg-darker) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-radius: 12px;
    transition: all var(--transition-normal);
    font-weight: 500;
    padding: 0.75rem 1rem;
    backdrop-filter: blur(10px);
}

.form-select:focus, .form-control:focus {
    background: linear-gradient(135deg, var(--bg-darker) 0%, rgba(111, 66, 193, 0.1) 100%);
    border-color: var(--purple);
    color: var(--white);
    box-shadow: 0 0 0 0.2rem rgba(111, 66, 193, 0.25), 0 4px 12px rgba(111, 66, 193, 0.2);
    outline: none;
    transform: translateY(-2px);
}

.form-label {
    color: var(--white);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

/* ===== 8. BOTÕES MODERNOS ===== */
.btn {
    border-radius: 12px;
    transition: all var(--transition-normal);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    border: none;
    padding: 0.75rem 1.5rem;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(111, 66, 193, 0.3);
    border: 2px solid transparent;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(111, 66, 193, 0.4);
}

.btn-outline-light {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    backdrop-filter: blur(10px);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--purple);
    color: var(--purple);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(111, 66, 193, 0.2);
}

.btn-refresh {
    background: linear-gradient(135deg, var(--info) 0%, #0d6efd 100%);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.btn-refresh:hover {
    background: linear-gradient(135deg, #0d6efd 0%, var(--info) 100%);
    transform: translateY(-3px) rotate(180deg);
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.4);
}

/* ===== 9. POPUP MODERNO ===== */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn var(--transition-normal);
}

.popup-content {
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-darkest) 100%);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    overflow: hidden;
    animation: slideIn 0.4s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-header {
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-light) 100%);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-weight: bold;
    font-size: 1.2rem;
}

.popup-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.popup-body {
    padding: 30px;
    text-align: center;
}

.popup-offer h3 {
    color: var(--purple);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.popup-offer p {
    color: var(--gray-light);
    margin-bottom: 20px;
}

.popup-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px 0;
}

.popup-btn {
    padding: 15px 25px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
}

.popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===== 10. SISTEMA DE SELEÇÃO ===== */
.result-item.selected {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(111, 66, 193, 0.8);
    border: 3px solid var(--purple);
    z-index: 10;
}

.result-item.highlighted {
    opacity: 0.3;
    filter: blur(1px);
}

.result-item.highlighted.selected {
    opacity: 1;
    filter: none;
}

/* ===== 11. ANIMAÇÕES ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes slideInFromRight {
    0% { 
        transform: translateX(100px) scale(0.8); 
        opacity: 0; 
    }
    50% {
        transform: translateX(50px) scale(0.9);
        opacity: 0.7;
    }
    100% { 
        transform: translateX(0) scale(1); 
        opacity: 1; 
    }
}

@keyframes slideOutToLeft {
    0% { 
        transform: translateX(0) scale(1); 
        opacity: 1; 
    }
    100% { 
        transform: translateX(-100px) scale(0.8); 
        opacity: 0; 
    }
}

@keyframes smoothShiftRight {
    0% { transform: translateX(0); }
    100% { transform: translateX(70px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Classes de animação */
.new-result {
    animation: slideInFromRight 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 10;
}

.old-result {
    animation: slideOutToLeft 0.4s ease-in;
    z-index: 1;
}

.smooth-shift {
    animation: smoothShiftRight 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* ===== 12. RESPONSIVIDADE OTIMIZADA ===== */

/* Desktop Grande (1200px+) */
@media (min-width: 1200px) {
    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 20px;
        padding: 50px 0 60px 0;
    }
    
    .result-item {
        width: 60px;
        height: 60px;
        font-size: 18px;
    }
    
    .result-time {
        font-size: 0.75rem !important;
        bottom: -20px;
        padding: 2px 4px;
    }
}

/* Desktop (992px - 1199px) */
@media (max-width: 1199px) and (min-width: 992px) {
    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
        gap: 15px;
        padding: 40px 0 50px 0;
    }
    
    .result-item {
        width: 55px;
        height: 55px;
        font-size: 16px;
    }
    
    .result-time {
        font-size: 0.7rem !important;
        bottom: -18px;
        padding: 1px 3px;
    }
}

/* Tablet (768px - 991px) */
@media (max-width: 991px) and (min-width: 768px) {
    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 12px;
        padding: 35px 0 45px 0;
    }
    
    .result-item {
        width: 50px;
        height: 50px;
        font-size: 14px;
    }
    
    .result-time {
        font-size: 0.65rem !important;
        bottom: -16px;
        padding: 1px 2px;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .statistics-card {
        min-height: 120px;
        padding: 15px;
    }
}

/* Mobile Grande (576px - 767px) */
@media (max-width: 767px) and (min-width: 576px) {
    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
        gap: 10px;
        padding: 30px 0 40px 0;
    }
    
    .result-item {
        width: 45px;
        height: 45px;
        font-size: 12px;
    }
    
    .result-time {
        font-size: 0.6rem !important;
        bottom: -14px;
        padding: 1px 2px;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .container-fluid {
        padding: 0.5rem;
    }
    
    .form-select, .form-control {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    .statistics-card {
        min-height: 100px;
        padding: 12px;
    }
    
    .popup-content {
        width: 90%;
        max-width: 400px;
        padding: 1.5rem;
    }
}

/* Mobile (até 575px) */
@media (max-width: 575px) {
    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
        gap: 8px;
        padding: 25px 0 35px 0;
    }
    
    .result-item {
        width: 40px;
        height: 40px;
        font-size: 10px;
    }
    
    .result-time {
        font-size: 0.55rem !important;
        bottom: -12px;
        padding: 1px 1px;
    }
    
    .navbar-brand {
        font-size: 0.9rem;
    }
    
    .container-fluid {
        padding: 0.3rem;
    }
    
    .form-select, .form-control {
        font-size: 0.8rem;
        padding: 0.4rem;
    }
    
    .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .row {
        margin: 0;
    }
    
    .col-md-6 {
        padding: 0.2rem;
    }
    
    .statistics-card {
        min-height: 80px;
        padding: 10px;
    }
    
    .popup-content {
        width: 95%;
        max-width: 350px;
        padding: 1rem;
    }
    
    .popup-header h3 {
        font-size: 1rem;
    }
    
    .popup-body p {
        font-size: 0.8rem;
    }
    
    .popup-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* ===== 13. CORREÇÕES ESPECÍFICAS PARA FIREFOX ===== */
@-moz-document url-prefix() {
    .results-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
        gap: 12px;
        padding: 35px 0 45px 0;
    }
    
    .result-item {
        width: 55px;
        height: 55px;
        font-size: 14px;
        -moz-box-sizing: border-box;
    }
    
    .result-time {
        font-size: 0.65rem !important;
        bottom: -16px;
        padding: 1px 2px;
    }
    
    .container-fluid {
        padding: 0.3rem;
    }
    
    .form-select, .form-control {
        font-size: 0.8rem;
        padding: 0.4rem;
    }
    
    .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* ===== 14. UTILITÁRIOS ===== */
.text-danger { color: var(--red) !important; }
.text-warning { color: var(--warning) !important; }
.text-success { color: var(--success) !important; }
.text-info { color: var(--info) !important; }
.text-muted { color: var(--gray) !important; }

.bg-darker { background-color: var(--bg-darker) !important; }
.bg-darkest { background-color: var(--bg-darkest) !important; }

.status-online { color: var(--success); }
.status-offline { color: var(--danger); }
.status-warning { color: var(--warning); }

/* ===== 15. SCROLLBAR PERSONALIZADA ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--purple);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--purple-dark);
}

/* ===== 16. LOADING E ESTADOS ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.stat-item.loading {
    opacity: 0.6;
}

.stat-item.loading span {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ===== 17. TOOLTIP CUSTOMIZADO ===== */
.tooltip {
    font-size: 12px;
}

.tooltip-inner {
    background-color: var(--bg-darkest);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

/* ===== 18. MODAL ===== */
.modal-content {
    background-color: var(--bg-darker);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== 19. FOOTER ===== */
footer {
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-darkest) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== 20. ACESSIBILIDADE ===== */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--purple);
    outline-offset: 2px;
}

.result-item:focus {
    outline: 2px solid var(--purple);
    outline-offset: 2px;
}

/* ===== 21. PERFORMANCE ===== */
.result-item {
    will-change: transform, opacity;
    transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.animate {
    will-change: transform;
}

/* ===== 22. VALIDADOR DE PADRÕES ===== */
.pattern-tab {
    background: rgba(111, 66, 193, 0.2);
    border: 1px solid var(--purple);
    border-radius: 8px;
    padding: 8px 16px;
    color: var(--white);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.pattern-tab.active {
    background: var(--purple);
    border-color: var(--purple);
}

.pattern-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    min-height: 50px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pattern-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pattern-element {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.pattern-element.red { background: var(--red); }
.pattern-element.black { background: var(--black); }
.pattern-element.white { background: var(--white); color: var(--black); }
.pattern-element.blue { background: var(--info); }

.color-selector {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.color-option {
    cursor: pointer;
    transition: all var(--transition-normal);
    border-radius: 50%;
    padding: 4px;
    border: 2px solid transparent;
}

.color-option:hover {
    transform: scale(1.1);
    border-color: var(--purple);
}

.color-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--white);
    transition: all var(--transition-normal);
}

.color-option:hover .color-circle {
    transform: scale(1.05);
}

.color-split-red-white {
    background: linear-gradient(45deg, var(--red) 50%, var(--white) 50%);
}

.color-split-black-white {
    background: linear-gradient(45deg, var(--black) 50%, var(--white) 50%);
}

.color-split-red-black {
    background: linear-gradient(45deg, var(--red) 50%, var(--black) 50%);
}

.number-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.number-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
    font-size: 14px;
}

.number-option[data-color="red"] {
    background: var(--red);
    color: var(--white);
}

.number-option[data-color="black"] {
    background: var(--black);
    color: var(--white);
}

.number-option[data-color="white"] {
    background: var(--white);
    color: var(--black);
    border-color: var(--gray-light);
}

.number-option:hover {
    transform: scale(1.1);
    border-color: var(--purple);
}

.gale-control {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 120px;
    margin: 0 auto;
}

.gale-input {
    text-align: center;
    width: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    border-radius: 4px;
}

.gale-input:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--purple);
    color: var(--white);
    outline: none;
}

.stat-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-normal);
}

.stat-item:last-child {
    border-bottom: none;
}

/* ===== 23. RESPONSIVIDADE PARA VALIDADOR ===== */
@media (max-width: 768px) {
    .color-selector {
        gap: 8px;
    }
    
    .color-circle {
        width: 35px;
        height: 35px;
    }
    
    .number-selector {
        gap: 6px;
    }
    
    .number-option {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    .pattern-display {
        justify-content: center;
    }
    
    .pattern-element {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }
}

/* ===== HISTÓRICO DE RESULTADOS ===== */
.history-result-item {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

/* ===== BOTÕES INTERATIVOS ===== */
.clickable-stat {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.clickable-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05));
}

.clickable-stat:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.clickable-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.clickable-stat:hover::before {
    left: 100%;
}

/* ===== DESTAQUES DE SEQUÊNCIAS ===== */
.highlighted-red {
    animation: highlightRed 2s ease-in-out infinite;
    border: 3px solid #dc3545 !important;
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.8) !important;
    transform: scale(1.1);
    z-index: 10;
    opacity: 1 !important;
    filter: none !important;
}

.highlighted-black {
    animation: highlightBlack 2s ease-in-out infinite;
    border: 3px solid #6c757d !important;
    box-shadow: 0 0 20px rgba(108, 117, 125, 0.8) !important;
    transform: scale(1.1);
    z-index: 10;
    opacity: 1 !important;
    filter: none !important;
}

.highlighted-white {
    animation: highlightWhite 2s ease-in-out infinite;
    border: 3px solid #ffc107 !important;
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.8) !important;
    transform: scale(1.1);
    z-index: 10;
    opacity: 1 !important;
    filter: none !important;
}

/* ===== EFEITO DE OPACIDADE PARA OUTROS RESULTADOS ===== */
.result-item.dimmed {
    opacity: 0.3;
    filter: blur(1px);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

/* Garantir que itens destacados não fiquem opacos */
.result-item.highlighted-red,
.result-item.highlighted-black,
.result-item.highlighted-white {
    opacity: 1 !important;
    filter: none !important;
}

/* ===== DROPDOWN TEMA ESCURO ===== */
.form-select {
    background-color: var(--bg-dark) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-light) !important;
}

.form-select:focus {
    background-color: var(--bg-dark) !important;
    border-color: var(--primary-color) !important;
    color: var(--text-light) !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25) !important;
}

.form-select option {
    background-color: var(--bg-dark) !important;
    color: var(--text-light) !important;
}

.form-select option:hover {
    background-color: var(--bg-darker) !important;
    color: var(--text-light) !important;
}

.form-select option:checked {
    background-color: var(--primary-color) !important;
    color: var(--bg-dark) !important;
}

/* Estilo para dropdown aberto */
.form-select:focus option {
    background-color: var(--bg-dark) !important;
    color: var(--text-light) !important;
}

/* Garantir que o dropdown mantenha o tema escuro */
select.form-select {
    background-image: none !important;
    background: var(--bg-dark) !important;
}

/* Remover qualquer padrão visual do dropdown */
.form-select::before,
.form-select::after {
    display: none !important;
    content: none !important;
}

/* Garantir que não há setas ou padrões */
.form-select {
    background-image: none !important;
    background-repeat: no-repeat !important;
    background-position: right !important;
    background-size: auto !important;
}

@keyframes highlightRed {
    0%, 100% {
        box-shadow: 0 0 20px rgba(220, 53, 69, 0.8);
        transform: scale(1.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(220, 53, 69, 1);
        transform: scale(1.15);
    }
}

@keyframes highlightBlack {
    0%, 100% {
        box-shadow: 0 0 20px rgba(108, 117, 125, 0.8);
        transform: scale(1.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(108, 117, 125, 1);
        transform: scale(1.15);
    }
}

@keyframes highlightWhite {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 193, 7, 0.8);
        transform: scale(1.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 193, 7, 1);
        transform: scale(1.15);
    }
}

/* Container do histórico com transições */
#historyResults {
    transition: all 0.3s ease;
}

/* Animação para novos resultados */
.history-result-item.new-result {
    animation: slideInFromTop 0.5s ease-out;
}

@keyframes slideInFromTop {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.history-result-item:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.history-result-item.bg-danger {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    color: white !important;
}

.history-result-item.bg-dark {
    background: linear-gradient(135deg, #343a40, #23272b) !important;
    color: white !important;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.history-result-item.bg-light {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
    color: #212529 !important;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.history-result-item i {
    font-size: 0.9rem;
}

/* Destaque para posições específicas */
.history-result-item[data-index="0"] {
    border: 3px solid #ffc107;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

.history-result-item[data-index="1"] {
    border: 2px solid #17a2b8;
    box-shadow: 0 0 8px rgba(23, 162, 184, 0.3);
}