:root {
  --bg: #07040d;
  --card-bg: rgba(13, 8, 24, 0.75);
  --border: rgba(139, 92, 246, 0.18);
  --border-hover: rgba(139, 92, 246, 0.35);
  --purple: #8b5cf6;
  --blue: #3b82f6;
  --green: #10b981;
  --red: #ef4444;
  --amber: #f59e0b;
  --text: #e2d9f3;
  --text-dim: #7c6fa0;
  --text-muted: #53496d;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Background Glowing Elements */
.glow-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: 
    radial-gradient(ellipse 60% 50% at 15% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 85% 80%, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
}

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 20px;
}

/* Card Styling */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: 
    0 10px 40px -10px rgba(0, 0, 0, 0.7),
    0 0 30px 0 rgba(139, 92, 246, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: 
    0 10px 40px -10px rgba(0, 0, 0, 0.8),
    0 0 30px 0 rgba(139, 92, 246, 0.08);
}

/* Header & Logo */
.header {
  margin-bottom: 32px;
}

.logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px auto;
  filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.3));
}

.logo svg {
  width: 100%;
  height: 100%;
}

h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #c084fc, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Status Indicator Box */
.status-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 20px 24px;
  width: 100%;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.status-text {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.last-checked {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Status Dot & Pulse Animations */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: relative;
  transition: background-color 0.3s ease;
}

.status-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  opacity: 0.4;
}

/* Checking Status (Grey/Blue Pulse) */
.status-dot.checking {
  background-color: var(--text-dim);
}
.status-dot.checking::after {
  border: 4px solid var(--text-dim);
  animation: pulse-checking 1.6s infinite ease-in-out;
}

/* Online Status (Green Pulse) */
.status-dot.online {
  background-color: var(--green);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}
.status-dot.online::after {
  border: 4px solid var(--green);
  animation: pulse-online 1.6s infinite ease-in-out;
}

/* Offline Status (Red Pulse) */
.status-dot.offline {
  background-color: var(--red);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}
.status-dot.offline::after {
  border: 4px solid var(--red);
  animation: pulse-offline 1.6s infinite ease-in-out;
}

/* Failure Status (Orange Pulse) */
.status-dot.failed {
  background-color: var(--amber);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}
.status-dot.failed::after {
  border: 4px solid var(--amber);
  animation: pulse-failed 1.6s infinite ease-in-out;
}

@keyframes pulse-checking {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(2.2); opacity: 0; }
}
@keyframes pulse-online {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}
@keyframes pulse-offline {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}
@keyframes pulse-failed {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Command Select Box */
.command-select-box {
  width: 100%;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.command-select-box.hidden {
  display: none !important;
}

.command-select-box label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.command-select-box select {
  width: 100%;
  height: 44px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0 14px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c6fa0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  transition: border-color 0.2s ease;
}

.command-select-box select:hover,
.command-select-box select:focus {
  border-color: var(--border-hover);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.command-select-box select option {
  background-color: var(--bg);
  color: var(--text);
}

/* Actions Section */
.actions {
  width: 100%;
  margin-bottom: 24px;
  min-height: 48px;
  display: flex;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  padding: 0 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  outline: none;
}

.btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.btn.hidden {
  display: none !important;
}

/* Start Console Button */
.btn-start {
  background: var(--card-bg);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #d8b4fe;
}

.btn-start:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.6);
  color: #e9d5ff;
}

.btn-start:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.05);
}

.btn-start:disabled svg {
  animation: rotate-sync 1.5s infinite linear;
}

/* Open Console Link */
.btn-open {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.25);
}

.btn-open:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
  background: linear-gradient(135deg, #996df8, #4f8df7);
}

.btn-open:hover svg {
  transform: translateX(4px);
}

.btn-open:active {
  transform: translateY(0);
}

/* Footer Section */
.footer {
  font-size: 0.75rem;
  color: var(--text-muted);
}

@keyframes rotate-sync {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
