/* Main styles for LogupDigital */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Selection Panel */
.selection-panel {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
    transform: translateY(20px);
    animation: slideUp 0.6s ease-out forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
    }
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
}

.col-md-6 {
    flex: 1;
    min-width: 300px;
    padding: 10px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.text-center {
    text-align: center;
}

/* Analysis Container */
.analysis-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

/* Loading Indicator */
.loading {
    text-align: center;
    padding: 50px 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading p {
    font-size: 1.1em;
    color: #666;
    margin: 0;
}

/* Alert styles */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 8px;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert h4 {
    margin-top: 0;
    color: inherit;
}

/* Ajustes de Layout para Análise */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

/* FORÇAR 10 NÚMEROS (5 por linha) PARA NÚMEROS QUENTES E FRIOS */
#hotNumbers .numbers-grid,
#coldNumbers .numbers-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 10px !important;
}

/* FORÇAR 12 NÚMEROS POR LINHA NA TIMELINE E AUMENTAR TAMANHO */
#sequenceTimeline .timeline-numbers {
    display: grid !important;
    grid-template-columns: repeat(12, 1fr) !important;
    gap: 8px !important; /* Aumentar espaçamento */
    margin-bottom: 15px !important;
}

.timeline-number {
    width: 40px !important; /* Aumentar largura */
    height: 40px !important; /* Aumentar altura */
    font-size: 1rem !important; /* Aumentar fonte */
    line-height: 40px !important; /* Centralizar verticalmente */
}


/* CORRIGIR COR DO TEXTO NAS SEÇÕES DE DISTRIBUIÇÃO */
.color-section, .parity-section, .range-section {
    color: #000 !important; /* Texto preto para legibilidade em todos os fundos */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.color-count, .parity-count, .range-count {
    font-size: 1.1rem;
    font-weight: 700;
}

.percentage-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Novo Layout de Lista para Distribuições */
.distribution-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 0;
}

.dist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.dist-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dist-label {
    flex-grow: 1;
    font-weight: 500;
}

.dist-value {
    font-weight: 600;
    white-space: nowrap;
}


/* Correção Definitiva para Números Quentes e Frios */
.analysis-card #hotNumbers .numbers-grid,
.analysis-card #coldNumbers .numbers-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 8px !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .selection-panel {
        padding: 20px;
    }
    
    .row {
        margin: -5px;
    }
    
    .col-md-6 {
        min-width: 100%;
        padding: 5px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8em;
    }
    
    .header p {
        font-size: 1em;
    }
    
    .selection-panel {
        padding: 15px;
    }
    
    .analysis-container {
        padding: 20px;
    }
}

/* ANÁLISE DO ÚLTIMO NÚMERO */
.last-number-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.last-number-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 20px;
    color: white;
    text-align: center;
    min-width: 200px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.last-number-value {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.last-number-time {
    font-size: 0.9rem;
    opacity: 0.9;
}

.pattern-checks {
    flex: 1;
    min-width: 300px;
}

.pattern-check {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.pattern-check.active {
    background: #d4edda;
    border-color: #c3e6cb;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

.pattern-check h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pattern-check.active h4 {
    color: #155724;
}

.pattern-targets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.target-number {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: bold;
}

.pattern-check.active .target-number {
    background: #28a745;
}

/* INDICADOR DE TEMPO REAL */
.realtime-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0.9;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.realtime-indicator:hover {
    opacity: 1;
    transform: scale(1.05);
}

.realtime-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

/* NOTIFICAÇÃO DE ATUALIZAÇÃO */
.update-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.3);
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
}

.update-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.update-notification.hide {
    transform: translateX(400px);
    opacity: 0;
}

.update-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.update-content i {
    font-size: 1.2rem;
    animation: pulse 2s infinite;
}

.update-content strong {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 1.1rem;
    margin-left: 5px;
}

/* ESTILOS PARA ANÁLISE DE PADRÕES */
.pattern-targets small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 0.85rem;
    font-style: italic;
}

.pattern-check.active .pattern-targets small {
    color: #155724;
}

/* EFEITO DE ATUALIZAÇÃO DA TIMELINE */
.timeline-updated {
    animation: timelineUpdate 2s ease-out;
    border: 2px solid #28a745 !important;
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.5) !important;
}

@keyframes timelineUpdate {
    0% {
        background-color: rgba(40, 167, 69, 0.1);
        transform: scale(1.02);
    }
    50% {
        background-color: rgba(40, 167, 69, 0.05);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* TRANSIÇÕES CLICÁVEIS */
.clickable-transition {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 8px;
    padding: 10px;
}

.clickable-transition:hover {
    background-color: #e3f2fd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 2px solid #2196f3;
}

.transition-details-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #6c757d;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Não bloquear cliques */
}

.clickable-transition:hover .transition-details-btn {
    opacity: 1;
}

/* MODAL DE DETALHES DA TRANSIÇÃO */
#transitionDetailsModal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0,0,0,0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000 !important;
}

.transition-details-modal {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    padding: 20px;
}

.transition-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.summary-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #2c3e50;
}

.occurrences-list h4 {
    margin: 20px 0 15px 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.occurrences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.occurrence-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s ease;
}

.occurrence-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.occurrence-transition {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.occurrence-number {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.occurrence-time {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
}

.occurrence-arrow {
    color: #007bff;
    font-size: 1.2rem;
}

.occurrence-date {
    text-align: center;
    font-size: 0.8rem;
    color: #868e96;
    font-style: italic;
    border-top: 1px solid #f1f3f4;
    padding-top: 8px;
}

.alert-info {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert-info i {
    color: #2196f3;
    font-size: 1.2rem;
}

.alert-info p {
    margin: 0;
    color: #1565c0;
    line-height: 1.5;
}

/* Decoded Number Display */
.decoded-number {
    margin-top: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-radius: 25px;
    display: inline-block;
    font-weight: 600;
    font-size: 0.9em;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    animation: slideInDown 0.5s ease-out;
    position: relative;
}

.decoded-number.blocked {
    background: linear-gradient(135deg, #dc3545, #c82333);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.decoded-number i {
    margin-right: 8px;
}

.counter-badge {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 3px 10px;
    margin-left: 10px;
    font-size: 0.8em;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.4);
    position: relative;
    animation: pulse 2s infinite;
}

.counter-badge:before {
    content: "Análises: ";
    font-size: 0.9em;
    opacity: 0.9;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}