/* ===== JT Media Brand ===== */
:root {
  --black: #111111;
  --white: #FFFFFF;
  --green: #A8D570;
  --green-dark: #8BBF52;
  --green-glow: rgba(168, 213, 112, 0.25);
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #E5E5E5;
  --gray-300: #D4D4D4;
  --gray-400: #A3A3A3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;
  --danger: #EF4444;
  --danger-soft: #FEE2E2;
  --success: #22C55E;
  --blue-link: #1a0dab;
  --green-url: #006621;
  --radius: 12px;
  --radius-lg: 16px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-50);
  color: var(--black);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== Progress Bar ===== */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 12px 20px 8px;
}

.progress-track {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  width: 0%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--gray-400);
}

.progress-labels span.active {
  color: var(--black);
  font-weight: 600;
}

.progress-labels span.done {
  color: var(--green-dark);
}

/* ===== Container ===== */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 16px 60px;
}

.progress-bar:not(.hidden) ~ .container {
  padding-top: 80px;
}

/* ===== Screens ===== */
.screen {
  display: none;
  animation: fadeSlideIn 0.4s ease;
}

.screen.active { display: block; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Cards ===== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
  border: 1px solid var(--gray-100);
}

/* ===== Welcome Screen ===== */
.welcome-card {
  text-align: center;
  padding: 40px 24px;
}

.brand-badge {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--gray-500);
  font-weight: 500;
  margin-bottom: 16px;
}

.intro {
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Forms ===== */
.form-group {
  text-align: left;
  margin-bottom: 20px;
  width: 100%;
}

.form-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--gray-700);
}

input, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.95rem;
  color: var(--black);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}

input::placeholder, textarea::placeholder {
  color: var(--gray-400);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

textarea { resize: vertical; }

.char-count {
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--gray-400);
}

.char-count.warn { color: var(--danger); font-weight: 600; }

/* ===== Buttons ===== */
.btn-primary {
  display: block;
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius);
  background: var(--green);
  color: var(--black);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--transition), transform 0.1s ease, box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
  background: var(--green-dark);
  box-shadow: 0 4px 14px rgba(168, 213, 112, 0.35);
}

.btn-primary:active { transform: scale(0.97); }

.btn-primary:disabled {
  background: var(--gray-200);
  color: var(--gray-400);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  display: block;
  padding: 16px 24px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-600);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}

.btn-secondary:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
  color: var(--black);
}

.step-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

.step-actions .btn-secondary { flex: 0 0 auto; }
.step-actions .btn-primary { flex: 1; }

/* ===== Step Header ===== */
.step-header { margin-bottom: 24px; }

.step-badge {
  display: inline-block;
  background: var(--green);
  color: var(--black);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.step-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.step-desc {
  color: var(--gray-500);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ===== Tip Box ===== */
.tip-box {
  display: flex;
  gap: 12px;
  background: #F0F9E8;
  border: 1px solid #D4EDBC;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 24px;
}

.tip-icon { font-size: 1.3rem; flex-shrink: 0; }

.tip-box strong {
  font-size: 0.85rem;
  display: block;
  margin-bottom: 2px;
}

.tip-box p {
  font-size: 0.83rem;
  color: var(--gray-600);
  line-height: 1.5;
  margin: 0;
}

/* ===== Business Cards Grid ===== */
.business-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (min-width: 480px) {
  .business-grid { grid-template-columns: repeat(3, 1fr); }
}

.biz-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  transition: border-color var(--transition), transform 0.15s ease, box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.biz-card:hover {
  border-color: var(--gray-300);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.biz-card.selected {
  border-color: var(--green);
  background: #F8FCF3;
  box-shadow: 0 0 0 3px var(--green-glow);
}

.biz-emoji { font-size: 2.2rem; }

.biz-name {
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

.biz-type {
  font-size: 0.72rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ===== Google Preview ===== */
.google-preview-wrapper, .ig-preview-wrapper {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-100);
}

.preview-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.google-preview {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  font-family: Arial, sans-serif;
}

.gp-url {
  font-size: 0.82rem;
  color: var(--green-url);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gp-title {
  font-size: 1.15rem;
  color: var(--blue-link);
  text-decoration: none;
  margin-bottom: 4px;
  line-height: 1.3;
  cursor: pointer;
}

.gp-title:hover { text-decoration: underline; }

.gp-desc {
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Instagram Preview ===== */
.ig-preview {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 360px;
}

.ig-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.ig-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.ig-username {
  font-size: 0.85rem;
  font-weight: 700;
}

.ig-image {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
  display: flex;
  align-items: center;
  justify-content: center;
}

.ig-image-emoji { font-size: 4rem; }

.ig-actions {
  padding: 10px 14px 6px;
  display: flex;
  gap: 16px;
  font-size: 1.3rem;
}

.ig-caption-preview {
  padding: 0 14px 6px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.ig-caption-preview strong { margin-right: 6px; }

.ig-hashtags-preview {
  padding: 0 14px 12px;
  font-size: 0.78rem;
  color: #00376b;
}

.ig-preview.small { max-width: 100%; }
.ig-preview.small .ig-image-emoji { font-size: 2.5rem; }

/* ===== Hashtag Grid ===== */
.hashtag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hashtag-chip {
  padding: 8px 14px;
  border: 2px solid var(--gray-200);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.hashtag-chip:hover { border-color: var(--gray-300); }

.hashtag-chip.selected {
  border-color: var(--green);
  background: #F0F9E8;
  color: var(--black);
  font-weight: 600;
}

.hashtag-chip.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== Keyword Grid ===== */
.keyword-counter {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: 12px;
}

.keyword-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

.keyword-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.keyword-chip .kw-icon {
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity var(--transition);
}

.keyword-chip:hover { border-color: var(--gray-300); }

.keyword-chip.selected {
  border-color: var(--green);
  background: #F0F9E8;
}

.keyword-chip.selected .kw-icon { opacity: 1; }

.keyword-chip.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== Results ===== */
.results-card { text-align: center; }

.score-display {
  margin: 20px 0 24px;
}

.score-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 6px solid var(--green);
  background: #F8FCF3;
  margin-bottom: 12px;
}

.score-number {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--black);
}

.score-label {
  font-size: 0.85rem;
  color: var(--gray-400);
  font-weight: 600;
}

.score-rating {
  font-size: 1.3rem;
  font-weight: 700;
}

/* Score breakdown */
.score-breakdown {
  text-align: left;
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
}

.score-breakdown h3 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.breakdown-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-200);
}

.breakdown-row:last-child { border-bottom: none; }

.breakdown-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.breakdown-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-700);
}

.breakdown-score {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
}

.breakdown-score.good { background: #DCFCE7; color: #166534; }
.breakdown-score.ok { background: #FEF9C3; color: #854D0E; }
.breakdown-score.bad { background: #FEE2E2; color: #991B1B; }

.breakdown-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}

.breakdown-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.breakdown-bar-fill.good { background: #22C55E; }
.breakdown-bar-fill.ok { background: #EAB308; }
.breakdown-bar-fill.bad { background: #EF4444; }

/* Mockup row */
.mockup-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 24px;
  text-align: left;
}

@media (min-width: 560px) {
  .mockup-row { grid-template-columns: 1fr 1fr; }
}

.mockup-col h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

/* AI Tips */
.ai-tips {
  text-align: left;
  background: #F0F9E8;
  border: 1px solid #D4EDBC;
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 24px;
}

.ai-tips h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.ai-tips ul {
  padding-left: 20px;
  margin: 0;
}

.ai-tips li {
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 6px;
  color: var(--gray-700);
}

.ai-tips .ai-summary {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--gray-700);
  margin-bottom: 10px;
}

.ai-tips .better-example {
  margin-top: 12px;
  padding: 12px;
  background: var(--white);
  border-radius: 8px;
  border: 1px solid #D4EDBC;
}

.ai-tips .better-example p {
  font-size: 0.83rem;
  margin-bottom: 4px;
  line-height: 1.4;
}

.ai-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  margin-bottom: 24px;
  color: var(--gray-500);
  font-size: 0.9rem;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Leaderboard */
.leaderboard-section {
  text-align: left;
  margin-bottom: 24px;
}

.leaderboard-section h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  text-align: center;
}

.leaderboard {
  background: var(--gray-50);
  border-radius: var(--radius);
  overflow: hidden;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.85rem;
}

.lb-row:last-child { border-bottom: none; }

.lb-row.highlight {
  background: #F0F9E8;
  font-weight: 700;
}

.lb-rank {
  width: 24px;
  font-weight: 700;
  text-align: center;
  color: var(--gray-400);
}

.lb-row.highlight .lb-rank { color: var(--black); }

.lb-name { flex: 1; }
.lb-score { font-weight: 700; color: var(--green-dark); }

.lb-empty {
  padding: 16px;
  text-align: center;
  color: var(--gray-400);
  font-size: 0.85rem;
}

/* ===== Utilities ===== */
.hidden { display: none !important; }

/* ===== Responsive ===== */
@media (max-width: 400px) {
  .card { padding: 20px 16px; }
  h1 { font-size: 1.6rem; }
  .step-header h2 { font-size: 1.25rem; }
  .score-circle { width: 120px; height: 120px; }
  .score-number { font-size: 2.5rem; }
}
