/* ═══════════════════════════════════════════
   AI Studio — Components (WOW Edition)
   ═══════════════════════════════════════════ */

/* ── Glass Card ── */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
}
.glass-card:hover { border-color: var(--border-light); box-shadow: var(--shadow-card); }
.glass-card.active {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
  background: var(--bg-card-active);
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border: none; border-radius: var(--radius-md);
  font-family: var(--font-ui); font-size: 0.9rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition-fast);
  white-space: nowrap; user-select: none; position: relative; overflow: hidden;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn--primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: var(--text-on-accent); font-weight: 600;
  box-shadow: 0 4px 16px rgba(245,158,11,0.2);
}
.btn--primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(245,158,11,0.35);
}

.btn--secondary {
  background: rgba(255,255,255,0.05); color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn--secondary:hover:not(:disabled) { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.15); }

.btn--ghost {
  background: transparent; color: var(--text-secondary);
}
.btn--ghost:hover:not(:disabled) { background: rgba(255,255,255,0.04); color: var(--text-primary); }

.btn--danger {
  background: rgba(239,68,68,0.15); color: var(--error);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn--danger:hover:not(:disabled) { background: rgba(239,68,68,0.25); }

.btn--sm { padding: 6px 12px; font-size: 0.8rem; }
.btn--lg { padding: 14px 28px; font-size: 1rem; }
.btn--xl { padding: 16px 36px; font-size: 1.1rem; border-radius: var(--radius-lg); }
.btn--full { width: 100%; }

.btn--icon {
  width: 40px; height: 40px; padding: 0; border-radius: var(--radius-md);
}

/* ── Inputs ── */
.input, .textarea, .select {
  width: 100%; padding: 12px 16px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-family: var(--font-ui); font-size: 0.9rem;
  transition: all var(--transition-fast);
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow-3), 0 0 20px var(--accent-glow-2);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.textarea { resize: vertical; min-height: 100px; }
.textarea--prompt {
  font-family: var(--font-mono); font-size: 0.95rem; min-height: 140px;
  line-height: 1.6; border-radius: var(--radius-lg);
}
.select {
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23A0A0B0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px;
}

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 500;
}
.badge--free { background: rgba(16,185,129,0.12); color: var(--success); }
.badge--paid { background: rgba(245,158,11,0.12); color: var(--accent-light); }
.badge--error { background: var(--error-glow); color: var(--error); }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-full); font-size: 0.85rem; color: var(--text-secondary);
}
.tag__remove { cursor: pointer; color: var(--text-muted); font-size: 1.1rem; line-height: 1; transition: var(--transition-fast); }
.tag__remove:hover { color: var(--error); }

/* ── Tabs ── */
.tabs {
  display: flex; gap: 4px; background: rgba(255,255,255,0.03);
  padding: 4px; border-radius: var(--radius-md);
}
.tab {
  flex: 1; padding: 8px 14px; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted);
  font-family: var(--font-ui); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition-fast);
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  background: rgba(245,158,11,0.12); color: var(--accent-light);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ── Spinner ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 24px; height: 24px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner--lg { width: 48px; height: 48px; border-width: 3px; }

/* ── Skeleton ── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
.skeleton--text { height: 14px; }
.skeleton--image { height: 220px; border-radius: var(--radius-lg); }

/* ── Modal ── */
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg-overlay); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn var(--transition-fast);
}
.modal {
  background: var(--bg-card-solid); border: 1px solid var(--border-light);
  border-radius: var(--radius-xl); padding: 32px; max-width: 560px; width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  animation: modalIn var(--transition-slow);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state__icon { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.6; }
.empty-state__title { color: var(--text-secondary); font-size: 1.2rem; margin-bottom: 8px; }
.empty-state__text { font-size: 0.9rem; max-width: 400px; margin: 0 auto; }

/* ── Toast ── */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.toast {
  padding: 14px 20px; border-radius: var(--radius-md); font-size: 0.9rem;
  animation: toastIn var(--transition-slow);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; gap: 8px; max-width: 380px;
}
.toast--success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: #6EE7B7; }
.toast--error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #FCA5A5; }
.toast--info { background: rgba(96,165,250,0.12); border: 1px solid rgba(96,165,250,0.25); color: #93C5FD; }

/* ── Model Option ── */
.model-option {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: rgba(255,255,255,0.02);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  cursor: pointer; transition: all var(--transition-fast);
}
.model-option:hover { background: rgba(255,255,255,0.04); border-color: var(--border-light); }
.model-option.selected {
  border-color: var(--accent); background: rgba(245,158,11,0.06);
  box-shadow: 0 0 20px rgba(245,158,11,0.06);
}
.model-option__cost { margin-left: auto; font-size: 0.8rem; }
.model-option__cost.free { color: var(--success); }
.model-option__cost.paid { color: var(--accent-light); }
