:root {
  --primary-accent: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.5);
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

body {
  background: radial-gradient(circle at top center, #1e293b 0%, #020617 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: 'Space Grotesk', sans-serif;
  min-height: 100vh;
  padding-bottom: 3rem;
}

/* --- Navbar --- */
.navbar {
  backdrop-filter: blur(12px);
  background: rgba(2, 6, 23, 0.85);
  border-bottom: 1px solid var(--glass-border);
}
.brand-logo {
  font-weight: 400;
  font-size: 1.25rem;
  color: white;
  align-items: center;
  gap: 12px;
}
.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

/* --- Hero --- */
.hero-section {
  padding: 4rem 0 3rem;
  text-align: center;
}
.badge-soft {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.5em 1.2em;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 1.5rem;
  display: inline-block;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.1);
}
.hero-code {
  max-width: 720px;
  margin: 2rem auto 0;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.hero-code-tabs {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.hero-tab {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  user-select: none;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.hero-tab.active {
  color: #0f172a;
  background: #f8fafc;
  border-color: transparent;
}
.hero-code-body {
  padding: 18px 20px 16px;
  font-family: 'Space Grotesk', monospace;
  color: #e2e8f0;
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.4;
}
.hero-code-body .hl-str { color: #93e6b8; font-weight: 700; }
.hero-code-body .hl-topic { color: var(--primary-accent); font-weight: 700; }
.hero-code-body .hl-kw { color: #7dd3fc; font-weight: 700; }

/* --- Glass Cards & Steps --- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  height: 100%;
  transition: transform 0.2s, border-color 0.2s;
  overflow: hidden;
}

.glass-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}

.step-number {
  font-size: 5rem;
  font-weight: 800;
  background: linear-gradient(180deg, rgb(98 186 243 / 35%) 0%, rgba(255, 255, 255, 0.02) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: absolute;
  top: 5px;
  right: 15px;
  line-height: 1;
  pointer-events: none;
  z-index: 0;
}

.feature-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.1);
  position: relative;
  z-index: 1;
}

.card-content {
  position: relative;
  z-index: 1;
}

/* --- Tabs --- */
.nav-pills-custom {
  background: rgba(0,0,0,0.3);
  padding: 6px;
  border-radius: 14px;
  display: inline-flex;
  border: 1px solid var(--glass-border);
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.nav-pills-custom .nav-link {
  color: var(--text-muted);
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.2s ease;
}
.nav-pills-custom .nav-link:hover {
  color: white;
  background: rgba(255,255,255,0.05);
}
.nav-pills-custom .nav-link.active {
  background: var(--primary-accent);
  color: #0f172a;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

/* --- Forms --- */
.form-control, .form-select {
  background-color: rgba(2, 6, 23, 0.5);
  border: 1px solid #334155;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 10px;
}
.form-control:focus, .form-select:focus {
  background-color: rgba(2, 6, 23, 0.8);
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
  color: white;
}
.input-group-text {
  background-color: rgba(2, 6, 23, 0.5);
  border: 1px solid #334155;
  border-right: none;
  color: var(--text-muted);
}

/* --- Buttons --- */
.btn-theme {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
  border: none;
  color: white;
  font-weight: 700;
  padding: 0.85rem 2rem;
  border-radius: 12px;
  transition: all 0.2s;
}
.btn-theme:hover {
  transform: translateY(-1px);
  color: white;
}
.btn-outline-custom {
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-main);
  border-radius: 8px;
}
.btn-outline-custom:hover {
  background: rgba(255,255,255,0.1);
  border-color: white;
}

/* --- Advanced Options Styling --- */
.advanced-toggle-btn {
  color: var(--primary-accent);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: rgba(56, 189, 248, 0.08);
  border-radius: 30px;
  border: 1px solid rgba(56, 189, 248, 0.1);
  transition: all 0.2s;
}
.advanced-toggle-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.3);
}
.advanced-toggle-btn i {
  transition: transform 0.3s;
}
.advanced-toggle-btn[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.advanced-panel {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
}

/* --- Subscriptions List --- */
#subscriptions-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.subscription-item {
  background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(15,23,42,0.45));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.subscription-left {
  min-width: 0;
}
.subscription-name {
  font-weight: 700;
  font-size: 1rem;
  color: #f8fafc;
}
.subscription-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 2px;
}
.subscription-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.sub-btn {
  border-radius: 10px;
  padding: 6px 12px;
  font-weight: 600;
}
.subscription-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
}

/* --- History List --- */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.history-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(15,23,42,0.45));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.2);
}
.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.history-card-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.history-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.08);
}
.history-title {
  font-weight: 800;
  color: #f8fafc;
  font-size: 1.02rem;
}
.history-message {
  color: var(--text-muted);
  margin-top: 2px;
  font-size: 0.95rem;
}
.history-card-meta {
  text-align: right;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  white-space: nowrap;
}
.history-timestamp {
  color: #cbd5e1;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.history-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.history-pill {
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid transparent;
}
.history-pill.success {
  background: rgba(74, 222, 128, 0.12);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.25);
}
.history-pill.fail {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.25);
}
.history-empty {
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
}
