/* ===========================================================
   idiibi App — native-style mobile PWA shell
   =========================================================== */

:root {
  --accent: #15c6bd;
  --accent-deep: #038387;
  --grad: linear-gradient(135deg, #15c6bd, #038387);

  --page: #f3f7f8;
  --surface: #ffffff;
  --surface-2: #eef4f5;
  --line: #e4ebec;
  --text: #0c2127;
  --muted: #5d7178;
  --faint: #8aa0a6;

  --bar: rgba(255, 255, 255, .92);
  --tab-h: 64px;
  --bar-h: 56px;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(8, 35, 41, .08);
  --shadow-lg: 0 18px 50px rgba(8, 35, 41, .14);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

.app-body.dark {
  --page: #06181d;
  --surface: #0c252c;
  --surface-2: #0a1f25;
  --line: rgba(255, 255, 255, .08);
  --text: #eafdfb;
  --muted: #9bb6bc;
  --faint: #6d878e;
  --bar: rgba(8, 28, 33, .9);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .45);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; overflow: hidden; }

.app-body {
  font-family: 'Cairo', 'Inter', system-ui, sans-serif;
  background: var(--page);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  user-select: none;
}
.app-body[dir="ltr"] { font-family: 'Inter', 'Cairo', system-ui, sans-serif; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ── Splash ── */
.app-splash {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--grad);
  transition: opacity .45s ease, visibility .45s ease;
}
.app-splash img { filter: drop-shadow(0 8px 20px rgba(0,0,0,.25)); animation: splashPop .6s cubic-bezier(.34,1.56,.64,1); }
.app-splash-name { color: #fff; font-weight: 800; font-size: 26px; letter-spacing: .5px; }
.app-splash-dot { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }
.app-body.ready .app-splash { opacity: 0; visibility: hidden; }
@keyframes splashPop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Shell ── */
.app-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }

/* ── Top bar ── */
.app-bar {
  height: calc(var(--bar-h) + var(--safe-top));
  padding-top: var(--safe-top);
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 20; flex-shrink: 0;
}
.app-bar-btn { display: grid; place-items: center; width: 44px; height: 44px; color: var(--text); border-radius: 12px; }
.app-bar-btn:active { background: var(--surface-2); }
.app-bar-wa { color: var(--accent-deep); }
.app-bar-brand { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.app-bar-brand img { width: 26px; height: 26px; }
.app-bar-title { font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-bar-back { opacity: 0; pointer-events: none; transition: opacity .2s; }
.app-shell.has-back .app-bar-back { opacity: 1; pointer-events: auto; }
.app-shell.has-back .app-bar-brand img { display: none; }
.app-body[dir="rtl"] .app-bar-back svg { transform: scaleX(-1); }

/* ── Main scroll area ── */
.app-main {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 16px 16px 28px;
  position: relative;
}
.screen { display: none; animation: screenIn .32s cubic-bezier(.22,.9,.3,1); }
.screen.active { display: block; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Section heads ── */
.section-head { margin: 4px 2px 16px; }
.section-head h2 { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.section-head p { font-size: 13.5px; color: var(--muted); margin-top: 4px; line-height: 1.6; }

/* ── Home hero ── */
.home-hero {
  background: var(--grad); color: #fff; border-radius: 24px;
  padding: 26px 22px; box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.home-hero::after {
  content: ""; position: absolute; width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.12); top: -70px; inset-inline-end: -50px;
}
.home-greeting { font-size: 13px; opacity: .92; }
.home-greeting b { font-weight: 800; }
.home-hero-title { font-size: 23px; font-weight: 800; line-height: 1.3; margin: 8px 0 8px; position: relative; }
.home-hero-desc { font-size: 13.5px; line-height: 1.7; opacity: .94; position: relative; }
.home-hero-cta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
  background: #fff; color: var(--accent-deep); font-weight: 800; font-size: 14px;
  padding: 12px 20px; border-radius: 14px; box-shadow: 0 8px 22px rgba(0,0,0,.18);
  position: relative;
}
.home-hero-cta:active { transform: scale(.97); }
.app-body[dir="rtl"] .cta-arrow, .app-body[dir="rtl"] .home-hero-cta svg { transform: scaleX(-1); }

/* ── Quick actions ── */
.quick-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0 22px; }
.quick {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 6px; box-shadow: var(--shadow);
}
.quick:active { transform: scale(.95); }
.quick-ic {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--accent-deep);
}
.quick-wa { background: rgba(37,211,102,.14); color: #1ebe57; }
.quick-label { font-size: 11.5px; font-weight: 700; color: var(--muted); }

/* ── Solution cards (home) ── */
.sol-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.sol-card:active { transform: scale(.98); }
.sol-emoji { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: var(--surface-2); flex-shrink: 0; }
.sol-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sol-body b { font-size: 15px; font-weight: 800; }
.sol-body span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.chev { color: var(--faint); flex-shrink: 0; }
.app-body[dir="rtl"] .chev:not(.ext) { transform: scaleX(-1); }

/* ── Solution tiles (solutions screen) ── */
.sol-tile {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; padding: 22px; margin-bottom: 14px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.sol-tile:active { transform: scale(.98); }
.sol-tile::before {
  content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(21,198,189,.14), transparent 70%);
  top: -40px; inset-inline-end: -30px;
}
.sol-tile-emoji { font-size: 34px; display: block; margin-bottom: 12px; }
.sol-tile b { font-size: 17px; font-weight: 800; display: block; margin-bottom: 6px; }
.sol-tile > span { font-size: 13px; color: var(--muted); line-height: 1.6; display: block; }
.sol-tile-go {
  display: inline-block; margin-top: 14px; color: var(--accent-deep); font-weight: 800; font-size: 13px;
  background: var(--surface-2); padding: 8px 16px; border-radius: 999px;
}

/* ── Service cards ── */
.svc-card {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.svc-ic {
  width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface-2); flex-shrink: 0;
}
.svc-ic img { width: 30px; height: 30px; }
.svc-text h3 { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.svc-text p { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* ── Detail screens ── */
.detail-hero {
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: 26px 22px; box-shadow: var(--shadow); text-align: center; margin-bottom: 18px;
  position: relative; overflow: hidden;
}
.detail-emoji { font-size: 42px; display: block; margin-bottom: 12px; }
.detail-hero h2 { font-size: 21px; font-weight: 800; line-height: 1.3; }
.detail-sub { font-size: 14px; color: var(--accent-deep); font-weight: 700; margin: 8px 0; line-height: 1.5; }
.detail-desc { font-size: 13px; color: var(--muted); line-height: 1.75; }
.feat-label, .more-group-label, .feat-label { font-size: 12px; font-weight: 800; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; margin: 6px 2px 12px; }
.feat-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 10px;
}
.feat-check { width: 24px; height: 24px; border-radius: 8px; background: rgba(21,198,189,.14); color: var(--accent-deep); font-weight: 800; display: grid; place-items: center; flex-shrink: 0; font-size: 14px; }
.feat-item b { font-size: 14px; font-weight: 800; display: block; margin-bottom: 2px; }
.feat-item span { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* ── CTA blocks / buttons ── */
.block-cta {
  display: block; text-align: center; margin-top: 18px;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 15px;
  padding: 16px; border-radius: 16px; box-shadow: 0 12px 28px rgba(3,131,135,.3);
}
.block-cta:active { transform: scale(.98); }

.contact-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 800; font-size: 15px; padding: 16px; border-radius: 16px;
}
.contact-wa { background: #1ebe57; color: #fff; box-shadow: 0 12px 28px rgba(30,190,87,.3); }
.contact-wa:active, .contact-ghost:active { transform: scale(.98); }
.contact-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 18px; }
.contact-ghost { background: var(--surface); border: 1px solid var(--line); color: var(--text); box-shadow: var(--shadow); }

.info-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px; box-shadow: var(--shadow); }
.info-line { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--text); }
.info-line:last-child { border-bottom: none; }
.info-line span:first-child { font-size: 18px; }
.info-line a { color: var(--accent-deep); font-weight: 700; }

/* ── About ── */
.about-hero { text-align: center; padding: 20px 16px 8px; }
.about-hero img { margin: 0 auto 12px; }
.about-hero h2 { font-size: 26px; font-weight: 800; }
.about-full { font-size: 12.5px; color: var(--faint); margin: 6px 0 12px; }
.about-meaning { font-size: 14px; color: var(--muted); line-height: 1.7; max-width: 30ch; margin: 0 auto; }
.check-list { margin: 20px 0 0; }
.check-item { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; font-size: 13.5px; line-height: 1.6; }
.check-item span:first-child { width: 24px; height: 24px; border-radius: 8px; background: rgba(21,198,189,.14); color: var(--accent-deep); font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }

/* ── More screen ── */
.more-profile { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 8px; }
.more-profile img { border-radius: 14px; }
.more-profile b { font-size: 18px; font-weight: 800; display: block; }
.more-profile span { font-size: 12.5px; color: var(--muted); }
.more-group-label { margin-top: 22px; }
.more-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.more-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 15px 16px; border-bottom: 1px solid var(--line); text-align: start; }
.more-row:last-child { border-bottom: none; }
.more-row:active { background: var(--surface-2); }
.more-row-ic { font-size: 19px; width: 24px; text-align: center; }
.more-row-label { flex: 1; font-size: 14px; font-weight: 700; display: flex; flex-direction: column; }
.more-row-label small { font-weight: 500; font-size: 11.5px; color: var(--faint); margin-top: 2px; }

.lang-seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.lang-seg a { font-size: 12.5px; font-weight: 800; padding: 5px 12px; border-radius: 999px; color: var(--muted); }
.lang-seg a.on { background: var(--accent-deep); color: #fff; }

.switch { width: 46px; height: 28px; border-radius: 999px; background: var(--surface-2); position: relative; transition: background .25s; flex-shrink: 0; }
.switch[aria-checked="true"] { background: var(--accent-deep); }
.switch-knob { position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.25); transition: transform .25s; }
.switch[aria-checked="true"] .switch-knob { transform: translateX(18px); }
.app-body[dir="rtl"] .switch[aria-checked="true"] .switch-knob { transform: translateX(-18px); }

.social-row { display: flex; gap: 12px; }
.social-row a { flex: 1; display: grid; place-items: center; height: 50px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--accent-deep); box-shadow: var(--shadow); }
.social-row a:active { transform: scale(.95); }
.more-copy { text-align: center; font-size: 12px; color: var(--faint); margin: 22px 0 4px; }

/* ── Store ── */
.store-chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; margin: 0 -2px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.store-chips::-webkit-scrollbar { display: none; }
.store-chip {
  flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px;
  white-space: nowrap; transition: all .2s;
}
.store-chip.active { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.store-chip:active { transform: scale(.95); }

.store-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.store-card {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.store-card:active { transform: scale(.97); }
.store-thumb { aspect-ratio: 16 / 10; background: var(--surface-2); overflow: hidden; }
.store-thumb img { width: 100%; height: 100%; object-fit: cover; }
.store-info { padding: 11px 12px 13px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.store-info b {
  font-size: 12.5px; font-weight: 700; line-height: 1.4; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.store-info small { font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-price { display: flex; align-items: baseline; gap: 7px; margin-top: 2px; }
.store-price i { font-style: normal; font-weight: 800; font-size: 14px; color: var(--accent-deep); }
.store-price s { font-size: 11.5px; color: var(--faint); }

/* ── Bottom tab bar ── */
.app-tabs {
  flex-shrink: 0; z-index: 30;
  height: calc(var(--tab-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); position: relative; }
.tab span { font-size: 10px; font-weight: 700; }
.tab svg { width: 22px; height: 22px; }
.tab svg { transition: transform .2s; }
.tab.active { color: var(--accent-deep); }
.tab.active svg { transform: translateY(-1px); }
.tab.active::before { content: ""; position: absolute; top: 6px; width: 30px; height: 3px; border-radius: 999px; background: var(--accent-deep); }
.tab:active { opacity: .6; }

@media (min-width: 720px) {
  /* On larger screens, frame the app like a device for a focused app feel */
  .app-shell { max-width: 460px; margin: 0 auto; border-inline: 1px solid var(--line); }
}
