@import '/StationeersServerUI/static/css/variables.css';

#controls {
  display: grid;
  gap: 15px;
  margin-bottom: 30px;
  justify-content: center;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

#status {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.2rem;
  margin-bottom: 20px;
  text-align: center;
  line-height: 2;
  padding: 10px;
  background-color: rgba(0, 255, 171, 0.05);
  border-radius: 5px;
  border-left: 3px solid var(--primary);
  transition: opacity var(--transition-fast);
}
.status-indicator {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
  position: absolute;
  right: 25px;
  top: 25px;
  transition: all 0.3s ease;
}

.status-indicator.online {
  background-color: #4CAF50;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.7);
}

.status-indicator.offline {
  background-color: #F44336;
  box-shadow: 0 0 10px rgba(244, 67, 54, 0.7);
}

.status-indicator.offline::before,
.status-indicator.offline::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 2px;
  background-color: #FFFFFF;
}
.status-indicator.offline::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
.status-indicator.offline::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.status-indicator.error {
  background-color: #FFC107;
  box-shadow: 0 0 10px rgba(255, 193, 7, 0.7);
  animation: shake 0.5s ease-in-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.7);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 14px rgba(76, 175, 80, 0.9);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.7);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-2px);
  }
  75% {
    transform: translateX(2px);
  }
}

/* Console styling with custom scrollbar */
#console,
#detection-console {
  border: 2px solid var(--primary);
  padding: 20px;
  height: 400px;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.85);
  color: var(--primary);
  margin-bottom: 30px;
  border-radius: 8px;
  box-shadow: inset 0 0 10px rgba(0, 255, 171, 0.5);
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) #000;
  display: flex;
  flex-direction: column;
}

#console::-webkit-scrollbar,
#detection-console::-webkit-scrollbar {
  width: 8px;
}

#console::-webkit-scrollbar-track,
#detection-console::-webkit-scrollbar-track {
  background: #000;
  border-radius: 4px;
}

#console::-webkit-scrollbar-thumb,
#detection-console::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
  transition: background var(--transition-fast);
}

#console::-webkit-scrollbar-thumb:hover,
#detection-console::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dim);
}

/* Console scanline effect */
#console::before,
#detection-console::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 50%, rgba(0, 255, 171, 0.03) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  opacity: 0.3;
}

.detection-event {
  padding: 10px;
  margin: 10px 0;
  border-radius: 4px;
  border-left: 3px solid var(--primary);
  background-color: rgba(0, 255, 171, 0.05);
  transition: all var(--transition-normal);
  word-wrap: break-word;
}

.detection-event:hover {
  background-color: rgba(0, 255, 171, 0.1);
  transform: translateX(3px);
}

.event-timestamp {
  color: #888;
  font-size: 0.9em;
  margin-right: 5px;
}

/* Event-specific styles */
.event-server-ready {
  border-left-color: var(--success);
}

.event-server-starting {
  border-left-color: var(--warning);
}

.event-server-error {
  border-left-color: var(--danger);
}

.event-player-connecting {
  border-left-color: var(--accent);
}

.event-player-ready {
  border-left-color: var(--success);
}

.event-player-disconnect {
  border-left-color: #FF7700;
}

.event-world-saved {
  border-left-color: #00FFFF;
}

.event-exception {
  border-left-color: var(--danger);
  background-color: rgba(255, 0, 0, 0.1);
}

/* Backups */
#backups {
  margin-top: 40px;
  background-color: rgba(0, 255, 171, 0.05);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 171, 0.3);
  transition: transform var(--transition-normal);
}

#backups:hover {
  transform: translateY(-2px);
}

.backup-item {
  background-color: rgba(0, 0, 0, 0.4);
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid rgba(0, 255, 171, 0.5);
  transition: all var(--transition-normal);
  line-height: 1.6;
}

.backup-item:hover {
  background-color: rgba(0, 0, 0, 0.6);
  border-color: var(--primary);
  transform: translateX(5px);
}

.backup-item button {
  padding: 8px 16px;
  background-color: rgba(0, 255, 171, 0.2);
  color: var(--text-bright);
  border: 1px solid var(--primary);
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.8rem;
  transition: all var(--transition-normal);
}

.backup-item button:hover {
  background-color: var(--primary);
  color: #000;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}