:root {
  --space-bg: #0a0a0c;
  --indigo-500: #6366f1;
  --indigo-400: #818cf8;
  --slate-400: #94a3b8;
  --slate-600: #475569;
}

/* ── Global Elements ── */
html, body {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

img, svg, video, canvas {
  max-width: 100%;
}

pre, code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Avoid accidental horizontal scroll from long shadows/transforms */
main, nav, header, section, footer {
  max-width: 100%;
}

*:focus {
  outline: none !important;
}

textarea, input {
  outline: none !important;
}

.glass {
  backdrop-filter: blur(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-glow:focus-within {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 
    0 0 40px -10px rgba(99, 102, 241, 0.3),
    0 20px 40px -20px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

.scrollbar-thin::-webkit-scrollbar {
  width: 6px;
}
.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
}
.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ── Background Animations ── */
.space-aurora {
  background: radial-gradient(closest-side, rgba(99, 102, 241, 0.25), transparent);
}
.space-aurora2 {
  background: radial-gradient(closest-side, rgba(168, 85, 247, 0.15), transparent);
}
.space-grid {
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(circle at 50% 0%, black, transparent 80%);
}
.space-stars {
  background-image: 
    radial-gradient(1px 1px at 10% 10%, white, transparent),
    radial-gradient(1px 1px at 20% 80%, white, transparent),
    radial-gradient(1px 1px at 70% 30%, white, transparent),
    radial-gradient(1.5px 1.5px at 90% 90%, white, transparent);
  background-size: 300px 300px;
}

/* ── Category Tabs ── */
.cat-tab {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.cat-tab:hover {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
}
.cat-tab-active {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
}

/* ── AI Cards ── */
.ai-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.ai-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.ai-card-active {
  background: rgba(99, 102, 241, 0.05);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}

.ai-card-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-card-icon {
  display: flex;
  height: 36px;
  width: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid;
}

.ai-icon {
  width: 18px;
  height: 18px;
}

.ai-card-name {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
}

.ai-card-tag {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
}

.ai-card-cat {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid;
}

/* ── Output Layout ── */
.code-surface::-webkit-scrollbar {
  width: 8px;
}
.code-surface::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.1);
  border-radius: 4px;
}
.code-surface::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.2);
}

#optimizedOutput {
  font-family: 'JetBrains Mono', 'Fira Code', 'IBM Plex Mono', ui-monospace, monospace;
}

#thinkingState {
  transition: opacity 0.3s ease;
}

@keyframes pulse-gentle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.98); }
}

.animate-pulse-gentle {
  animation: pulse-gentle 2s infinite ease-in-out;
}

#generateBtn {
  box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.4);
}

#generateBtn:hover {
  box-shadow: 0 8px 30px -4px rgba(99, 102, 241, 0.5);
}

.no-results {
  padding: 40px;
  text-align: center;
  font-size: 13px;
  color: #64748b;
  font-style: italic;
}

/* ── Button States ── */
.copy-success {
  background: #10b981 !important;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3) !important;
}

.btn-icon {
  width: 14px;
  height: 14px;
}

/* ── Responsive adjustments ── */
@media (max-width: 640px) {
  .ai-card-tag {
    display: none;
  }
}

/* Ad blocks removed */

.legal-ad-footer {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 0 0 140px;
  font-size: 11px;
  color: #475569;
}

.legal-ad-footer a:hover {
  color: #818cf8;
}
