:root {
  --bg1: #000000;
  --bg2: #0a0e14;
  --card: rgba(255, 255, 255, 0.03);
  --muted: #8aa0aa;
  --accent: #3ee8c8;
  --accent-2: #60a5fa;
  --glass: rgba(255, 255, 255, 0.02);
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
}

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

html,
body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial;
  background: linear-gradient(135deg, #0a0e14 0%, #000000 100%);
  color: #e6eef6;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.55;
  padding: 20px;
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
}

/* Header */
.header {
  margin-bottom: 32px;
  text-align: center;
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #3ee8c8, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 1.1rem;
  color: #8aa0aa;
}

/* Settings Section */
.settings-section {
  margin-bottom: 24px;
}

/* Card */
.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Form */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #e6eef6;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.form-input:read-only {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-help {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 6px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.btn-primary {
  background: var(--accent);
  color: #000000;
}

.btn-primary:hover:not(:disabled) {
  background: #2dd4bf;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #e6eef6;
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}

.btn-accent {
  background: var(--accent-2);
  color: #ffffff;
}

.btn-accent:hover:not(:disabled) {
  background: #4f9ff8;
  transform: translateY(-1px);
}

.btn-icon-small {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-icon-small:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Status Indicator */
.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 8px;
}

.status-indicator.connected {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.status-indicator.connecting {
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
}

.status-indicator.disconnected {
  background: var(--error);
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

/* Info Section */
.info-section {
  margin-bottom: 16px;
}

.info-row {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  align-items: flex-start;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 600;
  color: var(--muted);
  min-width: 180px;
  flex-shrink: 0;
}

.info-value {
  color: #e6eef6;
  flex: 1;
  word-break: break-word;
}

.text-error {
  color: var(--error);
}

/* Info Details */
.info-details {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.info-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
  user-select: none;
}

.info-details summary:hover {
  color: var(--accent-2);
}

.code-block {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #e6eef6;
  margin-top: 12px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.empty-state-text {
  font-size: 1rem;
}

/* Loading State */
.loading-state {
  text-align: center;
  padding: 40px 20px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Card Actions */
.card-actions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Log Container */
.log-container {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

.log-empty {
  text-align: center;
  color: var(--muted);
  padding: 20px;
}

.log-entry {
  padding: 8px 12px;
  margin-bottom: 4px;
  border-radius: 4px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.log-entry.log-success {
  background: rgba(16, 185, 129, 0.1);
  border-left: 3px solid var(--success);
}

.log-entry.log-error {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--error);
}

.log-entry.log-warning {
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid var(--warning);
}

.log-entry.log-info {
  background: rgba(96, 165, 250, 0.1);
  border-left: 3px solid var(--accent-2);
}

.log-time {
  color: var(--muted);
  flex-shrink: 0;
  min-width: 80px;
}

.log-message {
  color: #e6eef6;
  flex: 1;
  word-break: break-word;
}

/* Scrollbar */
.log-container::-webkit-scrollbar,
.code-block::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.log-container::-webkit-scrollbar-track,
.code-block::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb,
.code-block::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb:hover,
.code-block::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
