/* GitHub-like Deployment Tracker Styles */

:root {
  --color-bg: #0d1117;
  --color-bg-secondary: #161b22;
  --color-bg-tertiary: #21262d;
  --color-border: #30363d;
  --color-text: #c9d1d9;
  --color-text-secondary: #8b949e;
  --color-text-muted: #6e7681;
  --color-accent: #58a6ff;
  --color-success: #238636;
  --color-success-light: #3fb950;
  --color-warning: #d29922;
  --color-danger: #da3633;
  --radius: 6px;
  --shadow: 0 1px 0 rgba(27, 31, 35, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.header {
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
}

.nav {
  display: flex;
  gap: 16px;
}

.nav-link {
  color: var(--color-text);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: background 0.2s;
}

.nav-link:hover {
  background: var(--color-bg-tertiary);
}

/* Main */
.main {
  padding: 32px 0;
}

/* Stats */
.stats-section {
  margin-bottom: 32px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat-card.loading {
  opacity: 0.6;
}

.stat-value {
  font-size: 32px;
  font-weight: 600;
  color: var(--color-accent);
}

.stat-label {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

/* Filters */
.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 250px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--color-text);
  font-size: 14px;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.sort-select {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--color-text);
  font-size: 14px;
  cursor: pointer;
}

/* Section Headers */
section h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

/* Projects */
.projects-section {
  margin-bottom: 40px;
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--color-bg-tertiary);
  cursor: pointer;
  transition: background 0.2s;
}

.project-header:hover {
  background: #30363d;
}

.project-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
}

.project-name:hover {
  text-decoration: underline;
}

.project-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.version-badge {
  background: var(--color-success);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 12px;
}

.deploy-count {
  background: var(--color-bg);
  padding: 2px 8px;
  border-radius: 12px;
}

.project-body {
  padding: 16px;
  border-top: 1px solid var(--color-border);
}

.project-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  font-size: 13px;
}

.info-row {
  display: flex;
  justify-content: space-between;
}

.info-label {
  color: var(--color-text-secondary);
}

.info-value {
  color: var(--color-text);
  font-family: monospace;
}

/* Backups */
.backups-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.backups-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.backup-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--color-bg);
  border-radius: var(--radius);
  font-size: 13px;
}

.backup-version {
  color: var(--color-accent);
  font-family: monospace;
}

.backup-source {
  color: var(--color-text-secondary);
  font-size: 11px;
}

.backup-date {
  color: var(--color-text-muted);
  font-size: 11px;
}

/* History */
.history-section {
  margin-bottom: 40px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 13px;
}

.history-icon {
  font-size: 16px;
}

.history-project {
  font-weight: 600;
  color: var(--color-accent);
  min-width: 120px;
}

.history-version {
  background: var(--color-bg-tertiary);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
}

.history-source {
  color: var(--color-text-secondary);
  flex: 1;
}

.history-date {
  color: var(--color-text-muted);
  font-size: 12px;
}

/* Loading */
.loading-state {
  text-align: center;
  padding: 40px;
  color: var(--color-text-secondary);
}

/* Footer */
.footer {
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  padding: 24px 0;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.footer p {
  margin: 4px 0;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-close {
  float: right;
  font-size: 24px;
  cursor: pointer;
  padding: 8px 16px;
}

.modal-close:hover {
  color: var(--color-danger);
}

#modalTitle {
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
}

#modalBody {
  padding: 16px;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 12px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .project-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}
