/* ===== PicToText AI — Shared Stylesheet ===== */
:root {
  --bg: #0b1120;
  --bg-soft: #0f172a;
  --panel: #111a2e;
  --panel-2: #16213a;
  --border: rgba(148, 163, 184, .16);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent-2: #22d3ee;
  --gradient: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
  --success: #34d399;
  --danger: #f87171;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(2, 6, 23, .5);
}

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

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(99, 102, 241, .14), transparent 60%),
    radial-gradient(900px 400px at 10% 110%, rgba(34, 211, 238, .10), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Cairo", "Segoe UI", Tahoma, system-ui, sans-serif;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; display: block; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin-inline: auto; padding-inline: 20px; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 17, 32, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-block: 14px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo .mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--gradient);
  display: grid; place-items: center;
  color: #fff; font-size: 1.05rem; font-weight: 900;
}
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { color: var(--muted); font-size: .95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.lang-btn {
  border: 1px solid var(--border); background: var(--panel);
  color: var(--text); border-radius: 999px; padding: 6px 14px;
  font: inherit; font-size: .85rem; cursor: pointer; font-weight: 700;
}
.lang-btn:hover { border-color: var(--accent); }

/* ===== Hero ===== */
.hero { text-align: center; padding: 56px 20px 30px; }
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 900; line-height: 1.35;
  margin-bottom: 14px;
}
.hero h1 .grad {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); max-width: 640px; margin-inline: auto; font-size: 1.05rem; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; }
.chip {
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  border-radius: 999px; padding: 6px 16px; font-size: .85rem; font-weight: 600;
}

/* ===== Cards / Tool ===== */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px;
}
.tool-card { max-width: 760px; margin: 26px auto 0; }

.section { padding: 44px 0; }
.section-title { text-align: center; font-size: 1.5rem; font-weight: 800; margin-bottom: 28px; }

/* Upload zone */
.dropzone {
  border: 2px dashed rgba(99, 102, 241, .45); border-radius: var(--radius);
  background: rgba(99, 102, 241, .05);
  padding: 40px 20px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent-2);
  background: rgba(34, 211, 238, .07);
}
.dropzone .icon { font-size: 2.2rem; margin-bottom: 10px; }
.dropzone strong { display: block; font-size: 1.05rem; margin-bottom: 6px; }
.dropzone span { color: var(--muted); font-size: .85rem; }

.preview-wrap { margin-top: 18px; text-align: center; }
.preview-wrap img {
  max-height: 320px; border-radius: 12px; border: 1px solid var(--border);
  margin-inline: auto;
}

/* Controls */
.controls { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 20px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 160px; }
.field label { font-size: .85rem; color: var(--muted); font-weight: 700; }
select, input[type="text"], input[type="email"], textarea {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 10px 14px; font: inherit; width: 100%;
}
select:focus, input:focus, textarea:focus { outline: 2px solid rgba(99, 102, 241, .5); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--gradient); color: #fff; border: none; border-radius: 10px;
  padding: 12px 26px; font: inherit; font-weight: 800; cursor: pointer;
  transition: transform .15s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(99, 102, 241, .35); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.ghost {
  background: transparent; border: 1px solid var(--border); color: var(--muted); font-weight: 700;
}
.btn.ghost:hover { border-color: var(--accent); color: var(--text); box-shadow: none; }

/* Result */
.result-box {
  margin-top: 22px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px;
  white-space: pre-wrap; word-break: break-word; font-size: .98rem;
  max-height: 420px; overflow: auto;
}
.result-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* Steps & FAQ */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.step-num {
  width: 42px; height: 42px; border-radius: 12px; background: var(--gradient);
  display: grid; place-items: center; font-weight: 900; color: #fff; margin-bottom: 14px;
}
.step h3 { font-size: 1.05rem; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: .92rem; }

details.faq {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 20px; margin-bottom: 12px;
}
details.faq summary { cursor: pointer; font-weight: 700; }
details.faq p { color: var(--muted); margin-top: 10px; font-size: .95rem; }

/* ===== Ad slots ===== */
.ad-slot {
  display: flex; justify-content: center; align-items: center;
  margin: 18px auto; min-height: 90px; width: 100%; overflow: hidden;
}
.ad-slot::before {
  content: ""; position: absolute;
}
.ad-slot ins { width: 100%; }

/* ===== Video message pages (/p/) ===== */
.p-page { max-width: 860px; margin-inline: auto; padding: 26px 20px 60px; }
.p-hero { text-align: center; margin-bottom: 8px; }
.p-hero h1 { font-size: clamp(1.4rem, 3.5vw, 2.1rem); font-weight: 900; margin-bottom: 8px; }
.p-hero .subtitle { color: var(--muted); font-size: 1rem; }
.video-shell {
  margin-top: 22px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: #000; box-shadow: var(--shadow);
}
.video-shell video { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.p-content { margin-top: 26px; }
.p-content .card { padding: 24px; }
.p-content h2 { font-size: 1.15rem; margin-bottom: 12px; }
.p-content p { color: var(--muted); margin-bottom: 12px; font-size: .98rem; }
.p-cta { text-align: center; margin: 30px 0 10px; }
.p-cta .btn { font-size: 1.05rem; padding: 14px 36px; }
.p-footer { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 46px; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 60px; padding: 30px 0;
  color: var(--muted); font-size: .9rem;
}
.site-footer .inner { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 10px 22px; font-size: .9rem; z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.toast.show { opacity: 1; }

[dir="rtl"] .toast { transform: translateX(50%); }

/* ===== Products showcase page (/p/) ===== */
.p-page.p-wide { max-width: 1020px; }
.p-hero .nexa-badge {
  display: inline-block; background: var(--gradient); color: #fff;
  font-size: .8rem; font-weight: 800; border-radius: 999px;
  padding: 4px 16px; margin-bottom: 14px; letter-spacing: .3px;
}
.p-hero h1 { font-size: clamp(1.4rem, 3.5vw, 2.2rem); font-weight: 900; line-height: 1.4; }
.p-section { margin-top: 34px; }
.p-section-title { text-align: center; font-size: 1.35rem; font-weight: 900; margin-bottom: 22px; }

.products-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.product-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; position: relative;
  transition: transform .2s, border-color .2s;
}
.product-card:hover { transform: translateY(-3px); border-color: rgba(99, 102, 241, .5); }
.product-card .p-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: rgba(99, 102, 241, .15); border: 1px solid rgba(99, 102, 241, .3);
  display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 14px;
}
.product-card h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 8px; }
.product-card h3 .en { color: var(--accent-2); font-size: .85rem; font-weight: 700; }
.product-card p { color: var(--muted); font-size: .92rem; margin-bottom: 10px; }
.product-card ul { margin: 0; padding-inline-start: 18px; color: var(--muted); font-size: .88rem; }
.product-card ul li { margin-bottom: 4px; }
.product-card .soon {
  position: absolute; top: 14px; inset-inline-end: 14px;
  background: rgba(34, 211, 238, .15); color: var(--accent-2);
  border: 1px solid rgba(34, 211, 238, .35); font-size: .72rem; font-weight: 800;
  border-radius: 999px; padding: 2px 12px;
}

/* الفيديو وسط المحتوى — مش ملء الشاشة */
.video-section .video-shell {
  max-width: 720px; margin-inline: auto;
}
.video-hint {
  text-align: center; color: var(--muted); font-size: .82rem; margin-top: 10px;
}
.video-ad-slot { min-height: 0; margin-top: 10px; }

/* قائمة مميزات عامة */
.feature-list {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.feature-list h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 14px; }
.feature-list ul { margin: 0; padding-inline-start: 20px; color: var(--muted); }
.feature-list ul li { margin-bottom: 8px; font-size: .95rem; }

@media (max-width: 640px) {
  .nav-links a:not(.lang-btn) { display: none; }
  .card { padding: 18px; }
  .hero { padding-top: 36px; }
  .products-grid { grid-template-columns: 1fr; }
}
