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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.title {
    font-size: 3rem;
    font-weight: bold;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    color: white;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

/* Status de Conexão */
.status-conexao {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.status-icon {
    font-size: 0.75rem;
}

.status-text {
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-conexao.online .status-icon {
    animation: pulse 2s infinite;
}

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

/* Seletor de Modalidade */
.modalidade-selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.btn-modalidade {
    padding: 0.75rem 2rem;
    border-radius: 0.75rem;
    font-weight: bold;
    font-size: 1.125rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-modalidade:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-modalidade.active {
    background: white;
    transform: scale(1.1);
}

.btn-modalidade.active:nth-child(1) {
    color: #16a34a;
}

.btn-modalidade.active:nth-child(2) {
    color: #ea580c;
}

/* Navegação por Abas */
.tabs-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: bold;
    font-size: 1.125rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tab-btn.active {
    background: white;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.tab-btn.active:nth-child(1) {
    color: #9333ea;
}

.tab-btn.active:nth-child(2) {
    color: #16a34a;
}

.tab-btn.active:nth-child(3) {
    color: #2563eb;
}

.tab-btn .icon {
    font-size: 1.5rem;
}

/* Conteúdo das Abas */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Grid Layout */
.grid-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 1rem;
}

/* Painel de Controle */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Quantidade de Números */
.quantidade-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 16rem;
    overflow-y: auto;
}

.quantidade-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.quantidade-option:hover {
    background-color: #f9fafb;
}

.quantidade-option input[type="radio"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.quantidade-option label {
    font-weight: 600;
    color: #374151;
    cursor: pointer;
}

/* Formulário */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #9333ea;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

/* Botões de Ação */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.btn-purple {
    background: linear-gradient(to right, #a855f7, #9333ea);
}

.btn-purple:hover {
    background: linear-gradient(to right, #9333ea, #7e22ce);
}

.btn-green {
    background: linear-gradient(to right, #22c55e, #16a34a);
}

.btn-green:hover {
    background: linear-gradient(to right, #16a34a, #15803d);
}

.btn-gray {
    background: linear-gradient(to right, #6b7280, #4b5563);
}

.btn-gray:hover {
    background: linear-gradient(to right, #4b5563, #374151);
}

.btn-blue {
    background: linear-gradient(to right, #3b82f6, #2563eb);
}

.btn-blue:hover {
    background: linear-gradient(to right, #2563eb, #1d4ed8);
}

/* Cartela Mega-Sena */
.cartela-megasena {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 0.5rem;
}

.numero-btn {
    aspect-ratio: 1;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    background: white;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #374151;
}

.numero-btn:hover {
    background: #f3f4f6;
    border-color: #9333ea;
    transform: scale(1.05);
}

.numero-btn.selected {
    background: linear-gradient(135deg, #9333ea, #7e22ce);
    color: white;
    border-color: #9333ea;
    transform: scale(1.1);
    box-shadow: 0 4px 6px rgba(147, 51, 234, 0.3);
}

/* Cartela Lotofácil */
.cartela-lotofacil {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

/* Últimos Resultados */
.ultimos-resultados {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.resultado-item {
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    border-left: 4px solid #9333ea;
}

.resultado-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #374151;
}

.resultado-numeros {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.resultado-numero {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #9333ea, #7e22ce);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
}

.no-results {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
}

/* Histórico */
.historico-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.historico-content {
    max-height: 600px;
    overflow-y: auto;
}

.historico-table {
    width: 100%;
    border-collapse: collapse;
}

.historico-table th,
.historico-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.historico-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    position: sticky;
    top: 0;
}

.historico-table tr:hover {
    background: #f9fafb;
}

/* Estatísticas */
.estatisticas-controls {
    margin-bottom: 1.5rem;
}

.btn-quick {
    transition: all 0.2s ease;
}

.btn-quick:hover {
    background: #e5e7eb !important;
    border-color: #9333ea !important;
    color: #9333ea;
    transform: translateY(-1px);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

.stat-card h4 {
    font-size: 1.125rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 1rem;
}

.numeros-frequentes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.numero-frequente {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    min-width: 4rem;
}

.numero-frequente-valor {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #9333ea, #7e22ce);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.numero-frequente-count {
    font-size: 0.75rem;
    color: #6b7280;
}

.loading {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
}

/* Repetições */
.repeticoes-resultado {
    min-height: 200px;
}

.repeticao-item {
    transition: all 0.2s ease;
}

.repeticao-item:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #9333ea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #7e22ce;
}

/* Responsividade */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }

    .modalidade-selector {
        flex-direction: column;
    }

    .tabs-nav {
        flex-direction: column;
    }

    .cartela-megasena {
        grid-template-columns: repeat(6, 1fr);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .historico-controls {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .cartela-megasena {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.25rem;
    }

    .numero-btn {
        font-size: 0.875rem;
    }
}
