/* OpenClaw Command Centre - Vibe Coded Styles */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a25;
  --bg-card: #16161f;
  --bg-hover: #1e1e2a;
  
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  
  --border-color: #2a2a3a;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
}

/* App Layout */
.app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  margin-bottom: 32px;
}

.logo-icon {
  font-size: 32px;
  animation: pulse 2s infinite;
}

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

.logo-text h1 {
  font-size: 18px;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-text span {
  font-size: 12px;
  color: var(--text-secondary);
  display: block;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-links {
  list-style: none;
}

.nav-links li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.nav-links li:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-links li.active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-md);
}

.nav-links li .icon {
  font-size: 18px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: glow 2s infinite;
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 8px var(--success); }
  50% { box-shadow: 0 0 12px var(--success); }
}

.last-update {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Main Content */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
}

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

.header h2 {
  font-size: 24px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.user-menu:hover {
  background: var(--bg-hover);
}

.user-menu span {
  font-size: 14px;
  font-weight: 500;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

/* Pages */
.page {
  display: none;
  padding: 32px;
  overflow-y: auto;
  height: calc(100vh - 80px);
}

.page.active {
  display: block;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  font-size: 36px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-sm);
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

/* Panels */
.panel {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.panel.full-width {
  grid-column: 1 / -1;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.view-all {
  font-size: 13px;
  color: var(--accent-primary);
  text-decoration: none;
  transition: var(--transition);
}

.view-all:hover {
  color: var(--accent-secondary);
}

.panel-content {
  padding: 20px 24px;
  max-height: 400px;
  overflow-y: auto;
}

/* Loading */
.loading {
  color: var(--text-muted);
  font-size: 14px;
  padding: 20px;
  text-align: center;
}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.data-table td {
  font-size: 14px;
}

.data-table tr:hover td {
  background: var(--bg-hover);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.online {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.status-badge.offline {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

/* Activity Log */
.activity-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-sm);
}

.activity-time {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 80px;
}

.activity-text {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Memory */
.memory-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.memory-item {
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.memory-item:hover {
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.memory-item h4 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.memory-item p {
  font-size: 12px;
  color: var(--text-muted);
}

.memory-viewer {
  margin-top: 24px;
}

.memory-viewer.hidden {
  display: none;
}

.memory-content {
  background: var(--bg-tertiary);
  padding: 20px;
  border-radius: var(--border-radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
  max-height: 500px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Placeholder */
.placeholder {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.placeholder p {
  font-size: 16px;
  margin-bottom: 8px;
}

.placeholder .hint {
  font-size: 13px;
  color: var(--text-muted);
}

/* Session/Job Items */
.session-item,
.job-item {
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-sm);
  margin-bottom: 12px;
  transition: var(--transition);
}

.session-item:hover,
.job-item:hover {
  background: var(--bg-hover);
}

.session-header,
.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.session-name,
.job-name {
  font-size: 14px;
  font-weight: 500;
}

.session-channel,
.job-schedule {
  font-size: 12px;
  color: var(--text-muted);
}

.session-status,
.job-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
}

.job-next {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Action Buttons */
.action-btn {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.action-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Responsive */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 80px;
    padding: 16px 8px;
  }
  
  .logo-text,
  .nav-label,
  .nav-links li span:not(.icon),
  .sidebar-footer span:not(.status-dot) {
    display: none;
  }
  
  .nav-links li {
    justify-content: center;
    padding: 12px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
