/* ========================================================================
   SKU Image Generator — Design System & Styles
   Premium dark theme with glassmorphism, gradients, micro-animations
   ======================================================================== */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  /* Core palette */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a2e;
  --bg-card: rgba(22, 22, 36, 0.65);
  --bg-card-hover: rgba(30, 30, 50, 0.75);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

  /* Accent gradients */
  --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
  --gradient-hover: linear-gradient(135deg, #818cf8, #a78bfa, #c084fc);
  --gradient-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
  --gradient-mesh: radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
                   radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
                   radial-gradient(ellipse at 50% 80%, rgba(236, 72, 153, 0.04) 0%, transparent 50%);

  /* Text */
  --text-primary: #f1f1f6;
  --text-secondary: #a0a0b8;
  --text-muted: #6b6b80;
  --text-accent: #a78bfa;

  /* Status */
  --success: #34d399;
  --error: #f87171;
  --warning: #fbbf24;

  /* Sizing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Reset ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ---- Background Mesh ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--gradient-mesh);
  pointer-events: none;
  z-index: 0;
}

/* ---- Animated Background Orbs ---- */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 20s ease-in-out infinite;
}

.bg-orb--1 {
  width: 400px;
  height: 400px;
  background: rgba(99, 102, 241, 0.15);
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.bg-orb--2 {
  width: 300px;
  height: 300px;
  background: rgba(168, 85, 247, 0.12);
  bottom: -50px;
  right: -50px;
  animation-delay: -7s;
}

.bg-orb--3 {
  width: 250px;
  height: 250px;
  background: rgba(236, 72, 153, 0.08);
  top: 50%;
  left: 60%;
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(15px, 35px) scale(1.02); }
}

/* ---- Layout ---- */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Header ---- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header__logo {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.header__title {
  font-size: 18px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.header__subtitle {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 500;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- Icon Buttons ---- */
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  font-size: 18px;
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.icon-btn--active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--text-accent);
  border-color: rgba(99, 102, 241, 0.3);
}

/* ---- Main Content ---- */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px 80px;
  gap: 32px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

/* ---- Hero Section ---- */
.hero {
  text-align: center;
  margin-bottom: 8px;
  animation: fadeInUp 600ms ease-out;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--text-accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero__badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}

.hero__heading {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.8px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__heading span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__sub {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
  font-weight: 400;
}

/* ---- Generator Card ---- */
.generator {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--glass-shadow);
  animation: fadeInUp 600ms ease-out 100ms both;
}

.generator__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.generator__label-icon {
  font-size: 16px;
}

/* ---- Textarea ---- */
.prompt-area {
  position: relative;
  width: 100%;
}

.prompt-area__input {
  width: 100%;
  min-height: 120px;
  max-height: 300px;
  resize: vertical;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  transition: all var(--transition-base);
  outline: none;
}

.prompt-area__input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.prompt-area__input:focus {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.prompt-area__char-count {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  pointer-events: none;
}

/* ---- Action Bar ---- */
.action-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---- Category Dropdown ---- */
.category-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}

.category-field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.category-field__select-wrap {
  position: relative;
}

.category-field__select {
  width: 100%;
  padding: 12px 40px 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: all var(--transition-base);
}

.category-field__select:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

.category-field__select:focus {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.category-field__select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 10px;
}

.category-field__arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.category-field__select:focus + .category-field__arrow {
  color: var(--text-accent);
}

/* ---- Primary Button ---- */
.btn-generate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--gradient-primary);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.btn-generate::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-hover);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.btn-generate:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.btn-generate:hover::before {
  opacity: 1;
}

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

.btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-generate__text {
  position: relative;
  z-index: 1;
}

.btn-generate__icon {
  position: relative;
  z-index: 1;
  font-size: 16px;
}

/* ---- Loading State ---- */
.btn-generate--loading .btn-generate__icon {
  animation: spin 1s linear infinite;
}

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

/* ---- Result Section ---- */
.result {
  width: 100%;
  animation: fadeInUp 400ms ease-out;
}

.result--hidden {
  display: none;
}

.result__card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--glass-shadow);
}

.result__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.result__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.result__title-icon {
  font-size: 18px;
}

.result__actions {
  display: flex;
  gap: 8px;
}

.result__action-btn {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.result__action-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-accent);
  border-color: rgba(99, 102, 241, 0.25);
  transform: translateY(-1px);
}

.result__action-btn--download {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.2);
  color: var(--success);
}

.result__action-btn--download:hover {
  background: rgba(52, 211, 153, 0.2);
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.35);
}

/* ---- Image Display ---- */
.result__image-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.result__image {
  max-width: 100%;
  max-height: 600px;
  object-fit: contain;
  border-radius: var(--radius-md);
  animation: imageReveal 500ms ease-out;
}

@keyframes imageReveal {
  from {
    opacity: 0;
    transform: scale(0.95);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

/* ---- Loading Overlay ---- */
.loading-overlay {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  animation: fadeInUp 400ms ease-out;
}

.loading-overlay--hidden {
  display: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--glass-border);
  border-top-color: #8b5cf6;
  animation: spin 0.8s linear infinite;
  margin-bottom: 20px;
}

.loading-overlay__text {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.loading-overlay__subtext {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ---- Shimmer Loader (skeleton) ---- */
.loading-shimmer {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.03) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Error State ---- */
.error-msg {
  width: 100%;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.2);
  color: var(--error);
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: shakeIn 400ms ease-out;
}

.error-msg--hidden {
  display: none;
}

.error-msg__icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.error-msg__text {
  flex: 1;
  line-height: 1.5;
}

.error-msg__dismiss {
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
  font-size: 16px;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
  flex-shrink: 0;
}

.error-msg__dismiss:hover {
  opacity: 1;
}

@keyframes shakeIn {
  0% { opacity: 0; transform: translateX(-8px); }
  40% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* ---- Settings Panel (Slide-in) ---- */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.settings-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--glass-border);
  z-index: 201;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.settings-panel--visible {
  transform: translateX(0);
}

.settings-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-border);
}

.settings-panel__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-panel__close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition-fast);
}

.settings-panel__close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.settings-panel__body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---- Settings Fields ---- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.field__hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.field__input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  outline: none;
  transition: all var(--transition-base);
}

.field__input:focus {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.field__status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

.field__status--saved {
  color: var(--success);
}

.field__status--unsaved {
  color: var(--warning);
}

/* ---- Save Button ---- */
.btn-save {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--gradient-primary);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  align-self: flex-start;
}

.btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

/* ---- Toast Notification ---- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-spring);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast--success {
  border-color: rgba(52, 211, 153, 0.3);
}

.toast--error {
  border-color: rgba(248, 113, 113, 0.3);
}

/* ---- Animations ---- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .header {
    padding: 12px 16px;
  }

  .header__subtitle {
    display: none;
  }

  .main {
    padding: 24px 16px 60px;
    gap: 24px;
  }

  .generator {
    padding: 20px;
    border-radius: var(--radius-lg);
  }

  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .category-field {
    min-width: unset;
  }

  .btn-generate {
    width: 100%;
    justify-content: center;
  }

  .result__card {
    padding: 16px;
    border-radius: var(--radius-lg);
  }

  .result__header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .result__actions {
    width: 100%;
  }

  .result__action-btn {
    flex: 1;
    justify-content: center;
  }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ---- Selection ---- */
::selection {
  background: rgba(139, 92, 246, 0.3);
  color: white;
}

/* ---- History Section ---- */
.history {
  width: 100%;
  animation: fadeInUp 600ms ease-out 200ms both;
}

.history--hidden {
  display: none;
}

.history__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.history__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.history__clear-btn {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.history__clear-btn:hover {
  background: rgba(248, 113, 113, 0.1);
  color: var(--error);
  border-color: rgba(248, 113, 113, 0.25);
}

.history__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.history__item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  transition: all var(--transition-base);
}

.history__item:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.history__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history__item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  display: flex;
  align-items: flex-end;
  padding: 8px;
}

.history__item:hover .history__item-overlay {
  opacity: 1;
}

.history__item-prompt {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
