/* T2I Page - Left/Right split layout (light theme) */

/* Hero */
.hero {
  text-align: center;
  padding: 48px 0 32px;
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg-page) 100%);
}
.hero-title {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.hero-subtitle-big {
  font-size: 42px;
  font-weight: 800;
  background: linear-gradient(90deg, #f97316, #8b5cf6, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 14px;
  line-height: 1.2;
}
.hero-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.hero-tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.tag {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid;
}
.tag-green { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.tag-yellow { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.tag-purple { background: #f5f3ff; color: #7c3aed; border-color: #ddd6fe; }
.tag-red { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.tag-pink { background: #fdf2f8; color: #db2777; border-color: #fbcfe8; }

/* Section */
.section-heading { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 24px; color: var(--text); }
.generate-section { padding: 32px 0 48px; }

/* Main generate card - left/right split */
.generate-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 420px 1fr;
  overflow: hidden;
  max-width: 1000px;
  margin: 0 auto;
}

/* Left panel */
.gen-left {
  padding: 28px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

/* Inspiration thumbnails */
.inspiration-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.inspiration-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
}
.inspiration-grid img:hover {
  transform: scale(1.05);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(249,115,22,0.2);
}

/* Options row */
.options-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Generate button area */
.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.captcha-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--primary);
  cursor: pointer;
  user-select: none;
  font-family: 'Courier New', monospace;
}
.captcha-refresh {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.captcha-refresh:hover { border-color: var(--primary); color: var(--primary); }

.gen-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-generate {
  flex: 1;
  padding: 13px 24px;
  font-size: 14px;
  letter-spacing: 0.3px;
  border-radius: 8px;
  position: relative;
  overflow: visible;
}
.btn-generate .free-badge {
  position: absolute;
  top: -10px;
  left: -6px;
  background: #10b981;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1.4;
  box-shadow: 0 2px 4px rgba(16,185,129,0.3);
}
.btn-reset {
  padding: 13px 20px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 500;
}
.btn-reset:hover { border-color: var(--primary); color: var(--primary); }

/* Usage bar */
.usage-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.usage-progress {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}
.usage-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s;
}

/* Right panel - preview */
.gen-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  position: relative;
  overflow: hidden;
}
.preview-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;  /* needed for gen-loading absolute positioning */
}
.preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.preview-placeholder {
  text-align: center;
  color: var(--text-muted);
}
.preview-placeholder .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.preview-placeholder p { font-size: 14px; }

.result-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  z-index: 5;
}
.result-actions .btn-outline {
  background: rgba(255,255,255,0.9);
  border-color: transparent;
  color: #1e293b;
  font-weight: 600;
}
.elapsed { font-size: 13px; color: rgba(255,255,255,0.9); }

/* Gallery below */
.gallery-section { padding: 48px 0; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 1000px;
  margin: 0 auto;
}
.gallery-item {
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
  aspect-ratio: 1;
  box-shadow: var(--shadow);
}
.gallery-item:hover { transform: scale(1.03); box-shadow: var(--shadow-lg); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }

/* Models */
.models-section { padding: 48px 0; }
.models-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-width: 1000px;
  margin: 0 auto;
}
.model-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); position: relative;
}
.model-badge { position: absolute; top: 14px; right: 14px; padding: 3px 8px; border-radius: 10px; font-size: 10px; font-weight: 700; }
.model-badge.free { background: #ecfdf5; color: #10b981; }
.model-card h4 { font-size: 15px; margin-bottom: 6px; }
.model-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 10px; }
.model-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.model-tags span { padding: 2px 7px; background: var(--bg-input); border-radius: 5px; font-size: 10px; color: var(--text-muted); }

/* Footer */
.footer { padding: 28px 0; text-align: center; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }

/* Pricing */
.pricing-section { padding: 60px 0; background: var(--bg-page); }
.pricing-subtitle { text-align: center; color: var(--text-secondary); font-size: 15px; margin-top: -12px; margin-bottom: 6px; }
.pricing-hint { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 32px; }
.text-gradient {
  background: linear-gradient(90deg, #f97316, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto;
}
.pricing-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 24px 20px 20px;
  text-align: left;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pricing-card.popular { border-color: #10b981; box-shadow: 0 0 0 1px #10b981, var(--shadow-lg); }
.pricing-card.vip { border-color: #8b5cf6; }
.pricing-card.plus { border-color: #f59e0b; background: linear-gradient(180deg, #fffbeb 0%, #fff 30%); }

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #10b981;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 12px;
}

.pricing-icon { font-size: 26px; margin-bottom: 6px; }
.pricing-tier { font-size: 12px; font-weight: 700; color: var(--primary); letter-spacing: 1px; margin-bottom: 2px; }
.pricing-price { font-size: 32px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.pricing-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

.pricing-features {
  list-style: none;
  margin-bottom: 16px;
  flex: 1;
}
.pricing-features li {
  padding: 5px 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.pricing-features li.yes::before { content: '✓ '; color: #10b981; font-weight: 700; }
.pricing-features li.no::before { content: '✗ '; color: var(--text-muted); }
.pricing-features li.no { color: var(--text-muted); }

.pricing-btn {
  width: 100%;
  padding: 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  transition: all 0.2s;
  margin-top: auto;
}
.pricing-btn:hover { border-color: var(--primary); color: var(--primary); }
.pricing-btn.btn-member {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}
.pricing-btn.btn-member:hover { background: #059669; }
.pricing-btn.btn-vip {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  cursor: pointer;
  border-color: #8b5cf6;
  box-shadow: 0 4px 14px rgba(139,92,246,0.35);
}
.pricing-btn.btn-vip:hover:not(:disabled) {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  box-shadow: 0 6px 20px rgba(139,92,246,0.5);
  transform: translateY(-1px);
}
.pricing-btn.btn-plus {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  cursor: pointer;
  border-color: #f59e0b;
  box-shadow: 0 4px 14px rgba(245,158,11,0.35);
}
.pricing-btn.btn-plus:hover:not(:disabled) {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 6px 20px rgba(245,158,11,0.5);
  transform: translateY(-1px);
}

.pricing-btn.btn-vip:disabled,
.pricing-btn.btn-plus:disabled {
  opacity: 0.5;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

@media (max-width: 768px) {
  .pricing-grid { grid-template-columns: 1fr 1fr; max-width: 600px; }
}
@media (max-width: 500px) {
  .pricing-grid { grid-template-columns: 1fr; max-width: 320px; }
}

.hidden { display: none !important; }

@media (max-width: 860px) {
  .generate-card { grid-template-columns: 1fr; }
  .gen-left { border-right: none; border-bottom: 1px solid var(--border); }
  .gen-right { min-height: 300px; }
}


/* ===== Loading Animation - Light theme ===== */
.gen-loading {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #fff7ed 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3;
}
.gen-loading .particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  animation: float-light 8s infinite ease-in-out;
}
.gen-loading .particle:nth-child(1) { width:40px;height:40px;background:rgba(249,115,22,0.1);top:15%;left:10%;animation-delay:0s; }
.gen-loading .particle:nth-child(2) { width:60px;height:60px;background:rgba(99,102,241,0.08);top:60%;left:15%;animation-delay:1.5s; }
.gen-loading .particle:nth-child(3) { width:50px;height:50px;background:rgba(16,185,129,0.08);top:25%;left:70%;animation-delay:3s; }
.gen-loading .particle:nth-child(4) { width:35px;height:35px;background:rgba(249,115,22,0.12);top:70%;left:75%;animation-delay:0.8s; }
.gen-loading .particle:nth-child(5) { width:45px;height:45px;background:rgba(6,182,212,0.08);top:80%;left:45%;animation-delay:2s; }
.gen-loading .particle:nth-child(6) { width:30px;height:30px;background:rgba(139,92,246,0.1);top:10%;left:55%;animation-delay:4s; }
.gen-loading .particle:nth-child(7) { width:25px;height:25px;background:rgba(249,115,22,0.08);top:45%;left:85%;animation-delay:1s; }
.gen-loading .particle:nth-child(8) { width:55px;height:55px;background:rgba(16,185,129,0.06);top:50%;left:30%;animation-delay:2.5s; }

@keyframes float-light {
  0%, 100% { transform: translateY(0) translateX(0) scale(1); }
  33% { transform: translateY(-20px) translateX(10px) scale(1.1); }
  66% { transform: translateY(10px) translateX(-15px) scale(0.9); }
}

.gen-loading .center-ring {
  position: relative;
  width: 90px;
  height: 90px;
  z-index: 2;
}
.gen-loading .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(249,115,22,0.15);
  animation: pulse-ring-light 2.5s infinite ease-out;
}
.gen-loading .ring:nth-child(2) { inset: -12px; animation-delay: 0.5s; border-color: rgba(249,115,22,0.1); }
.gen-loading .ring:nth-child(3) { inset: -24px; animation-delay: 1s; border-color: rgba(249,115,22,0.05); }
.gen-loading .core {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f97316, #fb923c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 20px rgba(249,115,22,0.3);
  animation: breathe 2s infinite ease-in-out;
}
@keyframes pulse-ring-light {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(249,115,22,0.3); }
  50% { transform: scale(1.08); box-shadow: 0 6px 30px rgba(249,115,22,0.5); }
}

.gen-loading .loading-text {
  margin-top: 24px;
  color: #64748b;
  font-size: 15px;
  font-weight: 500;
  z-index: 2;
}
.gen-loading .loading-bottom {
  position: absolute;
  bottom: 24px;
  left: 28px;
  right: 28px;
  z-index: 2;
}
.gen-loading .loading-status {
  text-align: center;
  font-size: 14px;
  color: #475569;
  font-weight: 600;
  margin-bottom: 10px;
}
.gen-loading .progress-bar {
  height: 5px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}
.gen-loading .progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #f97316, #fb923c, #f59e0b);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
  transition: width 0.5s ease;
}
@keyframes shimmer {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

/* ===== Dark theme overrides ===== */

/* Tags */
.tag-green  { background: rgba(16,185,129,0.15);  color: #34d399; border-color: rgba(16,185,129,0.3); }
.tag-yellow { background: rgba(245,158,11,0.15);  color: #fbbf24; border-color: rgba(245,158,11,0.3); }
.tag-purple { background: rgba(139,92,246,0.15);  color: #a78bfa; border-color: rgba(139,92,246,0.3); }
.tag-red    { background: rgba(239,68,68,0.15);   color: #f87171; border-color: rgba(239,68,68,0.3); }
.tag-pink   { background: rgba(249,115,22,0.15);  color: #fb923c; border-color: rgba(249,115,22,0.3); }

/* Model badge */
.model-badge.free { background: rgba(16,185,129,0.15); color: #34d399; }

/* Model card */
.model-card { background: var(--bg-card); border-color: var(--border); }
.model-card:hover { border-color: var(--primary); }
.captcha-box { background: var(--bg-input); color: var(--text); border-color: var(--border); }

/* Pricing cards */
.pricing-card { background: var(--bg-card); }
.pricing-card.plus {
  border-color: #f59e0b;
  background: linear-gradient(180deg, rgba(245,158,11,0.08) 0%, var(--bg-card) 30%);
}
.pricing-card.vip { border-color: #8b5cf6; }

/* Loading animation background */
.gen-loading {
  background: linear-gradient(135deg, var(--bg-card) 0%, #1a1f2e 50%, #1c1510 100%);
}
.gen-loading .loading-text  { color: var(--text-secondary); }
.gen-loading .loading-status { color: var(--text-secondary); }
.gen-loading .progress-bar  { background: var(--border); }

/* Generate card */
.generate-card { background: var(--bg-card); border-color: var(--border); }
.gen-left, .gen-right { background: var(--bg-card); }
.preview-box { background: var(--bg-input); border-color: var(--border); }
.preview-placeholder { color: var(--text-muted); }

/* Gallery */
.gallery-item:hover { transform: scale(1.02); }

/* Result actions */
.result-actions { background: transparent; }
.elapsed { color: var(--text-muted); }

/* Captcha refresh button */
.captcha-refresh {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--text-secondary);
}
.captcha-refresh:hover { border-color: var(--primary); color: var(--primary); }

/* Usage bar */
.usage-bar { color: var(--text-muted); }
.usage-progress { background: var(--border); }

/* Inspiration grid item text */
.inspiration-grid span { background: rgba(0,0,0,0.5) !important; }

/* Btn reset */
.btn-reset {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-reset:hover { border-color: var(--primary); color: var(--primary); }

/* Section headings */
.section-heading { color: var(--text); }
.text-gradient { background: linear-gradient(135deg, var(--primary), #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* Footer */
.footer { background: var(--bg); border-top: 1px solid var(--border); color: var(--text-muted); }
