/**
 * GitHub-style Dashboard CSS
 * Clean, minimal design inspired by GitHub's interface
 */

:root {
  --color-canvas-default: #ffffff;
  --color-canvas-subtle: #f6f8fa;
  --color-canvas-inset: #f6f8fa;
  --color-border-default: #d1d9e0;
  --color-border-muted: #d8dee4;
  --color-fg-default: #1f2328;
  --color-fg-muted: #656d76;
  --color-fg-subtle: #6e7781;
  --color-accent-fg: #0969da;
  --color-accent-emphasis: #0969da;
  --color-success-fg: #1a7f37;
  --color-attention-fg: #9a6700;
  --color-danger-fg: #d1242f;
  --color-done-fg: #8250df;
  
  --shadow-small: 0 1px 0 rgba(31, 35, 40, 0.04);
  --shadow-medium: 0 3px 6px rgba(140, 149, 159, 0.15);
  --shadow-large: 0 8px 24px rgba(140, 149, 159, 0.2);
  
  --border-radius: 6px;
  --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-stack);
  line-height: 1.5;
  color: var(--color-fg-default);
  background-color: var(--color-canvas-default);
  margin: 0;
  padding: 0;
}

/* Header */
.header {
  background-color: var(--color-canvas-default);
  border-bottom: 1px solid var(--color-border-default);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 600;
  color: var(--color-fg-default);
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--color-accent-emphasis);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--color-fg-default);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--border-radius);
  transition: background-color 0.15s ease;
}

.nav-link:hover {
  background-color: var(--color-canvas-subtle);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background-color: var(--color-canvas-subtle);
  border: 1px solid var(--color-border-default);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

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

.status-indicator[data-status="demo"] .status-dot {
  background-color: var(--color-attention-fg);
}

.status-indicator[data-status="mixed"] .status-dot {
  background-color: var(--color-done-fg);
}

/* Main Layout */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.main-content {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 1200px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    flex-direction: row;
    gap: 16px;
  }
  
  .sidebar-section {
    flex: 1;
  }
}

@media (max-width: 768px) {
  .sidebar {
    flex-direction: column;
  }
}

/* Repository Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--color-canvas-default);
  border: 1px solid var(--color-border-default);
  border-radius: var(--border-radius);
  padding: 16px;
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  border-color: var(--color-border-muted);
  box-shadow: var(--shadow-small);
}

.stat-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-fg-default);
  display: block;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--color-fg-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Projects Section */
.section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border-default);
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-fg-default);
  margin: 0;
}

.section-subtitle {
  font-size: 14px;
  color: var(--color-fg-muted);
  margin: 0;
}

/* Project Cards */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--color-canvas-default);
  border: 1px solid var(--color-border-default);
  border-radius: var(--border-radius);
  padding: 20px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  cursor: pointer;
  position: relative;
}

.project-card:hover {
  border-color: var(--color-accent-emphasis);
  box-shadow: var(--shadow-medium);
  transform: translateY(-1px);
}

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.project-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-accent-emphasis);
  margin: 0;
  text-decoration: none;
}

.project-title:hover {
  text-decoration: underline;
}

.project-stats {
  display: flex;
  gap: 12px;
  align-items: center;
}

.project-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--color-fg-muted);
}

.project-description {
  color: var(--color-fg-muted);
  font-size: 14px;
  line-height: 1.4;
  margin: 0 0 12px 0;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.project-tag {
  background: var(--color-accent-emphasis);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-fg-muted);
}

.project-updated {
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-actions {
  display: flex;
  gap: 8px;
}

.project-link {
  color: var(--color-accent-emphasis);
  text-decoration: none;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.project-link:hover {
  background-color: var(--color-canvas-subtle);
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-section {
  background: var(--color-canvas-default);
  border: 1px solid var(--color-border-default);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.sidebar-header {
  padding: 12px 16px;
  background: var(--color-canvas-subtle);
  border-bottom: 1px solid var(--color-border-default);
  font-weight: 600;
  font-size: 14px;
}

.sidebar-content {
  padding: 16px;
}

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

.activity-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-muted);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-title {
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 2px;
}

.activity-meta {
  font-size: 12px;
  color: var(--color-fg-muted);
}

/* Code Display */
.code-display {
  background: var(--color-canvas-default);
  border: 1px solid var(--color-border-default);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.code-header {
  padding: 12px 16px;
  background: var(--color-canvas-subtle);
  border-bottom: 1px solid var(--color-border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.code-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.code-lang {
  background: var(--color-accent-emphasis);
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
}

.code-actions {
  display: flex;
  gap: 8px;
}

.code-btn {
  background: var(--color-canvas-default);
  border: 1px solid var(--color-border-default);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.code-btn:hover {
  background-color: var(--color-canvas-subtle);
}

.code-content {
  padding: 16px;
  background: var(--color-canvas-inset);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}

.code-content code {
  color: var(--color-fg-default);
}

/* Syntax highlighting */
.keyword { color: #cf222e; }
.string { color: #0a3069; }
.comment { color: #6e7781; font-style: italic; }
.function { color: #8250df; }
.variable { color: #953800; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--color-border-default);
  border-radius: var(--border-radius);
  background: var(--color-canvas-default);
  color: var(--color-fg-default);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn:hover {
  background: var(--color-canvas-subtle);
  border-color: var(--color-border-muted);
}

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

.btn-primary:hover {
  background: #0860ca;
  border-color: #0860ca;
}

/* Loading States */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-overlay.hidden {
  display: none;
}

.loading-content {
  text-align: center;
}

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

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Notifications */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  pointer-events: none;
}

.notification {
  background: var(--color-canvas-default);
  border: 1px solid var(--color-border-default);
  border-radius: var(--border-radius);
  padding: 12px 16px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-large);
  font-size: 13px;
  max-width: 320px;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.notification-success {
  border-left: 4px solid var(--color-success-fg);
}

.notification-warning {
  border-left: 4px solid var(--color-attention-fg);
}

.notification-error {
  border-left: 4px solid var(--color-danger-fg);
}

.notification-info {
  border-left: 4px solid var(--color-accent-emphasis);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }
  
  .header-content {
    padding: 0 16px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .project-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .header-nav {
    display: none;
  }
}

/* Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-muted {
  color: var(--color-fg-muted);
}

.text-small {
  font-size: 12px;
}

.text-bold {
  font-weight: 600;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
