/* ============================================================
   ShopWrite AI — style.css
   Palette: Deep Teal + Saffron + Warm Cream
   Fonts: Playfair Display + Plus Jakarta Sans
   Aesthetic: Modern Indian marketplace — warm, vibrant, trustworthy
   ============================================================ */

:root {
  --teal:        #14b8a6;
  --teal-mid:    #0d9488;
  --teal-light:  #0f766e;
  --teal-pale:   rgba(20, 184, 166, 0.15);
  --saffron:     #fbbf24;
  --saffron-lt:  #fcd34d;
  --saffron-pale:rgba(251, 191, 36, 0.15);
  --cream:       #030712;
  --cream-dark:  rgba(255, 255, 255, 0.08);
  --white:       #ffffff;
  --surface:     rgba(17, 24, 39, 0.7);
  --text:        #f9fafb;
  --text-mid:    #d1d5db;
  --text-soft:   #9ca3af;
  --border:      rgba(255, 255, 255, 0.08);
  --shadow:      0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 48px rgba(0,0,0,0.6);
  --radius:      12px;
  --radius-sm:   8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--cream-dark); }
::-webkit-scrollbar-thumb { background: var(--teal-light); border-radius: 3px; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--saffron);
}
.header-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 0.9rem; }
.brand-logo {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--saffron), var(--saffron-lt));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--teal);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--white);
  font-weight: 600;
}
.brand-name em { font-style: normal; color: var(--saffron-lt); }
.brand-sub { font-size: 0.7rem; color: rgba(255,255,255,0.5); font-weight: 300; }

.header-right { display: flex; align-items: center; gap: 1rem; }

.lang-bar { display: flex; gap: 3px; }
.lang-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6);
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: all 0.2s;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.lang-btn:hover { border-color: var(--saffron-lt); color: var(--saffron-lt); }
.lang-btn.active { background: var(--saffron); border-color: var(--saffron); color: var(--teal); }

.home-btn {
  display: flex; align-items: center;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.65);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}
.home-btn:hover { border-color: var(--saffron); color: var(--saffron-lt); }

.api-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.8);
  border-radius: var(--radius-sm);
  padding: 7px 15px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}
.api-btn:hover { background: rgba(255,255,255,0.14); color: var(--saffron-lt); border-color: var(--saffron); }

/* ============================================================
   HERO STRIP
   ============================================================ */
.hero-strip {
  background: transparent;
  padding: 1.8rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.hero-inner { max-width: 600px; }
.hero-inner h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--white);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.4rem;
}
.hero-inner p { font-size: 0.88rem; color: rgba(255,255,255,0.65); font-weight: 300; }
.hero-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.badge {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.9);
  border-radius: 30px;
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.app-body {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 1.5rem;
  flex: 1;
  max-width: 1380px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem;
  align-items: start;
}

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.8rem;
  box-shadow: var(--shadow);
}
.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--teal);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--saffron);
}

/* ============================================================
   FORM FIELDS
   ============================================================ */
.field-group { margin-bottom: 1.2rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; margin-bottom: 1.2rem; }
.field-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-mid);
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.field-input {
  width: 100%;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.62rem 0.9rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.87rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: none;
  appearance: none;
}
.field-input:focus {
  border-color: var(--teal-light);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
  background: rgba(255,255,255,0.05);
}

/* CATEGORY GRID */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.cat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0.6rem 0.3rem;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-mid);
  text-align: center;
  user-select: none;
}
.cat-chip .cat-icon { font-size: 1.3rem; line-height: 1; }
.cat-chip:hover { border-color: var(--teal-light); color: var(--teal); background: var(--teal-pale); }
.cat-chip.active {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
}

/* TONE CHIPS */
.tone-group { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.tone-chip {
  display: flex; align-items: center; gap: 5px;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: 30px;
  padding: 5px 14px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-mid);
  transition: all 0.18s;
}
.tone-chip:has(input:checked) {
  background: var(--saffron);
  border-color: var(--saffron);
  color: var(--white);
}
.tone-chip input { display: none; }

/* GENERATE BUTTON */
.generate-btn {
  width: 100%;
  padding: 0.95rem;
  background: linear-gradient(135deg, var(--teal), var(--teal-mid));
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  cursor: pointer;
  margin-top: 0.5rem;
  box-shadow: 0 4px 18px rgba(13,79,79,0.3);
  position: relative;
  overflow: hidden;
  transition: all 0.25s;
}
.generate-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--saffron), var(--saffron-lt));
  opacity: 0;
  transition: opacity 0.3s;
}
.generate-btn span { position: relative; z-index: 1; }
.generate-btn:hover::before { opacity: 1; }
.generate-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(13,79,79,0.35); }
.generate-btn:active { transform: translateY(0); }
.generate-btn:disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

.warn-box {
  margin-top: 0.8rem;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  font-size: 0.8rem;
  color: var(--saffron-lt);
}
.error-box {
  margin-top: 0.8rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  font-size: 0.8rem;
  color: #fca5a5;
}
.hidden { display: none !important; }

/* ============================================================
   OUTPUT AREA
   ============================================================ */
.output-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 400px; text-align: center; gap: 1.2rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  padding: 3rem 2rem;
}
.ph-illustration { display: flex; gap: 10px; margin-bottom: 0.5rem; }
.ph-box {
  border-radius: 8px;
  background: var(--cream-dark);
  animation: phPulse 1.8s ease-in-out infinite;
}
.ph-b1 { width: 80px; height: 100px; animation-delay: 0s; }
.ph-b2 { width: 80px; height: 130px; animation-delay: 0.3s; }
.ph-b3 { width: 80px; height: 110px; animation-delay: 0.6s; }
@keyframes phPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.9; }
}
.output-placeholder h3 { font-family: 'Playfair Display', serif; font-size: 1.2rem; color: var(--text-mid); }
.output-placeholder p { font-size: 0.88rem; color: var(--text-soft); }

.output-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 400px; gap: 1.2rem;
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
}
.loader-ring {
  width: 50px; height: 50px;
  border: 4px solid var(--border);
  border-top-color: var(--teal);
  border-right-color: var(--saffron);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.output-loading p { color: var(--text-mid); font-size: 0.9rem; }

/* ============================================================
   RESULT TABS
   ============================================================ */
.result-tabs {
  display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.tab-btn {
  padding: 7px 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 30px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn:hover { border-color: var(--teal-light); color: var(--teal); }
.tab-btn.active { background: var(--teal); border-color: var(--teal); color: var(--white); }

/* ============================================================
   VARIANT CARD
   ============================================================ */
.variant-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: fadeUp 0.35s ease both;
  margin-bottom: 1rem;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.variant-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.2rem;
  background: var(--teal-pale);
  border-bottom: 1px solid var(--border);
}
.variant-label {
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem;
  color: var(--teal);
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.variant-actions { display: flex; align-items: center; gap: 0.5rem; }
.char-count {
  font-size: 0.72rem;
  color: var(--text-soft);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-weight: 600;
}
.copy-btn {
  display: flex; align-items: center; gap: 5px;
  background: var(--saffron-pale);
  border: 1.5px solid var(--saffron-lt);
  color: var(--saffron);
  border-radius: var(--radius-sm);
  padding: 5px 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.copy-btn:hover { background: var(--saffron); color: var(--white); border-color: var(--saffron); }
.copy-btn.copied { background: #e6f7ef; border-color: #4caf82; color: #1a7a4a; }

.variant-body {
  padding: 1.3rem 1.5rem;
}

/* Product name in result */
.desc-product-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--teal);
  margin-bottom: 0.5rem;
}
.desc-tagline {
  font-size: 0.88rem;
  color: var(--saffron);
  font-weight: 600;
  margin-bottom: 0.8rem;
  font-style: italic;
}
.desc-body { font-size: 0.9rem; line-height: 1.75; color: var(--text); margin-bottom: 1rem; }
.desc-features { list-style: none; padding: 0; margin-bottom: 1rem; }
.desc-features li {
  padding: 3px 0;
  font-size: 0.86rem;
  color: var(--text-mid);
  display: flex; align-items: flex-start; gap: 7px;
}
.desc-features li::before { content: '✓'; color: var(--saffron); font-weight: 700; flex-shrink: 0; }
.desc-price-row {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding-top: 0.75rem; border-top: 1px dashed var(--border);
}
.desc-price { font-size: 1.3rem; font-weight: 700; color: var(--teal); font-family: 'Playfair Display', serif; }
.desc-cta {
  background: var(--saffron);
  color: var(--white);
  border: none;
  border-radius: 30px;
  padding: 6px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: default;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.desc-meta { font-size: 0.78rem; color: var(--text-soft); }

/* ============================================================
   EXTRAS ROW (SEO + HASHTAGS)
   ============================================================ */
.extras-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.5rem;
}
.extra-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  box-shadow: var(--shadow);
}
.extra-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.85rem;
  display: flex; align-items: center; gap: 6px;
}
.seo-tags, .hash-tags {
  display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.8rem;
}
.seo-tag {
  background: var(--teal-pale);
  border: 1px solid #b2d4d4;
  color: var(--teal);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.seo-tag:hover { background: var(--teal); color: white; }
.hash-tag {
  background: var(--saffron-pale);
  border: 1px solid #f5d080;
  color: var(--saffron);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.hash-tag:hover { background: var(--saffron); color: white; }

.copy-all-btn {
  background: var(--teal-pale);
  border: 1.5px solid var(--teal-light);
  color: var(--teal);
  border-radius: var(--radius-sm);
  padding: 5px 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.2rem;
}
.copy-all-btn:hover { background: var(--teal); color: white; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(5,30,30,0.55);
  backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
}
.modal-box {
  background: var(--teal-light);
  border-radius: 16px;
  width: 440px;
  max-width: 95vw;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.modal-header {
  background: var(--teal);
  padding: 1.3rem 1.5rem;
  display: flex; align-items: center; gap: 0.9rem;
  color: var(--white);
}
.modal-header-icon { font-size: 1.4rem; }
.modal-header h2 { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 600; flex: 1; }
.modal-header p { font-size: 0.75rem; opacity: 0.6; margin-top: 2px; }
.modal-close {
  background: none; border: none; color: rgba(255,255,255,0.5);
  font-size: 1rem; cursor: pointer; border-radius: 5px; padding: 4px 6px;
  transition: all 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.15); color: white; }
.modal-body { padding: 1.6rem; }
.api-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.api-row .field-input { flex: 1; }
.eye-btn {
  background: var(--cream); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 13px;
  cursor: pointer; font-size: 1rem; transition: background 0.2s;
}
.eye-btn:hover { background: var(--cream-dark); }
.modal-hint { font-size: 0.76rem; color: var(--text-soft); margin-bottom: 1.3rem; }
.modal-btns { display: flex; gap: 0.7rem; justify-content: flex-end; }
.btn-primary {
  background: var(--teal); color: white; border: none;
  border-radius: var(--radius-sm); padding: 9px 24px;
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.88rem;
  font-weight: 700; cursor: pointer; transition: background 0.2s;
}
.btn-primary:hover { background: var(--teal-mid); }
.btn-ghost {
  background: var(--cream); color: var(--text); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 18px;
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.88rem;
  cursor: pointer; transition: background 0.2s;
}
.btn-ghost:hover { background: var(--cream-dark); }

/* ============================================================
   HISTORY
   ============================================================ */
.history-section {
  max-width: 1380px;
  margin: 0 auto;
  width: 100%;
  padding: 0 2rem 2.5rem;
}
.history-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--saffron);
}
.history-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--teal);
}
.clear-history-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  padding: 5px 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}
.clear-history-btn:hover { border-color: #ef4444; color: #fca5a5; }
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}
.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}
.history-card:hover { border-color: var(--teal-light); transform: translateY(-2px); }
.history-card-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.4rem; gap: 0.5rem;
}
.history-product {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-cat {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--teal-pale);
  color: var(--teal);
  border-radius: 20px;
  padding: 2px 9px;
  white-space: nowrap;
  flex-shrink: 0;
}
.history-meta { font-size: 0.75rem; color: var(--text-soft); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--teal);
  color: rgba(255,255,255,0.4);
  text-align: center;
  padding: 0.7rem;
  font-size: 0.76rem;
  border-top: 1px solid var(--teal-mid);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .app-body { grid-template-columns: 1fr; padding: 1.2rem; }
  .extras-row { grid-template-columns: 1fr; }
  .hero-strip { flex-direction: column; gap: 0.8rem; }
}
@media (max-width: 500px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .header-inner { padding: 0 1rem; }
}

/* Glassmorphism Overrides */
body::before {
  content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: -1;
  background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.15) 0%, transparent 40%);
}
.card, .output-placeholder, .output-loading, .variant-card, .extra-card, .modal-box, .field-input {
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
}
.output-placeholder, .output-loading { background: transparent !important; }
