:root {
  --bg-color: #0f1016;
  --card-bg: rgba(22, 25, 37, 0.7);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-color: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --error: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.2);
  --warning: #f59e0b;
  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'Fira Code', monospace;
}

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

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

/* Background glows */
.background-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.45;
}

.bg-glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #4f46e5 0%, transparent 70%);
  top: -100px;
  right: -50px;
}

.bg-glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
  bottom: -200px;
  left: -100px;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 16, 22, 0.5);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  backdrop-filter: blur(12px);
  background: rgba(15, 16, 22, 0.6);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 1.8rem;
  animation: float 3s ease-in-out infinite;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-text span {
  background: linear-gradient(135deg, #a78bfa 0%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-pic {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.user-email {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Login Page Layout */
.login-page {
  justify-content: center;
  align-items: center;
}

.login-container {
  width: 100%;
  max-width: 480px;
  padding: 1.5rem;
}

.login-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, #8b5cf6 100%);
}

.login-card .logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 2.5rem;
}

.google-signin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #ffffff;
  color: #1f2937;
  padding: 0.875rem 1.75rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  width: 100%;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: var(--transition);
}

.google-signin-btn:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.25);
}

.info-box {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 2rem;
  text-align: left;
}

.info-icon {
  font-size: 1.2rem;
}

.info-text {
  font-size: 0.85rem;
  line-height: 1.4;
  color: #cbd5e1;
}

.info-text strong {
  color: #e2e8f0;
}

/* Main Dashboard */
.dashboard-content {
  flex: 1;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Card General */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.card-header {
  padding: 2rem;
  border-bottom: 1px solid var(--card-border);
}

.card-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* Form Styles */
#initializer-form {
  padding: 2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 868px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #e2e8f0;
  letter-spacing: 0.3px;
}

input[type="text"],
input[type="password"] {
  background: rgba(15, 16, 22, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.875rem 1rem;
  font-size: 0.95rem;
  color: var(--text-color);
  font-family: var(--font-sans);
  min-height: 48px;
  box-sizing: border-box;
  transition: var(--transition);
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-help {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* File Upload Grid */
.file-uploads-section {
  margin-top: 1rem;
}

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

.file-upload-box {
  background: rgba(15, 16, 22, 0.4);
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}

.file-upload-box:hover,
.file-upload-box.drag-over {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
  transition: transform 0.3s ease;
}

.file-upload-box:hover .upload-icon {
  transform: translateY(-4px) scale(1.1);
}

.upload-label {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: #e2e8f0;
}

.upload-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-name-display {
  display: inline-block;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  color: var(--text-muted);
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  z-index: 3;
}

.file-upload-box.has-file {
  border-style: solid;
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.03);
}

.file-upload-box.has-file .file-name-display {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
}

/* Button & Actions */
.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2.5rem;
  border-top: 1px solid var(--card-border);
  padding-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-color);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-logout {
  padding: 0.5rem 1rem;
  min-height: 38px;
  font-size: 0.85rem;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  min-height: 32px;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* Spinner */
.btn-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-left: 0.5rem;
}

.hidden {
  display: none !important;
}

/* Terminal Overlay */
.terminal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 11, 16, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 0.3s ease;
}

.terminal-card {
  width: 100%;
  max-width: 900px;
  height: 600px;
  background: #090a0f;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.terminal-header {
  background: #12131b;
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red { background-color: #ef4444; }
.dot.yellow { background-color: #f59e0b; }
.dot.green { background-color: #10b981; }

.terminal-title {
  font-size: 0.85rem;
  font-family: var(--font-sans);
  color: var(--text-muted);
  font-weight: 500;
}

.terminal-body {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.log-line {
  white-space: pre-wrap;
  word-break: break-all;
}

.log-line.system { color: #818cf8; }
.log-line.stdout { color: #f1f5f9; }
.log-line.stderr { color: #f43f5e; }
.log-line.info { color: #38bdf8; }
.log-line.command { color: #fbbf24; font-weight: 500; }
.log-line.success { color: #34d399; font-weight: bold; }
.log-line.error { color: #f43f5e; font-weight: bold; padding: 0.5rem; background: rgba(244, 63, 94, 0.1); border-radius: 6px; border-left: 3px solid #f43f5e; margin: 0.5rem 0; }

.terminal-footer {
  background: #12131b;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-bar-container {
  flex: 1;
  max-width: 60%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-right: 2rem;
}

.progress-bar {
  height: 100%;
  width: 5%;
  background: linear-gradient(90deg, var(--primary) 0%, #10b981 100%);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.status-indicator {
  font-size: 0.85rem;
  color: var(--text-muted);
}

#pipeline-status {
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

#pipeline-status.running {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.1);
}

#pipeline-status.completed {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

#pipeline-status.failed {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

/* Alert Notification */
.alert {
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.alert-icon {
  font-size: 1.25rem;
}

/* Animations */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0px); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (pointer: coarse) {
  input[type="text"],
  input[type="password"] {
    min-height: 52px;
  }
  .btn {
    min-height: 52px;
  }
}

/* Execution Steps Options Section */
.execution-options-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  width: 100%;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 1rem;
}

.checkbox-container {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 35px;
  cursor: pointer;
  font-size: 0.95rem;
  user-select: none;
  min-height: 24px;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkbox-checkmark {
  position: absolute;
  top: 1px;
  left: 0;
  height: 22px;
  width: 22px;
  background-color: rgba(15, 16, 22, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  transition: var(--transition);
}

.checkbox-container:hover input ~ .checkbox-checkmark {
  border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkbox-checkmark {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.checkbox-checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkbox-checkmark:after {
  display: block;
}

.checkbox-container .checkbox-checkmark:after {
  left: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.checkbox-label-text {
  font-weight: 500;
  color: #e2e8f0;
}

/* AdMob Mode Toggle (Radio Buttons) */
.admob-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
}

.radio-container {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 32px;
  cursor: pointer;
  font-size: 0.9rem;
  user-select: none;
  min-height: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  transition: var(--transition);
}

.radio-container:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.radio-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.radio-checkmark {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  height: 18px;
  width: 18px;
  background-color: rgba(15, 16, 22, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  transition: var(--transition);
}

.radio-container:hover input ~ .radio-checkmark {
  border-color: var(--primary);
}

.radio-container input:checked ~ .radio-checkmark {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

.radio-checkmark:after {
  content: "";
  position: absolute;
  display: none;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: white;
}

.radio-container input:checked ~ .radio-checkmark:after {
  display: block;
}

.radio-label-text {
  font-weight: 500;
  color: #e2e8f0;
}

.radio-container input:checked ~ .radio-label-text {
  color: #a5b4fc;
}

.admob-mode-group {
  transition: opacity 0.3s ease;
}

/* ── Single Ad Unit Card ─────────────────────────────── */
.single-adunit-card {
  margin-top: 2rem;
}

#single-adunit-form {
  padding: 2rem;
}

.single-adunit-grid {
  grid-template-columns: 1fr 1fr 1fr;
  margin-bottom: 0;
}

@media (max-width: 868px) {
  .single-adunit-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Select Dropdown ─────────────────────────────────── */
.select-wrapper {
  position: relative;
}

.select-wrapper select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(15, 16, 22, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.875rem 2.5rem 0.875rem 1rem;
  font-size: 0.95rem;
  color: var(--text-color);
  font-family: var(--font-sans);
  min-height: 48px;
  cursor: pointer;
  transition: var(--transition);
}

.select-wrapper select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.select-wrapper select option {
  background: #1a1c28;
  color: var(--text-color);
}

.select-arrow {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
}

/* ── Toast Notification ──────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 320px;
  max-width: 480px;
  background: rgba(22, 25, 37, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  animation: toastSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

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

.toast.toast-success {
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(16, 185, 129, 0.1);
}

.toast.toast-error {
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(239, 68, 68, 0.1);
}

.toast-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.toast-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #f1f5f9;
}

.toast-message {
  font-size: 0.82rem;
  color: var(--text-muted);
  word-break: break-all;
  line-height: 1.4;
  white-space: pre-wrap;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.2s;
  margin-top: 0.1rem;
}

.toast-close:hover {
  color: #f1f5f9;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

