/* Hub Tester Styles */

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

/* Override body styles from main.css */
body.vx-hub-page {
  display: block !important;
  align-items: unset !important;
  justify-content: unset !important;
  background: #0f0f0f !important;
  background-image: none !important;
  margin: 0;
  padding: 0;
}

body.vx-hub-page::before {
  display: none !important;
}

.vx-hub-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile */
  background: #0f0f0f;
  color: #eaeaea;
  font-family: 'Courier New', monospace;
  overflow: hidden;
  z-index: 1;
  touch-action: pan-y;
}

/* Header */
.vx-hub-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
  gap: 16px;
  flex-shrink: 0;
}

.vx-hub-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: #00ff00;
}

.vx-hub-connection {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.vx-hub-connection input {
  background: #0a0a0a;
  border: 1px solid #333;
  color: #eaeaea;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'Courier New', monospace;
}

.vx-hub-connection input:focus {
  outline: none;
  border-color: #00ff00;
}

.vx-hub-status {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.vx-hub-status.connected {
  color: #00ff00;
}

.vx-hub-status.disconnected {
  color: #ff4444;
}

/* Tab Navigation */
.vx-hub-tabs {
  display: flex;
  background: #1a1a1a;
  border-bottom: 2px solid #2a2a2a;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

.vx-hub-tab {
  padding: 10px 20px;
  background: transparent;
  color: #888;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  font-family: 'Courier New', monospace;
  white-space: nowrap;
  flex-shrink: 0;
}

.vx-hub-tab:hover {
  color: #ccc;
}

.vx-hub-tab.active {
  color: #00ff00;
  border-bottom-color: #00ff00;
  background: rgba(0, 255, 0, 0.05);
}

/* Main Content Area */
.vx-hub-main {
  display: flex;
  flex: 1;
  overflow: hidden;
  width: 100%;
  min-height: 0;
}

/* Left Panel */
.vx-hub-panel {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Terminal Panel */
.vx-hub-terminal {
  width: 50%;
  min-width: 350px;
  background: #0a0a0a;
  border-left: 1px solid #2a2a2a;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.vx-hub-terminal-header {
  padding: 10px 16px;
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vx-hub-terminal-title {
  font-size: 13px;
  font-weight: 600;
  color: #00ff00;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.vx-hub-terminal-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.vx-hub-terminal-controls button {
  padding: 4px 8px;
  background: #2a2a2a;
  color: #888;
  border: 1px solid #333;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
}

.vx-hub-terminal-controls button:hover {
  background: #333;
  color: #fff;
}

.vx-hub-terminal-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  line-height: 1.4;
}

.vx-hub-log-entry {
  margin-bottom: 4px;
  display: flex;
  gap: 8px;
  word-break: break-all;
}

.vx-hub-log-timestamp {
  color: #666;
  flex-shrink: 0;
}

.vx-hub-log-prefix {
  flex-shrink: 0;
  font-weight: bold;
}

.vx-hub-log-message {
  flex: 1;
  color: #ddd;
  white-space: pre-wrap;
}

/* Section Styles */
.vx-hub-section {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  padding: 12px;
}

.vx-hub-section h3 {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: #00ff00;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Form Controls */
.vx-hub-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.vx-hub-form-group label {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.vx-hub-form-group input,
.vx-hub-form-group select,
.vx-hub-form-group textarea {
  background: #0a0a0a;
  border: 1px solid #333;
  color: #eaeaea;
  padding: 8px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'Courier New', monospace;
}

.vx-hub-form-group input:focus,
.vx-hub-form-group select:focus,
.vx-hub-form-group textarea:focus {
  outline: none;
  border-color: #00ff00;
  box-shadow: 0 0 0 1px rgba(0, 255, 0, 0.2);
}

/* Buttons */
.vx-hub-button {
  padding: 8px 16px;
  background: #2a2a2a;
  color: #eaeaea;
  border: 1px solid #333;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  transition: all 0.2s ease;
}

.vx-hub-button:hover {
  background: #333;
  border-color: #444;
}

.vx-hub-button.primary {
  background: #00aa00;
  color: #000;
  border-color: #00ff00;
}

.vx-hub-button.primary:hover {
  background: #00ff00;
}

.vx-hub-button.danger {
  background: #aa0000;
  color: #fff;
  border-color: #ff0000;
}

.vx-hub-button.danger:hover {
  background: #ff0000;
}

.vx-hub-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Info boxes */
.vx-hub-info {
  padding: 12px;
  background: rgba(0, 255, 0, 0.05);
  border: 1px solid rgba(0, 255, 0, 0.2);
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 12px;
}

.vx-hub-warning {
  padding: 12px;
  background: rgba(255, 165, 0, 0.05);
  border: 1px solid rgba(255, 165, 0, 0.2);
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 12px;
  color: #ffa500;
}

/* Queue Display */
.vx-hub-queue {
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 12px;
  margin-top: 12px;
}

.vx-hub-queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.vx-hub-queue-title {
  font-size: 12px;
  font-weight: 600;
  color: #00ff00;
}

.vx-hub-queue-content {
  font-size: 11px;
  color: #888;
  max-height: 150px;
  overflow-y: auto;
  white-space: pre;
  font-family: 'Courier New', monospace;
}

/* Control Groups */
.vx-hub-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* Channel List */
.vx-hub-channel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vx-hub-channel-item {
  padding: 8px;
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vx-hub-channel-item.joined {
  border-color: #00ff00;
  background: rgba(0, 255, 0, 0.05);
}

/* Connection List */
.vx-hub-connection-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vx-hub-connection-item {
  padding: 8px;
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.vx-hub-connection-rtc {
  color: #00ff00;
  font-weight: bold;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .vx-hub-terminal {
    width: 50%;
  }
}

@media (max-width: 900px) {
  .vx-hub-main {
    flex-direction: column;
  }

  .vx-hub-panel {
    width: 100%;
    height: 50%;
  }

  .vx-hub-terminal {
    width: 100%;
    height: 50%;
    border-left: none;
    border-top: 1px solid #2a2a2a;
  }

  /* Hide title on mobile to save space */
  .vx-hub-title {
    display: none;
  }

  /* Hide connection status text on mobile, keep only icon */
  .vx-hub-status-text {
    display: none;
  }

  /* Compact tabs on mobile */
  .vx-hub-tab {
    padding: 10px 12px;
    font-size: 12px;
  }

  /* Ensure terminal toggle is visible */
  .vx-hub-tabs {
    justify-content: flex-start;
  }

  /* Add visual indicator that tabs are scrollable */
  .vx-hub-tabs::-webkit-scrollbar {
    height: 3px;
  }

  .vx-hub-tabs::-webkit-scrollbar-track {
    background: #1a1a1a;
  }

  .vx-hub-tabs::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 2px;
  }
}
