/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background-color: #ffffff;
  color: #000000;
  line-height: 1.6;
}

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

/* Header */
.header {
  text-align: center;
  margin-bottom: 40px;
  padding: 30px 0;
  border-bottom: 3px solid #000000;
}

.header h1 {
  font-size: 2.8rem;
  font-weight: 700;
  color: #000000;
  margin-bottom: 15px;
  letter-spacing: -1px;
  text-transform: uppercase;
}

.header p {
  font-size: 1.1rem;
  color: #333333;
  margin-bottom: 20px;
  font-weight: 500;
}

.timestamp {
  font-size: 0.9rem;
  color: #666666;
  font-weight: 400;
  font-family: "Courier New", monospace;
}

/* Botones de acción */
.actions {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.refresh-btn,
.action-btn {
  padding: 15px 30px;
  border: 2px solid #000000;
  background-color: #ffffff;
  color: #000000;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.15s ease;
  min-width: 160px;
  border-radius: 0;
  margin: 0;
}

.refresh-btn:hover,
.action-btn:hover {
  background-color: #000000;
  color: #ffffff;
}

.action-btn.danger {
  border-color: #000000;
  color: #000000;
}

.action-btn.danger:hover {
  background-color: #000000;
  color: #ffffff;
}

.action-btn.warning {
  border-color: #333333;
  color: #333333;
}

.action-btn.warning:hover {
  background-color: #333333;
  color: #ffffff;
}

/* Grid de estado */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0;
  margin-bottom: 40px;
  border: 2px solid #000000;
}

/* Cards */
.card {
  background-color: #ffffff;
  border: none;
  border-right: 1px solid #000000;
  border-bottom: 1px solid #000000;
  padding: 25px;
  transition: all 0.2s ease;
}

.card:hover {
  background-color: #f8f8f8;
}

.card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #000000;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #000000;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Elementos de estadísticas */
.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e0e0e0;
}

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

.stat-item span:first-child {
  font-weight: 600;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9rem;
}

.stat-value {
  font-weight: 700;
  color: #000000;
  text-align: right;
  font-family: "Courier New", monospace;
  font-size: 1rem;
}

/* Estados de los valores */
.stat-value.status-ok {
  color: #000000;
}

.stat-value.status-error {
  color: #ffffff;
  background-color: #000000;
  padding: 4px 8px;
  font-weight: 700;
}

.stat-value.status-processing {
  color: #000000;
  font-style: normal;
  font-weight: 700;
}

/* Efectos de actualización */
.stat-value.updating {
  animation: pulse 0.6s ease-in-out;
  background-color: #f0f0f0;
  padding: 4px 8px;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    background-color: transparent;
  }
  50% {
    transform: scale(1.05);
    background-color: #f0f0f0;
  }
  100% {
    transform: scale(1);
    background-color: transparent;
  }
}

/* Indicador de tiempo real */
.live-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  background-color: #000000;
  margin-right: 8px;
  animation: blink 2s infinite;
}

.live-indicator.updating {
  background-color: #666666;
  animation: pulse-fast 0.5s infinite;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0.3;
  }
}

@keyframes pulse-fast {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.2);
  }
}

/* Mensajes de estado */
.success-message,
.error-message {
  padding: 15px 25px;
  margin-bottom: 25px;
  border: 2px solid #000000;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.success-message {
  background-color: #ffffff;
  color: #000000;
}

.error-message {
  background-color: #000000;
  color: #ffffff;
}

/* Indicador de carga */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 3px solid #e0e0e0;
  border-top: 3px solid #000000;
  animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .header h1 {
    font-size: 2.2rem;
  }

  .status-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .card {
    border-right: none;
  }

  .actions {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  .refresh-btn,
  .action-btn {
    width: 100%;
    max-width: 400px;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.8rem;
  }

  .card {
    padding: 20px;
  }
}

/* Sección de Logs */
.logs-section {
  margin-top: 40px;
}

.logs-card {
  max-width: 100%;
  border: 2px solid #000000;
}

.logs-controls {
  display: flex;
  gap: 0;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.logs-btn {
  background: #000000;
  color: #ffffff;
  border: 2px solid #000000;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-right: 2px;
}

.logs-btn:hover {
  background: #ffffff;
  color: #000000;
}

.logs-controls label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: #000000;
  cursor: pointer;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 20px;
}

/* Checkbox personalizado */
.logs-controls input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #000000;
  background: #ffffff;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.logs-controls input[type="checkbox"]:hover {
  background: #f0f0f0;
}

.logs-controls input[type="checkbox"]:checked {
  background: #000000;
  border-color: #000000;
}

.logs-controls input[type="checkbox"]:checked::before {
  content: "■";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff;
  font-size: 12px;
  font-weight: bold;
  line-height: 1;
}

.logs-container {
  background: #000000;
  border: 2px solid #000000;
  padding: 20px;
  max-height: 600px;
  overflow-y: auto;
}

.logs-container::-webkit-scrollbar {
  width: 12px;
}

.logs-container::-webkit-scrollbar-track {
  background: #000000;
}

.logs-container::-webkit-scrollbar-thumb {
  background: #666666;
}

.logs-container::-webkit-scrollbar-thumb:hover {
  background: #888888;
}

#logsContent {
  color: #ffffff;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: #ffffff;
  border: 3px solid #000000;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #000000;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal-content p {
  color: #333333;
  margin-bottom: 25px;
  line-height: 1.6;
  font-weight: 500;
}

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

.form-group label {
  display: block;
  font-weight: 700;
  color: #000000;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 15px;
  border: 2px solid #000000;
  font-size: 1rem;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
  font-family: "Courier New", monospace;
}

.form-group input:focus {
  outline: none;
  background-color: #f8f8f8;
}

.modal-actions {
  display: flex;
  gap: 0;
  justify-content: flex-end;
  margin-top: 30px;
}

.modal-actions .action-btn {
  min-width: 140px;
}

/* Panel administrativo */
.hidden {
  display: none !important;
}

.admin-panel {
  margin-top: 30px;
}

.admin-card {
  border: 3px solid #000000;
  background: #ffffff;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
  margin-top: 20px;
  border: 2px solid #000000;
}

.admin-btn {
  padding: 15px 20px;
  border: none;
  border-right: 1px solid #000000;
  border-bottom: 1px solid #000000;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  color: #000000;
  background: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-btn:hover {
  background: #000000;
  color: #ffffff;
}

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

.admin-btn:disabled:hover {
  background: #ffffff;
  color: #000000;
}

.admin-btn.success {
  background: #28a745;
  color: #ffffff;
}

.admin-btn.success:hover {
  background: #218838;
  color: #ffffff;
}

/* Formularios */
.form-actions {
  display: flex;
  gap: 0;
  margin-top: 30px;
}

.btn {
  flex: 1;
  padding: 15px 25px;
  border: 2px solid #000000;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn.primary {
  background: #000000;
  color: #ffffff;
}

.btn.primary:hover {
  background: #ffffff;
  color: #000000;
}

.btn.secondary {
  background: #ffffff;
  color: #000000;
}

.btn.secondary:hover {
  background: #000000;
  color: #ffffff;
}

/* Responsive adicional */
@media (max-width: 768px) {
  .admin-actions {
    grid-template-columns: 1fr;
  }

  .admin-btn {
    border-right: none;
  }

  .modal-content {
    width: 95%;
    padding: 25px;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .action-btn {
    width: 100%;
  }

  .logs-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .logs-controls label {
    margin-left: 0;
  }
}
