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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f5f5;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 15px rgba(16, 68, 92, 0.15);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #10445c, #0d2c3a);
  color: white;
  padding: 20px;
  text-align: center;
}

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

.datetime {
  font-size: 1.1em;
  opacity: 0.9;
  color: #e6e6e6;
}

.main-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  padding: 20px;
  background: #ffffff;
}

.left-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sorteo-section {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 15px;
  background: #f5f5f5;
  border-radius: 8px;
  border-left: 4px solid #d4af37;
}

.sorteo-section label {
  font-weight: bold;
  color: #10445c;
}

.sorteo-select {
  padding: 8px 12px;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  font-size: 14px;
  background: white;
  color: #10445c;
}

.sorteo-select:focus {
  border-color: #10445c;
  outline: none;
  box-shadow: 0 0 0 2px rgba(16, 68, 92, 0.1);
}

.cliente-section {
  padding: 20px;
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(16, 68, 92, 0.1);
}

.cliente-section h3 {
  margin-bottom: 15px;
  color: #10445c;
  border-bottom: 2px solid #d4af37;
  padding-bottom: 5px;
  font-weight: 600;
}

.cliente-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  font-size: 14px;
  color: #10445c;
}

.cliente-input:focus {
  border-color: #10445c;
  outline: none;
  box-shadow: 0 0 0 2px rgba(16, 68, 92, 0.1);
}

.game-section {
  padding: 20px;
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(16, 68, 92, 0.1);
}

.game-section h3 {
  color: #10445c;
  margin-bottom: 15px;
  border-bottom: 2px solid #d4af37;
  padding-bottom: 5px;
  font-weight: 600;
}

.modalidad-linea {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px;
  background: #f5f5f5;
  border-radius: 4px;
  border-left: 3px solid #c0a062;
}

.modalidad-linea label {
  font-weight: bold;
  color: #10445c;
  font-size: 14px;
}

.modalidad-select {
  padding: 6px 10px;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  font-size: 13px;
  background: white;
  min-width: 200px;
  color: #10445c;
}

.modalidad-select:focus {
  border-color: #10445c;
  outline: none;
  box-shadow: 0 0 0 2px rgba(16, 68, 92, 0.1);
}

.numeros-section {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
}

.numero-input {
  width: 60px;
  height: 50px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  border: 2px solid #e6e6e6;
  border-radius: 6px;
  color: #10445c;
  background: white;
}

.numero-input:focus {
  border-color: #d4af37;
  outline: none;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.monto-input {
  width: 100px;
  padding: 10px;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  text-align: center;
  font-size: 16px;
  color: #10445c;
}

.monto-input:focus {
  border-color: #10445c;
  outline: none;
  box-shadow: 0 0 0 2px rgba(16, 68, 92, 0.1);
}

.btn-agregar {
  background: linear-gradient(135deg, #d4af37, #c0a062);
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.btn-agregar:hover {
  background: linear-gradient(135deg, #c0a062, #b8944f);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(212, 175, 55, 0.3);
}

.right-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.vendidos-section {
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(16, 68, 92, 0.1);
}

.vendidos-header {
  background: linear-gradient(135deg, #10445c, #0d2c3a);
  color: white;
  padding: 15px;
  text-align: center;
  font-weight: bold;
}

.vendidos-list {
  max-height: 300px;
  overflow-y: auto;
}

.vendido-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 15px;
  border-bottom: 1px solid #e6e6e6;
  color: #10445c;
}

.vendido-item:nth-child(even) {
  background: #f5f5f5;
}

.restricciones-section {
  background: linear-gradient(135deg, #10445c, #0d2c3a);
  color: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(16, 68, 92, 0.2);
}

.restricciones-header {
  text-align: center;
  font-weight: bold;
  margin-bottom: 15px;
  font-size: 16px;
  color: #ffffff;
}

.restriccion-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  color: #e6e6e6;
}

.total-vendido {
  background: linear-gradient(135deg, #d4af37, #c0a062);
  color: white;
  padding: 15px;
  text-align: center;
  border-radius: 6px;
  margin-top: 15px;
  font-weight: bold;
}

.tickets-section {
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  margin-top: 20px;
  box-shadow: 0 1px 3px rgba(16, 68, 92, 0.1);
  margin-bottom: 50px;
}

.tickets-header {
  background: linear-gradient(135deg, #10445c, #0d2c3a);
  color: white;
  padding: 10px 15px;
  font-weight: bold;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr 100px;
  gap: 10px;
  font-size: 14px;
}

.ticket-item {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr 100px;
  gap: 10px;
  padding: 10px 15px;
  border-bottom: 1px solid #e6e6e6;
  font-size: 13px;
  color: #10445c;
}

.ticket-item:nth-child(even) {
  background: #f5f5f5;
}

.payout-info {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
  font-style: italic;
}

.btn-nueva-linea {
  background: linear-gradient(135deg, #10445c, #0d2c3a);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.btn-nueva-linea:hover {
  background: linear-gradient(135deg, #0d2c3a, #081f2a);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(16, 68, 92, 0.3);
}

.gallo-tapado {
  background: linear-gradient(135deg, #d4af37, #c0a062);
  color: #ffffff;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 10px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.gallo-tapado:hover {
  background: linear-gradient(135deg, #c0a062, #b8944f);
  transform: translateY(-1px);
}

.btn-eliminar {
  background: #dc3545;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}

.btn-eliminar:hover {
  background: #c82333;
  transform: translateY(-1px);
}

.linea-apuesta {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  background: #ffffff;
}

.linea-apuesta.active {
  border-color: #d4af37;
  background: #f9f7ed;
}

.ticket-preview {
  background: white;
  border: 2px dashed #10445c;
  padding: 20px;
  margin: 20px 0;
  font-family: "Courier New", monospace;
  font-size: 12px;
  max-width: 300px;
  color: #10445c;
}

.print-section {
  margin-top: 15px;
  padding: 15px;
  background: #f5f5f5;
  border-radius: 6px;
  display: none;
}

.print-section.show {
  display: block;
}

.btn-imprimir {
  background: linear-gradient(135deg, #10445c, #0d2c3a);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  margin-right: 10px;
  transition: all 0.3s ease;
}

.btn-imprimir:hover {
  background: linear-gradient(135deg, #0d2c3a, #081f2a);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(16, 68, 92, 0.3);
}

.alerta {
  background: linear-gradient(135deg, #d4af37, #c0a062);
  color: #ffffff;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  text-align: center;
  font-weight: bold;
}

/* Estilos para los modales de sorteos anteriores */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(16, 68, 92, 0.6);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  box-shadow: 0 8px 25px rgba(16, 68, 92, 0.3);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e6e6e6;
  background: linear-gradient(135deg, #10445c, #0d2c3a);
}

.modal-header h3 {
  margin: 0;
  color: #ffffff;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #ffffff;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.modal-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.sorteos-list {
  display: grid;
  gap: 10px;
}

.sorteo-anterior-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #ffffff;
}

.sorteo-anterior-item:hover {
  background-color: #f5f5f5;
  border-color: #d4af37;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(16, 68, 92, 0.1);
}

.sorteo-info {
  flex: 1;
}

.sorteo-nombre {
  font-weight: bold;
  color: #10445c;
  margin-bottom: 5px;
}

.sorteo-fecha {
  font-size: 12px;
  color: #666;
}

.sorteo-estado {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
}

.estado-cerrado {
  background-color: #dc3545;
  color: white;
}

.estado-terminado {
  background-color: #28a745;
  color: white;
}

.loading-message {
  text-align: center;
  padding: 40px;
  color: #10445c;
  font-style: italic;
}

.btn-sorteos-anteriores:hover {
  background: #5a6268 !important;
  transform: translateY(-1px);
}

/* Indicador de sorteo anterior */
.indicador-sorteo-anterior {
  background: linear-gradient(45deg, #10445c, #0d2c3a) !important;
  color: white !important;
  padding: 15px !important;
  margin: 15px 0 !important;
  border-radius: 8px !important;
  text-align: center !important;
  box-shadow: 0 3px 10px rgba(16, 68, 92, 0.2) !important;
  border-left: 4px solid #d4af37 !important;
}

/* Estilos adicionales para los tickets */
.ticket-main {
  border-top: 2px solid #10445c;
  font-weight: 500;
}

.ticket-line {
  background-color: #f5f5f5;
  border-left: 3px solid #10445c;
  font-size: 0.9em;
}

.ticket-total {
  background-color: #e6e6e6;
  border-bottom: 2px solid #10445c;
  font-weight: bold;
}

.ticket-separator {
  height: 1px;
  background-color: #e6e6e6;
  margin: 2px 0;
  grid-column: 1/-1;
}

.numero-detalle {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.numero {
  font-weight: bold;
  font-size: 1.1em;
  color: #10445c;
}

.modalidad {
  font-size: 0.75em;
  color: #666;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Animaciones suaves */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-overlay {
  animation: fadeIn 0.3s ease-out;
}

/* Sorteo select wrapper */
.sorteo-select-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.sorteo-select-wrapper .sorteo-select {
  flex: 1;
}

/* Action buttons */
.action-buttons {
  margin-top: 15px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Search section */
.search-section {
  margin-bottom: 15px;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 5px;
}

.search-label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #10445c;
}

.search-controls {
  display: flex;
  gap: 10px;
}

.search-input {
  flex: 1;
  padding: 8px;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  font-size: 14px;
  color: #10445c;
  min-width: 0;
}

.search-input:focus {
  border-color: #10445c;
  outline: none;
  box-shadow: 0 0 0 2px rgba(16, 68, 92, 0.1);
}

.search-btn {
  padding: 8px 15px;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-btn-primary {
  background: #10445c;
}

.search-btn-primary:hover {
  background: #0d2c3a;
}

.search-btn-secondary {
  background: #6c757d;
}

.search-btn-secondary:hover {
  background: #5a6268;
}

/* Responsive design - Tablet */
@media (max-width: 1024px) {
  .container {
    max-width: 100%;
    border-radius: 0;
  }

  .main-content {
    grid-template-columns: 1fr;
    padding: 15px;
  }

  .right-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }
}

/* Responsive design - Mobile */
@media (max-width: 768px) {
  .container {
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
  }

  .header h1 {
    font-size: 1.6em;
  }

  .header {
    padding: 12px;
  }

  .main-content {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 12px;
  }

  .right-panel {
    grid-template-columns: 1fr;
  }

  /* Sorteo section - stack vertically */
  .sorteo-section {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }

  .sorteo-select {
    width: 100%;
    min-width: unset;
  }

  /* Cliente section */
  .cliente-section {
    padding: 12px;
  }

  /* Game section */
  .game-section {
    padding: 12px;
  }

  /* Numeros section - wrap for mobile */
  .numeros-section {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
  }

  .numero-input {
    width: 50px;
    height: 45px;
    font-size: 16px;
  }

  .monto-input {
    width: 90px;
    padding: 8px;
    font-size: 16px;
  }

  .modalidad-select {
    min-width: unset;
    width: 100%;
  }

  .modalidad-linea {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  /* Buttons */
  .btn-agregar,
  .btn-nueva-linea,
  .btn-imprimir {
    padding: 10px 14px;
    font-size: 13px;
    width: 100%;
    text-align: center;
  }

  .gallo-tapado {
    padding: 8px 10px;
    font-size: 12px;
  }

  /* Tickets table - reduce columns */
  .tickets-header,
  .ticket-item {
    grid-template-columns: 1fr 1fr 1fr auto !important;
    font-size: 12px;
    padding: 8px 6px;
    gap: 4px;
  }

  /* Hide fecha and cliente columns on mobile */
  .tickets-header > div:nth-child(2),
  .ticket-item > div:nth-child(2),
  .tickets-header > div:nth-child(5),
  .ticket-item > div:nth-child(5) {
    display: none;
  }

  .tickets-section {
    margin-bottom: 30px;
  }

  /* Ticket preview */
  .ticket-preview {
    max-width: 100%;
    padding: 12px;
    font-size: 11px;
  }

  /* Vendidos section */
  .vendidos-section {
    border-radius: 6px;
  }

  .vendidos-list {
    max-height: 200px;
  }

  /* Restricciones */
  .restricciones-section {
    padding: 10px;
    border-radius: 6px;
  }

  /* Modal */
  .modal-content {
    width: 95%;
    max-height: 90vh;
    border-radius: 8px;
  }

  .modal-header {
    padding: 12px 15px;
  }

  .modal-body {
    padding: 12px;
    max-height: 70vh;
  }

  .sorteo-anterior-item {
    padding: 10px;
  }

  /* Sorteo select wrapper */
  .sorteo-select-wrapper {
    flex-wrap: wrap;
  }

  /* Action buttons - stack vertically */
  .action-buttons {
    flex-direction: column;
    gap: 8px;
  }

  /* Search section */
  .search-controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  .search-input {
    width: 100%;
    flex: unset;
  }

  .search-btn {
    flex: 1;
    min-width: 0;
    text-align: center;
  }
}

/* Responsive design - Small mobile */
@media (max-width: 480px) {
  .header h1 {
    font-size: 1.3em;
  }

  .datetime {
    font-size: 0.85em;
  }

  .main-content {
    padding: 6px;
    gap: 10px;
  }

  .numeros-section {
    gap: 6px;
  }

  .numero-input {
    width: 45px;
    height: 40px;
    font-size: 16px;
  }

  .monto-input {
    width: 80px;
    font-size: 16px;
  }

  /* Tickets table - even simpler on very small screens */
  .tickets-header,
  .ticket-item {
    grid-template-columns: 1fr 1fr auto !important;
    font-size: 11px;
    padding: 6px 4px;
    gap: 3px;
  }

  /* Also hide Numero column on very small screens */
  .tickets-header > div:nth-child(3),
  .ticket-item > div:nth-child(3) {
    display: none;
  }

  .game-section h3,
  .cliente-section h3 {
    font-size: 1em;
  }

  .btn-agregar,
  .btn-nueva-linea,
  .btn-imprimir {
    font-size: 12px;
    padding: 8px 10px;
  }

  .gallo-tapado {
    padding: 6px 8px;
    font-size: 11px;
  }

  .btn-eliminar {
    padding: 6px 8px;
    font-size: 11px;
  }
}

