/* ══════════════════════════════════════
   Shared Styles — AI Tool Hub
   ══════════════════════════════════════ */

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

:root {
  --bg-0: #fff9ef;
  --bg-1: #f8f3ea;
  --ink-0: #14120f;
  --ink-1: #49453d;
  --ink-2: #7a7468;
  --panel: rgba(255, 255, 255, 0.86);
  --line: rgba(20, 18, 15, 0.14);
  --brand: #cc4f1b;
  --brand-light: #f0ddd2;
  --brand-2: #0c6378;
  --success: #18794e;
  --warn: #9c5010;
  --error: #b42318;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 14px 45px rgba(39, 24, 14, 0.14);
  --font-main: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

/* ── RTL Support ── */
[dir="rtl"] { direction: rtl; text-align: right; }
[dir="rtl"] .tool-card, [dir="rtl"] .panel { text-align: right; }

/* ── Base ── */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  font-size: clamp(0.94rem, 1.6vw, 1.05rem);
  line-height: 1.68;
  color: var(--ink-0);
  background: var(--bg-0);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Background Orbs ── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}
.orb--warm {
  width: 240px; height: 240px;
  background: radial-gradient(circle, #f2a96e 0%, transparent 70%);
  top: -60px; left: 12%;
}
.orb--cool {
  width: 280px; height: 280px;
  background: radial-gradient(circle, #6ec5d4 0%, transparent 70%);
  bottom: 5%; right: 8%;
}

/* ── Layout ── */
.wrapper {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}

/* ── Typography ── */
h1 { font-size: clamp(1.62rem, 3.2vw, 2.44rem); line-height: 1.18; font-weight: 700; }
h2 { font-size: clamp(1.25rem, 2.4vw, 1.72rem); line-height: 1.24; font-weight: 700; }
h3 { font-size: clamp(1.02rem, 1.75vw, 1.18rem); line-height: 1.32; font-weight: 600; }
p  { margin-bottom: 0.8em; color: var(--ink-1); }
a  { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
.site-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 0 12px;
}
.logo-mark {
  width: 38px; height: 38px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.05rem;
}
.brand-text { font-weight: 700; font-size: 1.12rem; color: var(--ink-0); }
.tagline { font-size: 0.82rem; color: var(--ink-2); margin-left: auto; }

/* ── Panel (Section Container) ── */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 40px);
  margin-bottom: 28px;
  backdrop-filter: blur(6px);
  animation: rise 0.7s ease both;
}

/* ── Tool Card ── */
.tool-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: clamp(20px, 3.5vw, 32px);
  margin-top: 18px;
}
.tool-card h2 { margin-bottom: 6px; }
.tool-steps {
  list-style: none;
  display: flex; gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  font-size: 0.88rem;
  color: var(--ink-2);
}
.tool-steps li::before { content: none; }
.tool-steps li {
  background: var(--bg-1);
  padding: 4px 12px;
  border-radius: 20px;
}

/* ── File Input ── */
.file-field {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-1);
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  cursor: pointer;
  transition: border-color 0.25s;
  margin-bottom: 16px;
}
.file-field:hover { border-color: var(--brand); }
.file-field input[type="file"] { display: none; }
.file-field-label { font-size: 0.92rem; color: var(--ink-1); }

/* ── Range Slider ── */
.range-field { margin-bottom: 18px; }
.range-field label {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--ink-1);
  margin-bottom: 6px;
}
.range-field input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
  height: 6px;
}

/* ── Buttons ── */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 28px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #a63d12);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
button:hover { opacity: 0.88; transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--brand-2);
}
.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
}

/* ── Result Panel ── */
.result-panel {
  display: none;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-top: 18px;
}
.result-panel.show { display: block; }
.result-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.92rem;
}
.result-row span:last-child { font-family: var(--font-mono); font-weight: 600; }
.result-savings {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--success);
  margin: 8px 0;
}

/* ── Status Messages ── */
.status-msg { font-size: 0.88rem; margin-top: 10px; min-height: 1.4em; }
.status-ok { color: var(--success); }
.status-warn { color: var(--warn); }
.status-error { color: var(--error); }

/* ── Benefits Grid ── */
.benefit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 20px;
}
.benefit-card {
  background: var(--bg-1);
  border-radius: var(--radius-md);
  padding: 20px;
}
.benefit-card h3 { margin-bottom: 4px; }
.benefit-card p { font-size: 0.9rem; margin: 0; }

/* ── Reviews ── */
.review-list { display: grid; gap: 16px; margin-top: 16px; }
.review-card {
  background: var(--bg-1);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.review-card .reviewer {
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 4px;
}
.review-card .stars {
  color: #e8a030;
  font-size: 0.88rem;
  margin-bottom: 6px;
}
.review-card .review-text {
  font-size: 0.9rem;
  color: var(--ink-1);
  line-height: 1.6;
  margin: 0;
}

/* ── FAQ ── */
.faq-list { margin-top: 16px; }
.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-q {
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-q::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--ink-2);
  transition: transform 0.25s;
}
.faq-item.open .faq-q::after { content: "\2212"; }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  font-size: 0.9rem;
  color: var(--ink-1);
  line-height: 1.65;
}
.faq-item.open .faq-a { max-height: 300px; padding-top: 10px; }

/* ── Ad Slots ── */
.ad-slot {
  min-height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 18px 0;
}
.ad-slot:empty {
  background: repeating-linear-gradient(
    135deg,
    transparent, transparent 10px,
    rgba(0,0,0,0.015) 10px, rgba(0,0,0,0.015) 20px
  );
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 22px 0 32px;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--ink-2);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.site-footer a { color: var(--ink-1); }

/* ── Animation ── */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 760px) {
  .benefit-grid { grid-template-columns: 1fr; }
  .site-header { flex-wrap: wrap; }
  .tagline { margin-left: 0; width: 100%; }
  .tool-steps { flex-direction: column; }
  .site-footer { flex-direction: column; text-align: center; }
  .result-row { flex-direction: column; gap: 2px; }
}
@media (max-width: 480px) {
  .panel { padding: 18px; }
  .tool-card { padding: 16px; }
  button { width: 100%; }
}
