/* === Base === */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

::selection {
  background: rgba(16, 185, 129, 0.3);
  color: white;
}

body {
  overflow-x: hidden;
}

/* === Gradient text === */
.gradient-text {
  background: linear-gradient(135deg, #10b981 0%, #34d399 40%, #6ee7b7 70%, #10b981 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 6s ease-in-out infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* === Animations === */
.fade-in-up {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Tool cards === */
.tool-card {
  will-change: transform;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px -12px rgba(16, 185, 129, 0.08);
}

/* === Editor grid === */
.editor-grid {
  min-height: 380px;
}

@media (min-width: 1024px) {
  .editor-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* === Mode pills === */
.mode-pill {
  cursor: pointer;
  user-select: none;
}

.mode-pill.active,
.mode-pill[data-active="true"] {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #10b981;
}

/* === Language select === */
#lang-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

#lang-select option {
  background: #111;
  color: #eee;
}

/* === Generate button === */
.generate-btn {
  box-shadow: 0 0 20px -4px rgba(16, 185, 129, 0.25);
}

.generate-btn:hover:not(:disabled) {
  box-shadow: 0 0 30px -4px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.generate-btn:active:not(:disabled) {
  transform: translateY(0);
}

/* === Streaming cursor === */
.streaming-cursor::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: #10b981;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.8s steps(2) infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* === Code output === */
#output pre,
#output code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

#output pre {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px;
  margin: 8px 0;
  overflow-x: auto;
}

#output p {
  margin-bottom: 0.5em;
}

#output p:last-child {
  margin-bottom: 0;
}

#output ul, #output ol {
  margin-left: 1.25em;
  margin-bottom: 0.5em;
}

#output li {
  margin-bottom: 0.25em;
}

#output strong {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

/* === Copy tooltip === */
.copy-tooltip.show {
  opacity: 1;
}

/* === Rate dots === */
.rate-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.4);
  transition: background 0.3s, opacity 0.3s;
}

.rate-dot.used {
  background: rgba(255, 255, 255, 0.08);
}

.rate-dot.low {
  background: rgba(239, 68, 68, 0.5);
}

/* === Error banner === */
#error-banner {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Mobile textarea height === */
@media (max-width: 640px) {
  #input-text {
    min-height: 160px;
  }

  .editor-grid {
    min-height: auto;
  }
}
