:root {
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --primary-hover: #4f46e5;
  --bg-dark: #070b14;
  --glass-bg: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --card-bg: rgba(30, 41, 59, 0.4);
  --text-main: #f8fafc;
  --text-dim: #94a3b8;
  --error: #f43f5e;
  --success: #10b981;
  --info: #3b82f6;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Outfit", sans-serif;
}

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

/* Background Blobs */
.background-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  filter: blur(120px);
  pointer-events: none;
}

.blob {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  opacity: 0.25;
  animation: move-blobs 25s infinite alternate ease-in-out;
}

.blob-1 {
  background: var(--primary);
  top: -100px;
  left: -50px;
}

.blob-2 {
  background: #ec4899;
  bottom: -150px;
  right: -50px;
  animation-delay: -7s;
}

.blob-3 {
  background: #06b6d4;
  top: 40%;
  left: 60%;
  width: 400px;
  height: 400px;
  animation-duration: 30s;
}

@keyframes move-blobs {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(100px, 80px) scale(1.1); }
  100% { transform: translate(-50px, 120px) scale(0.9); }
}

/* Main Container */
.glass-container {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  padding: 40px;
  width: 92%;
  max-width: 900px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.05);
  z-index: 10;
  animation: fade-in 1s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header */
header {
  margin-bottom: 40px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
}

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

.logo-circle {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), #ec4899);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px var(--primary-glow);
}

.zap-icon {
  color: white;
  width: 24px;
  height: 24px;
}

h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

h1 span {
  background: linear-gradient(90deg, #6366f1, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-dim);
  font-size: 1.05rem;
  grid-column: 1 / 2;
  margin-top: 4px;
}

.header-actions {
  grid-row: 1 / 3;
  grid-column: 2;
}

/* Form Layout */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  color: var(--text-main);
}

.section-header i {
  color: var(--primary);
  width: 20px;
  height: 20px;
}

.section-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

/* Inputs */
.input-row {
  margin-bottom: 20px;
}

.input-row.split {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-left: 4px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper i {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  pointer-events: none;
  transition: var(--transition);
}

.input-wrapper input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: white;
  font-size: 0.95rem;
  transition: var(--transition);
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(15, 23, 42, 0.6);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.input-wrapper input:focus + i,
.input-wrapper i.active {
  color: var(--primary);
}

/* Remove arrows from number input */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Switch Toggle */
.toggle-group {
  margin-top: 12px;
}

.switch-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  gap: 12px;
}

.switch-container input {
  display: none;
}

.switch-slider {
  position: relative;
  width: 44px;
  height: 22px;
  background: #1e293b;
  border-radius: 20px;
  transition: var(--transition);
  border: 1px solid var(--glass-border);
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 3px;
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch-container input:checked + .switch-slider {
  background: var(--primary);
}

.switch-container input:checked + .switch-slider::before {
  transform: translateX(20px);
}

.switch-label {
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  border: none;
  border-radius: 16px;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 10px 25px -5px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -5px var(--primary-glow);
  filter: brightness(1.1);
}

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

.btn-icon {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.btn-icon i {
  width: 20px;
  height: 20px;
}

/* Status Board Modal */
.status-board {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in-fast 0.3s ease-out;
}

@keyframes fade-in-fast {
  from { opacity: 0; }
  to { opacity: 1; }
}

.status-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.status-content {
  position: relative;
  width: 90%;
  max-width: 600px;
  background: #0f172a;
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.9);
  z-index: 1001;
}

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

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

.status-title i {
  color: var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

.btn-close {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-close:hover {
  background: rgba(244, 63, 94, 0.1);
  color: var(--error);
}

.status-logs {
  background: #070b14;
  border-radius: 16px;
  padding: 20px;
  height: 350px;
  overflow-y: auto;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.status-logs::-webkit-scrollbar {
  width: 6px;
}

.status-logs::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

.log-entry {
  margin-bottom: 12px;
  line-height: 1.5;
  animation: slide-in-log 0.3s ease-out;
}

@keyframes slide-in-log {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.log-time {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-right: 8px;
}

.log-info { color: #f8fafc; }
.log-success { color: var(--success); }
.log-error { color: var(--error); border-left: 2px solid var(--error); padding-left: 8px; }

/* Loader */
.loader {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

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

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .glass-container {
    padding: 24px;
    border-radius: 24px;
  }
  
  h1 {
    font-size: 1.8rem;
  }
}
