:root {
  --primary: #EC4899;
  --secondary: #F472B6;
  --accent: #06B6D4;
  --bg: #140A0F;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.1);
  --text: #F3F4F6;
  --text-muted: #9CA3AF;
  --radius: 12px;
  --transition: 250ms ease;
  
  /* State Colors */
  --working-dir: #FCD34D;
  --staging: #34D399;
  --local-repo: #60A5FA;
  --remote-repo: #A78BFA;
}

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

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

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
}

header {
  padding: 1rem 2rem;
  background: rgba(20, 10, 15, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--primary);
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.search-bar {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.2);
}

.search-bar input {
  background: transparent;
  border: none;
  color: var(--text);
  outline: none;
  font-family: inherit;
  padding-left: 0.5rem;
  width: 250px;
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-outline:hover {
  background: rgba(6, 182, 212, 0.1);
}

main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 240px;
  padding: 2rem 1.5rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow-y: auto;
}

.sidebar ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar li {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  font-weight: 500;
}

.sidebar li:hover {
  background: var(--surface);
  color: var(--text);
}

.sidebar li.active {
  background: rgba(236, 72, 153, 0.1);
  color: var(--primary);
  border-left: 3px solid var(--primary);
}

.bookmarked-section h3 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.visualizer-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
}

.visualizer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.visualizer-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.badge {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-family: monospace;
}

.visualizer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  min-height: 200px;
  position: relative;
}

.viz-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  flex: 1;
  position: relative;
  z-index: 2;
}

.viz-icon {
  width: 64px;
  height: 64px;
  background: var(--bg);
  border: 2px dashed var(--text-muted);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.viz-label {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.viz-area {
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--border);
  z-index: 1;
}

.viz-flow {
  position: absolute;
  top: 50%;
  height: 4px;
  background: var(--primary);
  transform: translateY(-50%);
  width: 0;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), left 0.5s;
  box-shadow: 0 0 10px var(--primary);
  border-radius: 2px;
}

.viz-flow.arrow::after {
  content: '';
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px 0 6px 6px;
  border-style: solid;
  border-color: transparent transparent transparent var(--primary);
}

.zone-working .viz-icon { border-color: var(--working-dir); color: var(--working-dir); border-style: solid; }
.zone-staging .viz-icon { border-color: var(--staging); color: var(--staging); border-style: solid; }
.zone-local .viz-icon { border-color: var(--local-repo); color: var(--local-repo); border-style: solid; }
.zone-remote .viz-icon { border-color: var(--remote-repo); color: var(--remote-repo); border-style: solid; }

.zone-working .viz-label { color: var(--working-dir); }
.zone-staging .viz-label { color: var(--staging); }
.zone-local .viz-label { color: var(--local-repo); }
.zone-remote .viz-label { color: var(--remote-repo); }

.commands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.command-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.command-card:hover {
  transform: translateY(-2px);
  border-color: rgba(236, 72, 153, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

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

.card-title h3 {
  font-family: monospace;
  font-size: 1.125rem;
  color: var(--secondary);
  margin-bottom: 0.25rem;
}

.card-title p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.card-actions {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: var(--transition);
}

.icon-btn:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.1);
}

.icon-btn.active {
  color: var(--primary);
}

.code-block {
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.875rem;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-block code {
  color: #E2E8F0;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: var(--transition);
}

.copy-btn:hover {
  background: var(--primary);
}

.card-footer {
  margin-top: auto;
}

.simulate-btn {
  width: 100%;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.simulate-btn:hover {
  background: rgba(236, 72, 153, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}

.advanced-only {
  display: none;
}

.advanced-mode .advanced-only {
  display: flex;
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 768px) {
  .app-container {
    height: auto;
  }
  main {
    flex-direction: column;
    overflow: visible;
  }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .visualizer {
    overflow-x: auto;
    justify-content: flex-start;
    gap: 3rem;
  }
}
