/* OpenClaw Config Manager - Aviation Precision Dark Theme */

:root {
  --bg-primary: #0a0e14;
  --bg-secondary: #12171f;
  --bg-tertiary: #1a212d;
  --bg-elevated: #232b38;
  --border-color: #2a3441;
  --border-active: #3d4a5c;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent-blue: #58a6ff;
  --accent-green: #3fb950;
  --accent-orange: #d29922;
  --accent-red: #f85149;
  --accent-purple: #a371f7;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

/* Login Screen */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
}

.logo {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.logo p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.login-form {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.btn-primary {
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-blue) 0%, #4090e0 100%);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--border-active);
}

.btn-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.error-message {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid var(--accent-red);
  border-radius: var(--radius-md);
  color: var(--accent-red);
  font-size: 0.9rem;
  text-align: center;
}

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Dashboard */
#dashboard-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon-sm {
  font-size: 1.5rem;
}

.header h1 {
  font-size: 1.1rem;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#current-user {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.tab {
  padding: 0.6rem 1.2rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tab:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.tab.active {
  color: var(--accent-blue);
  background: rgba(88, 166, 255, 0.1);
}

.tab-content {
  display: none;
  flex: 1;
  padding: 1.5rem;
  overflow: auto;
}

.tab-content.active {
  display: block;
}

/* Config Editor */
.toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.config-select {
  flex: 1;
  max-width: 400px;
  padding: 0.6rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
}

.config-select:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.editor-container {
  height: calc(100vh - 280px);
  min-height: 400px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-secondary);
}

.editor-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.status-bar {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Credentials Tab */
.credentials-info {
  background: var(--bg-secondary);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.credentials-info h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--accent-orange);
}

.credentials-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.credentials-info code {
  background: var(--bg-tertiary);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent-purple);
}

.vault-status {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.vault-badge {
  background: rgba(63, 185, 80, 0.15);
  color: var(--accent-green);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.encrypt-section,
.decrypt-section {
  background: var(--bg-secondary);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.encrypt-section h4,
.decrypt-section h4 {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.encrypt-form,
.decrypt-form {
  display: flex;
  gap: 0.75rem;
}

.encrypt-form input,
.decrypt-form input {
  flex: 1;
}

.result-box {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.result-box label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-box textarea,
.result-box input {
  width: 100%;
  padding: 0.6rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.result-box textarea {
  min-height: 60px;
  resize: vertical;
}

/* Security Tab */
.security-section {
  background: var(--bg-secondary);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.security-section h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--accent-purple);
}

.password-form {
  max-width: 400px;
}

.security-list,
.info-list {
  list-style: none;
}

.security-list li,
.info-list li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.security-list .check {
  color: var(--accent-green);
  margin-right: 0.5rem;
}

.info-list strong {
  color: var(--text-primary);
  margin-right: 0.5rem;
}

#password-message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  display: none;
}

#password-message.success {
  display: block;
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
}

#password-message.error {
  display: block;
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 0.85rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 1000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: var(--accent-green);
}

.toast.error {
  border-color: var(--accent-red);
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .toolbar {
    flex-wrap: wrap;
  }
  
  .config-select {
    max-width: none;
    width: 100%;
  }
  
  .editor-container {
    height: calc(100vh - 320px);
  }
  
  .encrypt-form,
  .decrypt-form {
    flex-direction: column;
  }
}
