/* ===== astra-deployer UI System ===== */

/* Base */
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: 'Inter', sans-serif;
  background: #05071a;
  color: #FFFFFF;
  line-height: 1.6;
  min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201,168,76,0.4); }

/* ===== Log Colors ===== */
.log-viewer { font-family: 'Geist Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace !important; }
.log-viewer .log-err { color: #ef4444; }
.log-viewer .log-warn { color: #f59e0b; }
.log-viewer .log-ok { color: #4ade80; }
.log-viewer .log-fail { color: #ef4444; font-weight: 700; background: rgba(239,68,68,0.08); border-radius: 3px; padding: 0 2px; }
.log-viewer .log-step { color: #c5cad8; }
.log-viewer .log-info { color: #C9A84C; }
.log-viewer .log-dim { color: #5a6278; }

/* ANSI colors */
.log-viewer .ansi-bold { font-weight: 700; }
.log-viewer .ansi-dim { opacity: 0.7; }
.log-viewer .ansi-italic { font-style: italic; }
.log-viewer .ansi-underline { text-decoration: underline; }
.log-viewer .ansi-reverse { filter: invert(1); }
.log-viewer .ansi-black { color: #575757; }
.log-viewer .ansi-red { color: #ef4444; }
.log-viewer .ansi-green { color: #4ade80; }
.log-viewer .ansi-yellow { color: #facc15; }
.log-viewer .ansi-blue { color: #60a5fa; }
.log-viewer .ansi-magenta { color: #e879f9; }
.log-viewer .ansi-cyan { color: #22d3ee; }
.log-viewer .ansi-white { color: #e5e7eb; }
.log-viewer .ansi-bright-black { color: #9ca3af; }
.log-viewer .ansi-bright-red { color: #fca5a5; }
.log-viewer .ansi-bright-green { color: #86efac; }
.log-viewer .ansi-bright-yellow { color: #fde047; }
.log-viewer .ansi-bright-blue { color: #93c5fd; }
.log-viewer .ansi-bright-magenta { color: #f0abfc; }
.log-viewer .ansi-bright-cyan { color: #67e8f9; }
.log-viewer .ansi-bright-white { color: #ffffff; }
.log-viewer .ansi-bg-black { background: #575757; }
.log-viewer .ansi-bg-red { background: #ef4444; }
.log-viewer .ansi-bg-green { background: #4ade80; }
.log-viewer .ansi-bg-yellow { background: #facc15; }
.log-viewer .ansi-bg-blue { background: #60a5fa; }
.log-viewer .ansi-bg-magenta { background: #e879f9; }
.log-viewer .ansi-bg-cyan { background: #22d3ee; }
.log-viewer .ansi-bg-white { background: #e5e7eb; }
.log-viewer .ansi-bg-bright-black { background: #9ca3af; }
.log-viewer .ansi-bg-bright-red { background: #fca5a5; }
.log-viewer .ansi-bg-bright-green { background: #86efac; }
.log-viewer .ansi-bg-bright-yellow { background: #fde047; }
.log-viewer .ansi-bg-bright-blue { background: #93c5fd; }
.log-viewer .ansi-bg-bright-magenta { background: #f0abfc; }
.log-viewer .ansi-bg-bright-cyan { background: #67e8f9; }
.log-viewer .ansi-bg-bright-white { background: #ffffff; }

/* ===== Status Dots ===== */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.active { background: #4ade80; box-shadow: 0 0 10px rgba(74,222,128,0.4); }
.status-dot.inactive { background: #6b7280; }
.status-dot.failed { background: #ef4444; box-shadow: 0 0 10px rgba(239,68,68,0.4); }
.status-dot.deploying {
  background: #C9A84C;
  box-shadow: 0 0 10px rgba(201,168,76,0.4);
  animation: pulse-gold 1.5s ease-in-out infinite;
}
@keyframes pulse-gold {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.4;
  white-space: nowrap;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn-sm { font-size: 0.75rem; padding: 0.25rem 0.5rem; border-radius: 5px; }

.btn-primary {
  background: #C9A84C;
  color: #05071a;
  font-weight: 600;
  border-color: #C9A84C;
}
.btn-primary:hover { background: #e8c96a; border-color: #e8c96a; }

.btn-secondary {
  background: rgba(201,168,76,0.1);
  color: #C9A84C;
  border-color: rgba(201,168,76,0.2);
}
.btn-secondary:hover { background: rgba(201,168,76,0.18); }

.btn-ghost {
  background: transparent;
  color: #9aa0b8;
  border-color: rgba(255,255,255,0.08);
}
.btn-ghost:hover { color: #c5cad8; border-color: rgba(255,255,255,0.15); }

.btn-live {
  color: #C9A84C;
  border-color: rgba(201,168,76,0.3);
  background: rgba(201,168,76,0.08);
}
.btn-live.active {
  color: #ef4444;
  border-color: rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.08);
}

/* ===== Dropdown ===== */
.dropdown { position: relative; display: inline-block; }
.dropdown-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: #5a6278;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 1rem;
  line-height: 1;
}
.dropdown-trigger:hover { color: #c5cad8; border-color: rgba(255,255,255,0.15); }
.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: #0c1033;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 4px;
  min-width: 130px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.12s, transform 0.12s;
  z-index: 50;
}
.dropdown-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  color: #9aa0b8;
  background: transparent;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.1s;
  font-family: inherit;
  white-space: nowrap;
}
.dropdown-item:hover { background: rgba(255,255,255,0.06); color: #c5cad8; }

/* ===== Forms ===== */
.form-input {
  width: 100%;
  background: #0c1033;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  color: #FFFFFF;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  outline: none;
  border-color: #C9A84C;
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}
.form-input::placeholder { color: #5a6278; }

/* ===== Log Viewer ===== */
.log-viewer {
  background: #05071a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 0.75rem;
  font-family: 'Geist Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  max-height: 500px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: #c5cad8;
}

/* ===== Code Editor ===== */
.code-editor {
  background: #05071a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 0.75rem;
  font-family: 'Geist Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #c5cad8;
  width: 100%;
  resize: vertical;
}
.code-editor:focus { outline: none; border-color: #C9A84C; }

/* ===== Env Input ===== */
.env-input {
  background: #05071a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 5px;
  padding: 0.35rem 0.5rem;
  font-family: 'Geist Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.75rem;
  color: #c5cad8;
  width: 100%;
  transition: border-color 0.2s;
}
.env-input:focus { outline: none; border-color: #C9A84C; }

/* ===== Tabs ===== */
.tab-btn {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #5a6278;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}
.tab-btn:hover { color: #9aa0b8; }
.tab-btn.active { color: #C9A84C; border-bottom-color: #C9A84C; }

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  background: #0c1033;
  border: 1px solid rgba(255,255,255,0.08);
  color: #e8ecf4;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  pointer-events: auto;
  animation: toastIn 0.2s ease-out;
}
.toast.toast-out { animation: toastOut 0.2s ease-in forwards; }
.toast.toast-success { border-left: 3px solid #4ade80; }
.toast.toast-error { border-left: 3px solid #ef4444; }
.toast.toast-info { border-left: 3px solid #C9A84C; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(12px); }
}

/* ===== Card ===== */
.card {
  background: #0c1033;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  transition: border-color 0.2s;
}
.card-hover:hover { border-color: rgba(255,255,255,0.12); }

/* ===== Badge ===== */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  line-height: 1.3;
}
.badge-deploying { background: rgba(201,168,76,0.12); color: #C9A84C; }
.badge-active { background: rgba(74,222,128,0.1); color: #4ade80; }
.badge-inactive { background: rgba(107,114,128,0.1); color: #9ca3af; }
.badge-failed { background: rgba(239,68,68,0.1); color: #ef4444; }
.badge-unknown { background: rgba(245,158,11,0.1); color: #f59e0b; }

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 0.3s ease-out both; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4,0,0.6,1) infinite; }

/* ===== Stream Indicator ===== */
.stream-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.65rem;
  font-weight: 500;
  color: #C9A84C;
}
.stream-indicator .pulse-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #C9A84C;
  animation: pulse 2s cubic-bezier(0.4,0,0.6,1) infinite;
}

/* ===== Section Label ===== */
.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5a6278;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .toast { animation: none; }
}
