/* Amazon Seller Calculator India – Plugin Stylesheet */
/* ===== CSS VARIABLES ===== */
:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text2: #475569;
  --text3: #94a3b8;
  --accent: #f97316;
  --accent2: #ea580c;
  --primary: #1e40af;
  --primary2: #1d4ed8;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --yellow: #d97706;
  --yellow-bg: #fef3c7;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 48px rgba(0,0,0,0.12), 0 8px 20px rgba(0,0,0,0.06);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font: 'Plus Jakarta Sans', sans-serif;
  --mono: 'DM Mono', monospace;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0a0f1e;
  --surface: #111827;
  --surface2: #1e293b;
  --border: #1e2d45;
  --text: #f1f5f9;
  --text2: #94a3b8;
  --text3: #475569;
  --green-bg: #052e16;
  --red-bg: #450a0a;
  --yellow-bg: #1c1400;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 48px rgba(0,0,0,0.6);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
button { cursor: pointer; font-family: var(--font); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ===== LAYOUT ===== */
.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }

/* ===== SECTION HEADERS ===== */
.section-header { text-align: center; margin-bottom: 48px; }
.section-tag {
  display: inline-block;
  background: rgba(249,115,22,0.1);
  color: var(--accent);
  border-radius: 99px;
  padding: 4px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}
.section-desc { font-size: 1rem; color: var(--text2); max-width: 560px; margin: 0 auto; }

/* ===== CALCULATOR ===== */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 28px;
  align-items: start;
}

.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.calc-card-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.calc-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.calc-card-title .dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
}
.calc-body { padding: 28px; }

/* FORM GRID */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: 0.02em;
}
.form-label span { color: var(--accent); }
.form-input, .form-select {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  transition: all var(--transition);
  outline: none;
  appearance: none;
}
.form-input:focus, .form-select:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
}
.form-input.error { border-color: var(--red); }
.input-prefix-wrap { position: relative; }
.input-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text3);
  pointer-events: none;
}
.input-prefix-wrap .form-input { padding-left: 28px; }
.input-suffix-wrap { position: relative; }
.input-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text3);
  pointer-events: none;
}
.input-suffix-wrap .form-input { padding-right: 36px; }

.select-wrap { position: relative; }
.select-wrap::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: var(--text3);
  pointer-events: none;
}

.form-hint { font-size: 0.75rem; color: var(--text3); margin-top: 2px; }
.form-error { font-size: 0.75rem; color: var(--red); margin-top: 2px; display: none; }
.form-group.has-error .form-error { display: block; }
.form-group.has-error .form-input { border-color: var(--red); }

/* CALC ACTIONS */
.calc-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.btn-calc {
  flex: 1;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
  box-shadow: 0 4px 14px rgba(249,115,22,0.3);
  min-width: 140px;
}
.btn-calc:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(249,115,22,0.4); }
.btn-reset {
  background: var(--surface2);
  color: var(--text2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
}
.btn-reset:hover { background: var(--border); color: var(--text); }
.btn-example {
  background: rgba(59,130,246,0.1);
  color: var(--primary);
  border: 1.5px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
}
.btn-example:hover { background: rgba(59,130,246,0.15); }

/* RESULTS PANEL */
.results-panel { position: sticky; top: 80px; }
.results-empty {
  padding: 60px 28px;
  text-align: center;
  color: var(--text3);
}
.results-empty .empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.4; }
.results-empty p { font-size: 0.88rem; }

.result-summary {
  padding: 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.profit-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.profit-badge {
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.profit-badge.profit { background: var(--green-bg); color: var(--green); }
.profit-badge.loss { background: var(--red-bg); color: var(--red); }

.profit-amount {
  font-size: 2.4rem;
  font-weight: 800;
  font-family: var(--mono);
  line-height: 1;
}
.profit-amount.profit { color: var(--green); }
.profit-amount.loss { color: var(--red); }
.profit-label { font-size: 0.8rem; color: var(--text3); margin-top: 4px; }

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}
.metric-card {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.metric-val {
  font-size: 1.3rem;
  font-weight: 800;
  font-family: var(--mono);
  color: var(--text);
}
.metric-val.green { color: var(--green); }
.metric-val.red { color: var(--red); }
.metric-val.orange { color: var(--accent); }
.metric-label { font-size: 0.72rem; color: var(--text3); margin-top: 2px; }

/* FEE BREAKDOWN TABLE */
.fee-table-wrap { padding: 0 28px 24px; overflow-x: auto; }
.fee-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.fee-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
}
.fee-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  font-weight: 500;
}
.fee-table td:last-child { text-align: right; font-family: var(--mono); font-weight: 700; color: var(--text); }
.fee-table tr:last-child td { border-bottom: none; }
.fee-table .total-row td { background: var(--surface2); font-weight: 700; color: var(--text); }
.fee-table .total-row td:last-child { color: var(--red); }
.fee-table .profit-row td { background: var(--green-bg); color: var(--green); font-weight: 700; }
.fee-table .profit-row td:last-child { color: var(--green); }

/* RESULT ACTIONS */
.result-actions {
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-action {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition);
  min-width: 0;
}
.btn-action:hover { background: var(--border); color: var(--text); }
.btn-action.primary {
  background: var(--green-bg);
  color: var(--green);
  border-color: rgba(22,163,74,0.2);
}
.btn-action.primary:hover { background: #bbf7d0; }

/* PROGRESS BAR BREAKDOWN */
.breakdown-bars { padding: 16px 28px; border-top: 1px solid var(--border); }
.breakdown-title { font-size: 0.78rem; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.bar-item { margin-bottom: 10px; }
.bar-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 5px;
}
.bar-label { color: var(--text2); font-weight: 500; }
.bar-value { font-family: var(--mono); font-weight: 700; color: var(--text); }
.bar-track {
  height: 6px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.bar-fill.cost { background: #3b82f6; }
.bar-fill.fee { background: #f97316; }
.bar-fill.profit { background: #16a34a; }
.bar-fill.loss { background: #dc2626; }

/* ===== REVERSE CALCULATOR ===== */
.reverse-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.reverse-header {
  padding: 24px 28px 20px;
  background: linear-gradient(135deg, #1e3a8a, #1e40af);
  color: white;
}
.reverse-header h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.reverse-header p { font-size: 0.85rem; color: rgba(255,255,255,0.7); }
.reverse-body { padding: 28px; }
.reverse-form { display: flex; flex-direction: column; gap: 16px; }
.reverse-result {
  background: var(--green-bg);
  border: 1px solid rgba(22,163,74,0.2);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  display: none;
}
.reverse-result.show { display: block; }
.reverse-result-label { font-size: 0.8rem; color: var(--green); font-weight: 600; margin-bottom: 8px; }
.reverse-result-val { font-size: 2rem; font-weight: 800; font-family: var(--mono); color: var(--green); }
.reverse-result-sub { font-size: 0.78rem; color: var(--text2); margin-top: 6px; }

/* ===== FEE REFERENCE TABLE ===== */
.fee-reference {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.fee-ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.fee-ref-table thead th {
  background: var(--surface2);
  padding: 14px 20px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  border-bottom: 2px solid var(--border);
}
.fee-ref-table tbody td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  font-weight: 500;
}
.fee-ref-table tbody tr:hover td { background: var(--surface2); }
.fee-ref-table tbody tr:last-child td { border-bottom: none; }
.fee-ref-table .fee-pct {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
}
.fee-ref-table .closing {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--primary);
}

/* ===== FAQ ===== */
.faq-list { max-width: 820px; margin: 0 auto; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.faq-item:hover { box-shadow: var(--shadow); }
.faq-q {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  gap: 16px;
  user-select: none;
}
.faq-icon {
  width: 28px; height: 28px;
  background: var(--surface2);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: all var(--transition);
  color: var(--text2);
}
.faq-item.open .faq-icon {
  background: var(--accent);
  color: white;
  transform: rotate(45deg);
}
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-a-inner {
  padding: 0 24px 20px;
  font-size: 0.9rem;
  color: var(--text2);
  line-height: 1.7;
}
.faq-item.open .faq-a { max-height: 400px; }

/* ===== CONTENT SECTION ===== */
.content-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow);
}
.content-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  margin-top: 32px;
}
.content-section h2:first-child { margin-top: 0; }
.content-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 10px;
}
.content-section p {
  font-size: 0.95rem;
  color: var(--text2);
  line-height: 1.8;
  margin-bottom: 14px;
}
.content-section ul {
  margin: 10px 0 16px 20px;
  color: var(--text2);
  font-size: 0.95rem;
  line-height: 1.8;
}
.content-section ul li { margin-bottom: 6px; }
.content-section strong { color: var(--text); }

/* TIPS GRID */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 8px;
}
.tip-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: all var(--transition);
}
.tip-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); }
.tip-icon { font-size: 1.6rem; margin-bottom: 10px; }
.tip-title { font-weight: 700; font-size: 0.95rem; color: var(--text); margin-bottom: 6px; }
.tip-desc { font-size: 0.85rem; color: var(--text2); line-height: 1.6; }

/* ===== STICKY MOBILE BAR ===== */
.sticky-mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99;
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  gap: 10px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 80px;
  right: 20px;
  background: var(--text);
  color: var(--surface);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 200;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ===== ANIMATIONS ===== */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeIn 0.4s ease both; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; }
  .calc-layout { grid-template-columns: 1fr; }
  .results-panel { position: static; }
  .sticky-mobile-bar { display: flex; }
  .calc-actions .btn-calc { display: none; }
  .section { padding: 60px 0; }
  .content-section { padding: 32px 24px; }
}
@media (max-width: 600px) {
  .hero { padding: 60px 0 48px; }
  .hero h1 { font-size: 1.8rem; }
  .hero-stats { grid-template-columns: 1fr 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: 1; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .features-list { justify-content: flex-start; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; }
  .hero-card { padding: 20px; }
}

/* ===== TOOLTIP ===== */
[data-tip] { position: relative; cursor: help; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
}
[data-tip]:hover::after { opacity: 1; }

/* ===== LIVE INDICATOR ===== */
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--green);
}
.live-dot::before {
  content: '';
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ===== TABS ===== */
.tab-bar {
  display: flex;
  background: var(--surface2);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 24px;
}
.tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
  transition: all var(--transition);
}
.tab-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }

/* Saved state indicator */
.saved-indicator {
  font-size: 0.75rem;
  color: var(--green);
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 4px;
}
.saved-indicator.show { display: flex; }
