/* ════════════════════════════════════════════════════════════════
   QBrain — Ultra 4K Dashboard-Grade Styling (UA Generator Pro)
   1-Frame Viewport Compact Design System
════════════════════════════════════════════════════════════════ */

/* ── MAIN DASHBOARD GRID (1 Frame Split) ─────────────────────── */
.ua-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.15rem;
  align-items: start;
}

@media (max-width: 1080px) {
  .ua-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* ── LEFT MAIN WORKSPACE ──────────────────────────────────────── */
.ua-workspace-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* ── RIGHT CONTROL SIDEBAR PANEL ──────────────────────────────── */
.ua-control-sidebar {
  background: linear-gradient(160deg, #0b0d24 0%, #08091a 60%, #060713 100%);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 20px;
  padding: 1rem 1.1rem;
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(99, 102, 241, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: sticky;
  top: 1rem;
  overflow: hidden;
}

.ua-control-sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #38bdf8, #818cf8, #c084fc, transparent);
}

/* ── COLORFUL SIDEBAR SECTION TITLES ──────────────────────────── */
.sidebar-section-title {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #ffffff 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-section-title::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

/* ── COMPACT STACKED & GRID CARDS ────────────────────────────── */
.ua-stacked-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
}

.ua-stacked-grid.single-col {
  grid-template-columns: 1fr;
}

.ua-stacked-card {
  position: relative;
  background: rgba(15, 17, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.ua-stacked-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateY(-1.5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Color accents */
.ua-stacked-card[data-platform="android"].active {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.25) 0%, rgba(16, 185, 129, 0.12) 100%);
  border: 1.5px solid #22c55e;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.3);
}

.ua-stacked-card[data-platform="iphone"].active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25) 0%, rgba(99, 102, 241, 0.15) 100%);
  border: 1.5px solid #38bdf8;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.3);
}

.ua-stacked-card[data-platform="mix"].active {
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.3) 0%, rgba(56, 189, 248, 0.2) 100%);
  border: 1.5px solid #c084fc;
  box-shadow: 0 0 18px rgba(192, 132, 252, 0.35);
}

.ua-stacked-card[data-mode="facebook"].active {
  background: linear-gradient(135deg, rgba(24, 119, 242, 0.28) 0%, rgba(99, 102, 241, 0.18) 100%);
  border: 1.5px solid #1877f2;
  box-shadow: 0 0 18px rgba(24, 119, 242, 0.35);
}

.ua-stacked-card[data-mode="inapp"].active {
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.28) 0%, rgba(236, 72, 153, 0.18) 100%);
  border: 1.5px solid #c084fc;
  box-shadow: 0 0 18px rgba(192, 132, 252, 0.35);
}

.ua-logo-box {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(6, 7, 19, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ua-logo-box svg {
  width: 16px;
  height: 16px;
}

.ua-card-details {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  overflow: hidden;
}

.ua-card-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
}

.ua-card-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.ua-active-pill {
  position: absolute;
  top: 6px; right: 6px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ua-stacked-card.active .ua-active-pill {
  opacity: 1;
}

/* ── STYLED LOCALE PICKER ─────────────────────────────────────── */
.ua-sidebar-locale {
  position: relative;
}

.ua-sidebar-select {
  width: 100%;
  padding: 0.55rem 0.8rem 0.55rem 2.4rem;
  border-radius: 12px;
  background: rgba(15, 17, 42, 0.85);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ua-sidebar-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
}

.ua-sidebar-locale-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
}

/* ── DEVICE RATIO CONTROLS ────────────────────────────────────── */
.ua-ratio-container {
  background: rgba(15, 17, 42, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: 14px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ua-ratio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ua-ratio-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: #a5b4fc;
}

.ua-ratio-badges {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.ua-ratio-badge-apple {
  font-size: 0.68rem;
  font-weight: 900;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.ua-ratio-badge-android {
  font-size: 0.68rem;
  font-weight: 900;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.ua-ratio-slider-wrap {
  display: flex;
  flex-direction: column;
}

.ua-ratio-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, #38bdf8 var(--apple-pct, 70%), #4ade80 var(--apple-pct, 70%));
  outline: none;
  cursor: pointer;
}

.ua-ratio-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
  cursor: pointer;
}

.ua-ratio-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
}

.ua-ratio-preset-btn {
  padding: 0.3rem 0.2rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  font-family: 'Inter', sans-serif;
}

.ua-ratio-preset-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(56, 189, 248, 0.3);
}

.ua-ratio-preset-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(192, 132, 252, 0.25));
  border-color: #38bdf8;
  color: #ffffff;
}

/* ── SEGMENTED QUANTITY BAR ──────────────────────────────────── */
.qty-sidebar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.qty-sidebar-btn {
  padding: 0.4rem 0.25rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.qty-sidebar-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(56, 189, 248, 0.3);
}

.qty-sidebar-btn.active {
  background: linear-gradient(135deg, #6366f1 0%, #38bdf8 100%);
  color: #ffffff;
  border-color: transparent;
}

.qty-sidebar-btn.btn-12pack {
  grid-column: span 4;
  padding: 0.5rem;
  font-size: 0.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(56, 189, 248, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #4ade80;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.qty-sidebar-btn.btn-12pack.active {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45);
}

/* ── SHIMMERING LAUNCH BUTTON ────────────────────────────────── */
.ua-sidebar-gen-btn {
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.ua-sidebar-gen-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.6);
}

/* ── HERO BANNER IN WORKSPACE ────────────────────────────────── */
.ua-hero-banner {
  background: linear-gradient(135deg, rgba(14, 16, 42, 0.9) 0%, rgba(10, 11, 30, 0.95) 100%);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 16px;
  padding: 0.95rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.ua-hero-title {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #38bdf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ua-hero-badge-group {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.ua-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.75rem;
  border-radius: 99px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #38bdf8;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── LIVE PREVIEW IN WORKSPACE ───────────────────────────────── */
.ua-live-preview-box {
  background: rgba(6, 7, 19, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 14px;
  padding: 0.65rem 0.95rem;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.ua-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.ua-preview-title {
  font-size: 0.68rem;
  font-weight: 800;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ua-preview-title::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #38bdf8;
}

.ua-preview-text {
  font-family: 'Consolas', monospace;
  font-size: 0.76rem;
  color: #a5b4fc;
  line-height: 1.45;
  word-break: break-all;
}

/* ── OUTPUT CARD IN WORKSPACE ────────────────────────────────── */
.ua-output-card {
  background: var(--bg-card);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.ua-output-textarea {
  width: 100%;
  height: 230px;
  background: rgba(6, 7, 19, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  color: #a5b4fc;
  font-family: 'Consolas', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
}

.ua-output-textarea:focus {
  border-color: #38bdf8;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 18px rgba(56, 189, 248, 0.22);
}

/* ── STATS DASHBOARD ROW ─────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.65rem;
}

.stat-card {
  background: rgba(15, 17, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.65rem 0.6rem;
  text-align: center;
}

.stat-number {
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 0.2rem;
}

.stat-label {
  font-size: 0.64rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
}
