/* conferidor.css - VERSÃO COMPLETA E CORRIGIDA */

/* ====== CONTROLE DE VISIBILIDADE DOS MODOS ====== */
/* Esconder seções conforme o modo */
body:not(.mode-conferidor) .conferidor-section {
  display: none !important;
}

.mode-conferidor .number-grid-section,
.mode-conferidor .config-panel {
  display: none !important;
}

/* ====== BETSLIP (VOLANTE VIRTUAL) - RESPONSIVO ====== */
.betslip-container {
    background: #fff;
    border-radius: 10px;
    padding: 0px;
    max-width: 300px;
    margin: 0 auto;
}

.betslip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f0f0f0;
  flex-wrap: wrap;
  gap: 12px;
}

.betslip-info h3 {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0 0 4px 0;
}

.selected-count {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
  display: inline-block;
}

.betslip-quick-actions {
  display: flex;
  gap: 8px;
}

.betslip-quick-actions .btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.betslip-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    max-width: 300px;
    border: 1px solid #00000042;
    padding: 10px;
    border-radius: 10px;
    box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
}

.betslip-number {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  font-size: 16px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 50px;
  box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;
}

.betslip-number:hover {
  border-color: #667eea;
  background: #f8f9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

.betslip-number.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.betslip-actions {
  margin-bottom: 16px;
}

.betslip-actions .btn {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
}

.betslip-info-text {
  text-align: center;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 14px;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.betslip-info-text i {
  font-size: 16px;
}

/* ====== CABEÇALHO DO CONFERIDOR ====== */
.conferidor-section .card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.conferidor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f0f0f0;
  flex-wrap: wrap;
  gap: 12px;
}

.conferidor-header h2 {
  font-size: 22px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.conferidor-actions {
  display: flex;
  gap: 12px;
}

/* ====== BARRA DE FERRAMENTAS DO CONFERIDOR ====== */
.conferidor-toolbar {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.conferidor-toolbar .btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.btn-delete-selected {
  background: #dc3545;
  color: white;
  border: none;
  transition: all 0.2s;
}

.btn-delete-selected:hover:not(:disabled) {
  background: #c82333;
}

.btn-delete-selected:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.selection-count {
  font-weight: 700;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
}

.btn-select-all,
.btn-clear-all-conferidor {
  margin-left: auto;
}

/* ====== AÇÕES DO CONFERIDOR NOS CARDS ====== */
.conferidor-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #667eea;
}

.checkbox-label {
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

.btn-edit-conferidor {
  background: #667eea !important;
  color: white !important;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.btn-edit-conferidor:hover {
  background: #5568d3 !important;
  transform: translateY(-1px);
}

.result-card.conferidor-mode {
  border: 2px solid #e3e8ff;
}

.result-card.conferidor-mode:hover {
  border-color: #667eea;
}

/* Esconder botão favoritar no modo conferidor */
.mode-conferidor .btn-favorite {
  display: none !important;
}

/* ====== CHECKBOX NA TABELA ====== */
.cell-checkbox {
  text-align: center;
  width: 50px;
  padding: 8px;
}

.cell-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #667eea;
}

.th-checkbox {
  width: 50px;
  text-align: center;
}

/* ====== MODAL DE IMPORTAÇÃO ====== */
.import-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.import-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.import-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-top: 5px;
}

.import-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 2px solid #f0f0f0;
}

.import-modal-header h3 {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.import-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.import-modal-close:hover {
  background: #f0f0f0;
  color: #333;
}

.import-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.import-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid #f0f0f0;
}

.import-tab {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: #666;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.import-tab:hover {
  color: #667eea;
  background: #f8f9ff;
}

.import-tab.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

.import-panel {
  display: none;
}

.import-panel.active {
  display: block;
}

.import-help {
  color: #666;
  margin-bottom: 12px;
  font-size: 14px;
}

.import-formats {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  list-style: none;
}

.import-formats li {
  padding: 8px 0;
  color: #555;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.import-formats li:before {
  content: "✓";
  color: #667eea;
  font-weight: bold;
}

.import-formats code {
  background: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  color: #667eea;
  border: 1px solid #e0e0e0;
}

.import-textarea {
  width: 100%;
  min-height: 200px;
  padding: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-family: monospace;
  font-size: 13px;
  resize: vertical;
  transition: all 0.2s ease;
}

.import-textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.import-file-upload {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #f8f9fa;
    border: 2px dashed #d0d0d0;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-direction: row;
    flex-wrap: wrap;
}

.import-file-name {
  color: #666;
  font-size: 14px;
  flex: 1;
}

.import-preview {
  margin-top: 20px;
  padding: 16px;
  background: #f8f9ff;
  border: 2px solid #e3e8ff;
  border-radius: 8px;
}

.import-preview h4 {
  margin: 0 0 16px 0;
  color: #667eea;
  font-size: 16px;
}

.import-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.import-preview-item {
  background: #fff;
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  font-family: monospace;
  border: 1px solid #e0e0e0;
}

.preview-badge {
  background: #667eea;
  color: #fff;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 8px;
}

.import-preview-more {
  text-align: center;
  color: #666;
  font-size: 13px;
  margin: 12px 0;
}

.import-preview-summary {
  text-align: center;
  font-weight: 600;
  color: #667eea;
  font-size: 14px;
  margin: 12px 0 0 0;
}

.import-modal-footer {
  padding: 20px 24px;
  border-top: 2px solid #f0f0f0;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ====== RESPONSIVO ====== */
@media (max-width: 768px) {
  .betslip-container {
    padding: 16px;
  }

  .betslip-grid {
    gap: 6px;
  }

  .betslip-number {
    font-size: 14px;
    min-height: 45px;
  }

  .conferidor-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .conferidor-toolbar .btn {
    width: 100%;
    justify-content: center;
  }

  .btn-select-all,
  .btn-clear-all-conferidor {
    margin-left: 0;
  }

  .conferidor-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .conferidor-actions {
    width: 100%;
  }

  .conferidor-actions .btn {
    flex: 1;
  }

  .import-modal-content {
    width: 95%;
    max-height: 85vh;
  }

  .import-tabs {
    flex-direction: column;
  }

  .import-tab {
    text-align: left;
  }

  .betslip-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .betslip-quick-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .betslip-grid {
    gap: 4px;
  }

  .betslip-number {
    font-size: 13px;
    min-height: 40px;
  }

  .conferidor-card-actions {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .checkbox-wrapper {
    width: 100%;
  }

  .btn-edit-conferidor {
    width: 100%;
    justify-content: center;
  }
  
  .import-modal-content {
      max-height: 80vh;
      margin-top: 0px;
  }
  
  .import-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 2px solid #f0f0f0;
  }
}

/* ====== AJUSTES GERAIS ====== */
.btn-sm {
  padding: 6px 12px;
  font-size: 14px;
}

.btn i {
  margin-right: 4px;
}

/* Garantir que cards não tenham checkbox no modo gerador */
body:not(.mode-conferidor) .conferidor-card-actions {
  display: none !important;
}

body:not(.mode-conferidor) .conferidor-toolbar {
  display: none !important;
}