:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --border-color: #30363d;
  --text-primary: #c9d1d9;
  --text-secondary: #8b949e;
  --text-bright: #f0f6fc;
  
  --accent-cyan: #38bdf8;
  --accent-green: #3fb950;
  --accent-red: #f85149;
  --accent-amber: #d29922;
  --accent-purple: #a371f7;
  
  --font-mono: 'Fira Code', 'JetBrains Mono', Consolas, monospace;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Top Navigation Bar */
.top-nav {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

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

.docker-logo {
  font-size: 26px;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.4));
  animation: floatDocker 3s ease-in-out infinite;
}

@keyframes floatDocker {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-bright);
}

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

.brand-subtitle strong {
  color: var(--accent-cyan);
}

.nav-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.metric-pill {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-family: var(--font-mono);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-danger {
  background-color: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
}

.dot-success {
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.pulse-amber {
  background-color: var(--accent-amber);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(210, 153, 34, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(210, 153, 34, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(210, 153, 34, 0); }
}

.status-text.danger { color: var(--accent-red); font-weight: 600; }
.status-text.success { color: var(--accent-green); font-weight: 600; }

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 16px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #484f58;
  transition: .2s;
  border-radius: 16px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 10px; width: 10px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

input:checked + .slider { background-color: var(--accent-green); }
input:checked + .slider:before { transform: translateX(14px); }

/* Alert Banner */
.alert-banner {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.12), rgba(63, 185, 80, 0.08));
  border-bottom: 1px solid rgba(56, 189, 248, 0.3);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #a5d6ff;
  flex-shrink: 0;
}

.alert-content code {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* Workspace */
.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  overflow: hidden;
}

.panel {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  overflow: hidden;
  height: 100%;
}

.panel:last-child {
  border-right: none;
}

.panel-header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  height: 40px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.tabs {
  display: flex;
  align-items: center;
  height: 100%;
}

.tab {
  background-color: var(--bg-primary);
  border-top: 2px solid var(--accent-cyan);
  border-right: 1px solid var(--border-color);
  height: 100%;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-bright);
}

.tab-badge {
  background-color: rgba(248, 81, 73, 0.2);
  color: var(--accent-red);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  border: 1px solid rgba(248, 81, 73, 0.4);
}

.tab-badge.resolved {
  background-color: rgba(63, 185, 80, 0.2);
  color: var(--accent-green);
  border-color: rgba(63, 185, 80, 0.4);
}

/* Buttons */
.btn {
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  padding: 5px 12px;
}

.btn-primary {
  background: linear-gradient(135deg, #238636, #2ea043);
  color: #fff;
  border-color: rgba(240, 246, 252, 0.1);
  box-shadow: 0 0 12px rgba(46, 160, 67, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2ea043, #3fb950);
  box-shadow: 0 0 16px rgba(63, 185, 80, 0.6);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-ghost:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-bright);
}

.btn-icon {
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  font-size: 12px;
}

.btn-icon:hover {
  color: var(--text-bright);
  background-color: var(--bg-tertiary);
}

.btn-lg {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
}

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

.btn-secondary:hover {
  background-color: #30363d;
}

/* Editor Body */
.editor-body {
  flex: 1;
  display: flex;
  background-color: #0d1117;
  overflow: hidden;
  position: relative;
}

.editor-gutter {
  width: 44px;
  padding: 12px 6px;
  background-color: #090d13;
  border-right: 1px solid var(--border-color);
  color: #484f58;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
  user-select: none;
  overflow: hidden;
}

#codeEditor {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #79c0ff;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  padding: 12px 16px;
  resize: none;
  white-space: pre;
  tab-size: 2;
  overflow-y: auto;
}

.editor-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  height: 28px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

/* Terminal Panel */
.terminal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.t-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.t-dot.red { background-color: #f85149; }
.t-dot.yellow { background-color: #d29922; }
.t-dot.green { background-color: #3fb950; }

.terminal-name {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.terminal-body {
  flex: 1;
  background-color: #05070a;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-y: auto;
  color: #d1d5db;
}

.term-line {
  margin-bottom: 4px;
}

.term-user { color: #58a6ff; font-weight: 600; }
.term-path { color: #f0883e; }
.term-cmd { color: #7ee787; }
.info-line { color: #8b949e; }

.log-item {
  margin: 5px 0;
  padding: 5px 10px;
  border-radius: 4px;
  border-left: 3px solid transparent;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: translateX(0); }
}

.log-item.CACHED {
  background-color: rgba(56, 189, 248, 0.05);
  border-left-color: var(--accent-cyan);
  color: #79c0ff;
}

.log-item.SUCCESS {
  background-color: rgba(63, 185, 80, 0.1);
  border-left-color: var(--accent-green);
  color: #7ee787;
}

.log-item.FAILED {
  background-color: rgba(248, 81, 73, 0.1);
  border-left-color: var(--accent-red);
  color: #ffa198;
}

.terminal-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.steps-progress {
  display: flex;
  gap: 6px;
}

.step-item {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.step-item.success {
  border-color: var(--accent-green);
  background-color: rgba(63, 185, 80, 0.15);
  color: var(--accent-green);
}

.step-item.failed {
  border-color: var(--accent-red);
  background-color: rgba(248, 81, 73, 0.15);
  color: var(--accent-red);
}

.step-num {
  font-weight: 700;
}

.build-status-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(5, 7, 10, 0.88);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s ease;
  padding: 16px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: linear-gradient(180deg, #161b22 0%, #0d1117 100%);
  border: 2px solid #38bdf8;
  box-shadow: 0 0 50px rgba(56, 189, 248, 0.35), 0 20px 40px rgba(0, 0, 0, 0.9);
  border-radius: 16px;
  max-width: 620px;
  width: 100%;
  max-height: 94vh;
  overflow-y: auto;
  padding: 28px 24px;
  text-align: center;
  position: relative;
  transform: scale(0.92) translateY(15px);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(63, 185, 80, 0.15);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.modal-title {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #ffffff 0%, #79c0ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2px;
}

.modal-subtitle {
  color: var(--accent-cyan);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}

/* Cake Section with Zero Collisions */
.cake-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
  width: 100%;
}

.cake-box {
  width: 160px;
  height: 95px;
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease;
}

.cake-box:hover {
  transform: scale(1.04);
}

.cake-box:active {
  transform: scale(0.96);
}

.cake {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 70px;
}

.layer {
  position: absolute;
  width: 130px;
  height: 20px;
  border-radius: 10px;
  background: linear-gradient(90deg, #6d28d9, #8b5cf6, #a78bfa);
}

.layer-bottom { bottom: 0; }
.layer-middle { bottom: 15px; width: 115px; left: 7.5px; background: linear-gradient(90deg, #ec4899, #f472b6); }
.layer-top { bottom: 30px; width: 100px; left: 15px; background: linear-gradient(90deg, #38bdf8, #60a5fa); }

.frosting {
  position: absolute;
  bottom: 46px;
  left: 18px;
  width: 94px;
  height: 10px;
  background: #ffffff;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.4);
}

.candle {
  position: absolute;
  bottom: 52px;
  width: 7px;
  height: 24px;
  background: repeating-linear-gradient(45deg, #f59e0b, #f59e0b 3px, #ffffff 3px, #ffffff 6px);
  border-radius: 3px;
}

#candle1 { left: 35px; }
#candle2 { left: 61.5px; }
#candle3 { left: 88px; }

.flame {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 12px;
  background: radial-gradient(ellipse at bottom, #fbbf24 0%, #ef4444 80%);
  border-radius: 50% 50% 20% 20%;
  box-shadow: 0 0 8px #fbbf24, 0 0 16px #ef4444;
  animation: flicker 0.5s infinite alternate ease-in-out;
}

@keyframes flicker {
  0% { transform: translateX(-50%) scale(0.85) rotate(-2deg); opacity: 0.9; }
  100% { transform: translateX(-50%) scale(1.1) rotate(2deg); opacity: 1; }
}

.smoke {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: rgba(200, 200, 200, 0.8);
  border-radius: 50%;
  display: none;
}

.candle.blown .flame {
  display: none;
}

.candle.blown .smoke {
  display: block;
  animation: puffSmoke 0.8s ease-out forwards;
}

@keyframes puffSmoke {
  0% { opacity: 0.9; transform: translateX(-50%) translateY(0) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-25px) scale(3); }
}

.cake-hint {
  font-size: 11.5px;
  color: var(--accent-cyan);
  margin-top: 8px;
  font-weight: 500;
}

/* Special Message Box */
.special-message-box {
  background: rgba(56, 189, 248, 0.09);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  width: 100%;
  position: relative;
}

.msg-quote {
  font-size: 32px;
  color: var(--accent-cyan);
  opacity: 0.35;
  position: absolute;
  top: -2px;
  left: 12px;
  line-height: 1;
}

.msg-text {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
  margin-bottom: 4px;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.msg-author {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
  width: 100%;
}

.stat-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
}

.stat-num {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.stat-desc {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Badges */
.badges-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 20px;
  width: 100%;
}

.badge-item {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-primary);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  width: 100%;
}

@media (max-width: 900px) {
  body { overflow: auto; }
  .app-container { height: auto; }
  .workspace { grid-template-columns: 1fr; }
  .panel { height: 48vh; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
