/* ============================================
   Antigravity Project Dashboard - Styles
   Premium dark mode UI with glassmorphism
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---- CSS Variables ---- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(20, 20, 35, 0.7);
  --bg-card-hover: rgba(30, 30, 50, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-hover: rgba(255, 255, 255, 0.06);
  
  --border-color: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(99, 102, 241, 0.3);
  
  --text-primary: #e8e8f0;
  --text-secondary: #8b8ba3;
  --text-muted: #5a5a72;
  
  --accent-indigo: #6366f1;
  --accent-indigo-light: #818cf8;
  --accent-violet: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  
  --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6);
  --gradient-emerald: linear-gradient(135deg, #10b981, #06b6d4);
  --gradient-amber: linear-gradient(135deg, #f59e0b, #ef4444);
  --gradient-rose: linear-gradient(135deg, #f43f5e, #ec4899);
  
  --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 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ---- Animated Background ---- */
.bg-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-pattern::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 80%, rgba(6, 182, 212, 0.04) 0%, transparent 50%);
  animation: bgShift 20s ease-in-out infinite;
}

@keyframes bgShift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(2%, -1%) rotate(1deg); }
  66% { transform: translate(-1%, 2%) rotate(-1deg); }
}

/* ---- Layout ---- */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 40px;
}

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

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

.header-logo {
  width: 48px;
  height: 48px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: white;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.header-title h1 {
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.header-title p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scan-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 6px 12px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.btn-refresh {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: inherit;
}

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

.btn-refresh svg {
  width: 16px;
  height: 16px;
}

/* ---- Summary Cards ---- */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.summary-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.summary-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
}

.summary-card.total::before { background: var(--gradient-primary); }
.summary-card.active::before { background: var(--gradient-emerald); }
.summary-card.git::before { background: linear-gradient(135deg, var(--accent-amber), var(--accent-rose)); }
.summary-card.tasks::before { background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue)); }
.summary-card.files::before { background: linear-gradient(135deg, var(--accent-violet), var(--accent-indigo)); }

.summary-card .card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 16px;
}

.summary-card.total .card-icon { background: rgba(99, 102, 241, 0.15); color: var(--accent-indigo-light); }
.summary-card.active .card-icon { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.summary-card.git .card-icon { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.summary-card.tasks .card-icon { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.summary-card.files .card-icon { background: rgba(139, 92, 246, 0.15); color: var(--accent-violet); }

.summary-card .card-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.summary-card .card-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ---- Toolbar ---- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: var(--accent-indigo);
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.1);
}

.filter-btn.active {
  background: var(--accent-indigo);
  border-color: var(--accent-indigo);
  color: white;
}

.filter-btn .count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  font-size: 0.7rem;
}

.filter-btn.active .count {
  background: rgba(255, 255, 255, 0.2);
}

.search-box {
  position: relative;
  flex-shrink: 0;
}

.search-box input {
  width: 280px;
  padding: 10px 16px 10px 40px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  transition: all var(--transition-fast);
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box input:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

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

/* ---- Project Card ---- */
.project-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
  cursor: default;
}

.project-card:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.project-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.project-card:hover::after {
  opacity: 1;
}

.project-card[data-type="salesforce"]::after { background: linear-gradient(90deg, #00a1e0, #1b96ff); }
.project-card[data-type="nodejs"]::after { background: linear-gradient(90deg, #68a063, #3c873a); }
.project-card[data-type="static-site"]::after { background: linear-gradient(90deg, #e44d26, #f16529); }
.project-card[data-type="python"]::after { background: linear-gradient(90deg, #306998, #ffd43b); }
.project-card[data-type="empty"]::after { background: linear-gradient(90deg, #555, #888); }
.project-card[data-type="unknown"]::after { background: var(--gradient-primary); }

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

.card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.project-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.project-icon.salesforce { background: rgba(0, 161, 224, 0.15); color: #1b96ff; }
.project-icon.nodejs { background: rgba(60, 135, 58, 0.15); color: #68a063; }
.project-icon.static-site { background: rgba(228, 77, 38, 0.15); color: #f16529; }
.project-icon.python { background: rgba(48, 105, 152, 0.15); color: #ffd43b; }
.project-icon.empty { background: rgba(120, 120, 140, 0.1); color: var(--text-muted); }
.project-icon.unknown { background: rgba(99, 102, 241, 0.1); color: var(--accent-indigo-light); }

.project-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-description {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.badge {
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.salesforce { background: rgba(0, 161, 224, 0.15); color: #1b96ff; }
.badge.nodejs { background: rgba(60, 135, 58, 0.15); color: #68a063; }
.badge.static-site { background: rgba(228, 77, 38, 0.15); color: #f16529; }
.badge.python { background: rgba(48, 105, 152, 0.15); color: #ffd43b; }
.badge.empty { background: rgba(120, 120, 140, 0.1); color: var(--text-muted); }
.badge.unknown { background: rgba(99, 102, 241, 0.1); color: var(--accent-indigo-light); }

/* ---- Git Section ---- */
.git-section {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.git-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.git-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

.git-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.git-status.clean .dot { background: var(--accent-emerald); box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.git-status.dirty .dot { background: var(--accent-amber); box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
.git-status.no-git .dot { background: var(--text-muted); }

.git-branch {
  font-size: 0.73rem;
  color: var(--text-muted);
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.git-commit {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.git-stats {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.git-stat {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.git-stat strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.no-git-notice {
  text-align: center;
  padding: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
}

/* ---- Task Progress ---- */
.task-section {
  margin-bottom: 16px;
}

.task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.task-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.task-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: 100px;
  background: var(--gradient-emerald);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-in-progress {
  height: 100%;
  border-radius: 100px;
  background: var(--accent-amber);
  opacity: 0.7;
  position: absolute;
  top: 0;
}

/* ---- Card Footer ---- */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.card-meta {
  display: flex;
  gap: 16px;
}

.meta-item {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.meta-item svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.card-actions {
  display: flex;
  gap: 6px;
}

.action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-indigo);
  color: var(--accent-indigo-light);
}

.action-btn svg {
  width: 14px;
  height: 14px;
}

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

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* ---- Loading Animation ---- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-card {
  animation: fadeInUp 0.5s ease forwards;
}

.project-card:nth-child(1) { animation-delay: 0.02s; }
.project-card:nth-child(2) { animation-delay: 0.04s; }
.project-card:nth-child(3) { animation-delay: 0.06s; }
.project-card:nth-child(4) { animation-delay: 0.08s; }
.project-card:nth-child(5) { animation-delay: 0.1s; }
.project-card:nth-child(6) { animation-delay: 0.12s; }
.project-card:nth-child(7) { animation-delay: 0.14s; }
.project-card:nth-child(8) { animation-delay: 0.16s; }
.project-card:nth-child(9) { animation-delay: 0.18s; }
.project-card:nth-child(10) { animation-delay: 0.2s; }
.project-card:nth-child(11) { animation-delay: 0.22s; }
.project-card:nth-child(12) { animation-delay: 0.24s; }
.project-card:nth-child(13) { animation-delay: 0.26s; }
.project-card:nth-child(14) { animation-delay: 0.28s; }
.project-card:nth-child(15) { animation-delay: 0.3s; }

/* ---- Tooltip ---- */
.tooltip {
  position: fixed;
  padding: 8px 14px;
  background: rgba(30, 30, 50, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.75rem;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transition: opacity var(--transition-fast);
  max-width: 300px;
  box-shadow: var(--shadow-md);
}

.tooltip.visible {
  opacity: 1;
}

/* ---- Responsive ---- */
@media (max-width: 1200px) {
  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .app-container {
    padding: 20px;
  }
  
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .search-box input {
    width: 100%;
  }
}

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