/* CSS Variables for theming */
:root {
  --bg-primary: #1a3a52;
  --bg-secondary: #2d4f6b;
  --bg-card: #1e2d3d;
  --text-primary: #f5f5f0;
  --text-secondary: #a8b8c8;
  --accent-color: #4a9eff;
  --accent-hover: #3a8eef;
  --border-color: #3d5a7a;
  --shadow: rgba(0, 0, 0, 0.3);
  --tag-bg: #2d4f6b;
  --tag-text: #8ab4f8;
  --favorite-color: #ffd700;
  --favorite-active: #ffed4e;
}

/* Light mode */
body.light-mode {
  --bg-primary: #f5f5f0;
  --bg-secondary: #e8e8e3;
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #555555;
  --accent-color: #2563eb;
  --accent-hover: #1d4ed8;
  --border-color: #d0d0d0;
  --shadow: rgba(0, 0, 0, 0.1);
  --tag-bg: #e0e7ff;
  --tag-text: #1e40af;
  --favorite-color: #fbbf24;
  --favorite-active: #f59e0b;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* Header */
.header {
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-color);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px var(--shadow);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  width: 50px;
  height: 50px;
  border-radius: 8px;
}

.title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.header-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.theme-toggle,
.favorites-toggle {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.theme-toggle:hover,
.favorites-toggle:hover {
  background: var(--accent-hover);
}

/* Search section */
.search-section {
  width: 100%;
}

.search-box {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.search-box:focus {
  border-color: var(--accent-color);
}

.search-box::placeholder {
  color: var(--text-secondary);
}

/* Main content */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Stats bar */
.stats-bar {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-color);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow);
  transform: translateY(150%);
  transition: transform 0.3s ease;
  z-index: 1000;
  border: 1px solid var(--border-color);
}

.toast.show {
  transform: translateY(0);
}

/* Terms grid */
.terms-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

/* Term card */
.term-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  cursor: pointer;
}

.term-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.term-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
  gap: 1rem;
}

.term-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
  flex: 1;
}

.term-actions {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0.25rem;
  transition: transform 0.2s;
  color: var(--text-secondary);
}

.icon-btn:hover {
  transform: scale(1.2);
}

.favorite-btn.active {
  color: var(--favorite-active);
}

.share-btn {
  color: var(--accent-color);
}

.term-definition {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.term-explanation {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.term-humor {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent-color);
  border-radius: 4px;
}

.term-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: lowercase;
}

.term-see-also {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.term-see-also strong {
  color: var(--accent-color);
}

/* Expanded state */
.term-card.expanded .term-explanation,
.term-card.expanded .term-humor,
.term-card.expanded .term-see-also {
  display: block;
}

.term-card:not(.expanded) .term-explanation,
.term-card:not(.expanded) .term-humor,
.term-card:not(.expanded) .term-see-also {
  display: none;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty-state-text {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 4rem 2rem;
  font-size: 1.25rem;
  color: var(--text-secondary);
}

.loading::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%,
  20% {
    content: '.';
  }
  40% {
    content: '..';
  }
  60%,
  100% {
    content: '...';
  }
}

/* Error state enhancements */
.error-state {
  max-width: 600px;
  margin: 0 auto;
}

.error-details {
  text-align: left;
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 8px;
  border-left: 4px solid #ef4444;
}

.error-details p {
  margin-bottom: 0.75rem;
}

.troubleshooting-list {
  list-style: none;
  padding-left: 0;
  margin: 0.5rem 0;
}

.troubleshooting-list li {
  padding: 0.5rem 0 0.5rem 1.5rem;
  position: relative;
  color: var(--text-secondary);
}

.troubleshooting-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent-color);
}

.error-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.retry-btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.retry-btn.primary {
  background: var(--accent-color);
  color: white;
}

.retry-btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.retry-btn.secondary {
  background: transparent;
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
}

.retry-btn.secondary:hover:not(:disabled) {
  background: var(--accent-color);
  color: white;
  transform: translateY(-2px);
}

.retry-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.error-technical {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 8px;
  text-align: left;
}

.error-technical details {
  cursor: pointer;
}

.error-technical summary {
  font-weight: 600;
  padding: 0.5rem;
  user-select: none;
}

.error-technical pre {
  margin-top: 0.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Share modal */
.share-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.share-modal.show {
  display: flex;
}

.share-modal-content {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
}

.share-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.share-modal-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  word-break: break-word;
}

.share-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.share-btn-modal {
  flex: 1;
  min-width: 120px;
  padding: 0.75rem 1rem;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.share-btn-modal:hover {
  background: var(--accent-hover);
}

.close-modal {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.close-modal:hover {
  background: var(--border-color);
}

/* Responsive design */
@media (max-width: 768px) {
  .header {
    padding: 1rem;
  }

  .header-top {
    flex-direction: column;
    align-items: stretch;
  }

  .logo-section {
    justify-content: center;
  }

  .header-controls {
    justify-content: center;
  }

  .container {
    padding: 1rem;
  }

  .terms-grid {
    grid-template-columns: 1fr;
  }

  .stats-bar {
    gap: 1rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .toast {
    right: 1rem;
    left: 1rem;
    bottom: 1rem;
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 1.25rem;
  }

  .subtitle {
    font-size: 0.75rem;
  }

  .term-title {
    font-size: 1.25rem;
  }

  .theme-toggle,
  .favorites-toggle {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .header-controls,
  .term-actions,
  .share-modal,
  .toast {
    display: none !important;
  }

  .term-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* Update notification banner */
.update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

.update-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.update-icon {
  font-size: 1.5rem;
  animation: rotate 2s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.update-text {
  font-weight: 600;
  font-size: 1rem;
}

.update-btn {
  background: white;
  color: #667eea;
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.update-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.update-btn:active {
  transform: translateY(0);
}

.update-dismiss-btn {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.2s,
    border-color 0.2s;
  padding: 0;
  line-height: 1;
}

.update-dismiss-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: white;
}

/* App footer */
.app-footer {
  margin-top: 3rem;
  padding: 2rem 1rem;
  text-align: center;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.footer-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background: var(--accent-color);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px var(--shadow);
}

.footer-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow);
}

.footer-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px var(--shadow);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.app-version {
  font-family: 'Courier New', monospace;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.footer-separator {
  color: var(--border-color);
}

.footer-link {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Adjust main container to account for footer */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: calc(100vh - 200px);
}

/* Mobile responsiveness for update banner and footer */
@media (max-width: 640px) {
  .update-banner-content {
    font-size: 0.875rem;
    padding: 0.5rem;
  }

  .update-text {
    font-size: 0.875rem;
  }

  .update-btn {
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
  }

  .footer-buttons {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }

  .footer-btn {
    width: 100%;
    max-width: 300px;
  }

  .footer-content {
    font-size: 0.75rem;
  }

  .app-footer {
    margin-top: 2rem;
    padding: 1.5rem 1rem;
  }
}

/* ========================= */
/* Term Drafter Modal Styles */
/* ========================= */

/* Drafter toggle button in header */
.drafter-toggle {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition:
    background 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}

.drafter-toggle:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.drafter-toggle:active {
  transform: translateY(0);
}

/* Drafter Modal */
.drafter-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1001;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.drafter-modal.show {
  display: flex;
}

.drafter-modal-content {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.drafter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.drafter-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.close-drafter-btn {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    color 0.2s;
}

.close-drafter-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* Drafter Steps */
.drafter-steps {
  position: relative;
}

.drafter-step {
  display: none;
}

.drafter-step.active {
  display: block;
}

/* API Key Section */
.drafter-api-key-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.api-key-input-wrapper {
  display: flex;
  gap: 0.5rem;
}

.api-key-input-wrapper input {
  flex: 1;
}

.toggle-key-btn {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition:
    background-color 0.2s,
    border-color 0.2s;
}

.toggle-key-btn:hover {
  background: var(--border-color);
  border-color: var(--accent-color);
}

.api-key-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.api-key-hint a {
  color: var(--accent-color);
  text-decoration: none;
}

.api-key-hint a:hover {
  text-decoration: underline;
}

/* Form Labels */
.drafter-step label {
  display: block;
  margin: 1rem 0 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.drafter-step label:first-child {
  margin-top: 0;
}

/* Form Inputs */
.drafter-step input,
.drafter-step textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.drafter-step input:focus,
.drafter-step textarea:focus {
  border-color: var(--accent-color);
  outline: none;
}

.drafter-step input::placeholder,
.drafter-step textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* YAML Editor */
.yaml-editor {
  font-family: 'Courier New', Consolas, Monaco, monospace;
  min-height: 350px;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre;
  resize: vertical;
}

/* Term Preview */
.term-preview {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border-left: 4px solid var(--accent-color);
}

.term-preview h3 {
  color: var(--accent-color);
  font-size: 1.25rem;
  margin: 0 0 0.75rem 0;
}

.term-preview p {
  color: var(--text-primary);
  margin: 0.5rem 0;
  line-height: 1.6;
}

.term-preview .preview-label {
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

.term-preview .preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.term-preview .preview-tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Drafter Buttons */
.drafter-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.primary-btn {
  flex: 1;
  min-width: 140px;
  padding: 0.875rem 1.5rem;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition:
    background-color 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}

.primary-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

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

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.secondary-btn {
  flex: 1;
  min-width: 120px;
  padding: 0.875rem 1.5rem;
  background: transparent;
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s,
    transform 0.2s;
}

.secondary-btn:hover:not(:disabled) {
  background: var(--accent-color);
  color: white;
  transform: translateY(-2px);
}

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

.back-btn {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.back-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Generating State */
.generating {
  position: relative;
}

.generating::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

/* Mobile Responsiveness for Drafter */
@media (max-width: 640px) {
  .drafter-modal-content {
    padding: 1.5rem;
    max-height: 90vh;
  }

  .drafter-header h2 {
    font-size: 1.25rem;
  }

  .drafter-actions {
    flex-direction: column;
  }

  .primary-btn,
  .secondary-btn {
    min-width: unset;
  }

  .yaml-editor {
    min-height: 250px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .drafter-toggle {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
  }

  .drafter-modal {
    padding: 0.5rem;
  }

  .drafter-modal-content {
    padding: 1rem;
  }

  .drafter-step input,
  .drafter-step textarea {
    font-size: 16px; /* Prevent zoom on iOS */
  }
}
