/* ===== Zoho × Odoo Hybrid Tokens ===== */
:root {
  --odoo-purple: #714B67;
  --odoo-purple-dark: #5a3d52;
  --odoo-purple-light: #8f6b84;
  --odoo-teal: #00A09D;
  --odoo-teal-dark: #008784;
  --zoho-blue: #226DB4;
  --zoho-red: #E42527;
  --zoho-orange: #FF6B35;
  --bg-page: #eef1f6;
  --bg-shell: #f4f6fa;
  --surface: #FFFFFF;
  --text: #1a1f36;
  --muted: #697386;
  --border: #e3e8ef;
  --border-light: #f0f3f7;
  --shadow-sm: 0 1px 3px rgba(26,31,54,0.06);
  --shadow-md: 0 4px 16px rgba(26,31,54,0.08);
  --shadow-lg: 0 8px 32px rgba(26,31,54,0.1);
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --font-en: 'Lato', 'Inter', sans-serif;
  --font-ar: 'Cairo', sans-serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --shell-width: 430px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ar);
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(113,75,103,0.12) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(34,109,180,0.08) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(0,160,157,0.06) 0%, transparent 50%),
    var(--bg-page);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

/* ===== Mobile Shell ===== */
.app-shell {
  width: 100%;
  max-width: var(--shell-width);
  min-height: 100vh;
  background: var(--bg-shell);
  position: relative;
  overflow-x: hidden;
  box-shadow: var(--shadow-lg);
}

/* ===== Header — Odoo purple ===== */
.app-header {
  background: linear-gradient(135deg, var(--odoo-purple) 0%, var(--odoo-purple-dark) 100%);
  padding: 14px 16px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-web-link {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  flex-shrink: 0;
  transition: var(--transition);
  backdrop-filter: blur(4px);
}
.header-web-link:hover { color: #fff; background: rgba(255,255,255,0.12); }

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
.brand-logo svg { width: 100%; height: 100%; }

.brand-o1 {
  font-family: 'Inter', ui-monospace, monospace;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.brand-dot { color: var(--zoho-teal); }
.brand-slogan-index {
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 2px;
  letter-spacing: 0.02em;
}
.header-titles h1 {
  font-family: var(--font-en);
  font-size: 1.12rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.header-titles span {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
}

/* ===== Hero — Zoho gradient feel ===== */
.hero-strip {
  background: linear-gradient(165deg, #ffffff 0%, #f9f7fb 45%, #eef4fc 100%);
  padding: 22px 16px 18px;
  border-bottom: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}
.hero-strip::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -30px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(113,75,103,0.1) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}
.hero-strip::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: -20px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(0,108,53,0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  position: relative;
}

.hero-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--odoo-teal);
  background: rgba(0,160,157,0.1);
  border: 1px solid rgba(0,160,157,0.2);
  padding: 3px 10px;
  border-radius: 20px;
}

.market-chip {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

.hero-strip h2 {
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.45;
  position: relative;
}
.hero-strip h2 span {
  background: linear-gradient(135deg, var(--odoo-purple), var(--zoho-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-strip p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.65;
  position: relative;
}

/* ===== Spotlight cards ===== */
.spotlight-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.spotlight-row::-webkit-scrollbar { display: none; }

.spotlight-card {
  flex: 0 0 118px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-family: var(--font-ar);
  text-align: right;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.spotlight-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--spot);
}
.spotlight-card:hover,
.spotlight-card:active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--spot) 30%, var(--border));
}
.spot-icon {
  font-size: 1.1rem;
  line-height: 1;
}
.spot-icon-svg {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--spot) 12%, white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--spot);
}
.spot-icon-svg svg { width: 15px; height: 15px; }
.spotlight-card strong {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}
.spotlight-card small {
  font-size: 0.58rem;
  color: var(--muted);
  font-weight: 600;
}

/* ===== Section Nav — Zoho pill tabs ===== */
.section-nav {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 70px;
  z-index: 90;
  -webkit-overflow-scrolling: touch;
}
.section-nav::-webkit-scrollbar { display: none; }

.nav-pill {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: var(--transition);
  white-space: nowrap;
}
.nav-pill:hover {
  color: var(--odoo-purple);
  border-color: rgba(113,75,103,0.3);
}
.nav-pill.active {
  color: #fff;
  background: var(--odoo-purple);
  border-color: var(--odoo-purple);
  box-shadow: 0 2px 8px rgba(113,75,103,0.25);
}

/* ===== Search ===== */
.app-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 16px 6px;
  padding: 11px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.app-search:focus-within {
  border-color: var(--odoo-purple-light);
  box-shadow: 0 0 0 3px rgba(113,75,103,0.1);
}
.app-search svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
}
.app-search input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-ar);
  font-size: 0.88rem;
  color: var(--text);
  background: transparent;
}
.app-search input::placeholder { color: #adb5bd; }

/* ===== App Launcher ===== */
.app-launcher {
  padding: 8px 16px 32px;
}

/* ===== Category Cards — Zoho section cards ===== */
.app-category {
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 16px 14px 14px;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 130px;
  transition: var(--transition);
}
.app-category.hidden { display: none; }

.app-category.category-priority {
  border-color: rgba(113,75,103,0.2);
  background: linear-gradient(180deg, #fff 0%, #faf8fb 100%);
  box-shadow: var(--shadow-md);
}
.app-category.category-priority::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--odoo-purple), var(--odoo-teal), var(--zoho-blue));
  border-radius: 3px;
  margin: -16px -14px 14px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.app-category.category-local {
  border-color: rgba(0,108,53,0.25);
  background: linear-gradient(180deg, #fff 0%, #f6fbf8 100%);
  box-shadow: var(--shadow-md);
  position: relative;
}
.app-category.category-local::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #006C35, var(--odoo-teal), #D4AF37);
  margin: -16px -14px 14px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.app-category.category-muted {
  background: #fafbfc;
  border-style: dashed;
  border-color: var(--border);
}

/* Category header */
.category-head {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  align-items: flex-start;
}

.category-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.category-icon svg { width: 20px; height: 20px; }

.ai-icon { background: rgba(113,75,103,0.1); color: var(--odoo-purple); }
.web-icon { background: rgba(34,109,180,0.1); color: var(--zoho-blue); }
.social-icon { background: rgba(59,89,152,0.1); color: #3B5998; }
.marketing-icon { background: rgba(233,30,99,0.1); color: #E91E63; }
.business-icon { background: rgba(108,117,125,0.1); color: var(--muted); }
.local-icon { background: rgba(0,108,53,0.1); color: #006C35; }

.category-meta { flex: 1; min-width: 0; }

.category-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.category-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

.priority-badge {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--odoo-purple), var(--odoo-purple-light));
  color: #fff;
  white-space: nowrap;
}
.priority-badge.secondary {
  background: rgba(34,109,180,0.12);
  color: var(--zoho-blue);
}
.priority-badge.muted {
  background: var(--border-light);
  color: var(--muted);
}
.priority-badge.local-badge {
  background: linear-gradient(135deg, var(--odoo-purple), var(--odoo-teal));
  color: #fff;
}

.category-desc {
  font-size: 0.73rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ===== Apps Grid — Odoo launcher + Zoho polish ===== */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.apps-grid-compact {
  gap: 2px;
}

.app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-ar);
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.app-tile:hover,
.app-tile:active {
  background: rgba(113,75,103,0.05);
}
.app-tile.hidden { display: none; }

.tile-featured .app-icon {
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.tile-tag {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.48rem;
  font-weight: 700;
  color: var(--odoo-teal);
  background: rgba(0,160,157,0.12);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 1;
}

.app-icon {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--app-color) 13%, white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  border: 1px solid color-mix(in srgb, var(--app-color) 8%, transparent);
}
.app-icon svg {
  width: 26px;
  height: 26px;
  color: var(--app-color);
}
.app-tile:active .app-icon {
  transform: scale(0.92);
}
.app-tile:hover .app-icon {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--app-color) 20%, transparent);
}

.app-name {
  font-size: 0.67rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.35;
  max-width: 76px;
}

/* ===== Value Strip ===== */
.value-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
  padding: 16px 12px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.value-item {
  text-align: center;
  padding: 4px;
}

.value-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
}
.value-icon svg { width: 14px; height: 14px; }

.ai-icon-sm { background: rgba(113,75,103,0.1); color: var(--odoo-purple); }
.web-icon-sm { background: rgba(34,109,180,0.1); color: var(--zoho-blue); }
.growth-icon-sm { background: rgba(233,30,99,0.1); color: #E91E63; }
.local-icon-sm {
  background: rgba(0,108,53,0.08);
  border-radius: 8px;
  color: #006C35;
}
.local-icon-sm svg { width: 14px; height: 14px; }

.value-item strong {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.value-item span {
  font-size: 0.6rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ===== Bottom Sheet ===== */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,31,54,0.45);
  backdrop-filter: blur(2px);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}
.sheet-overlay.open {
  opacity: 1;
  visibility: visible;
}

.app-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: var(--shell-width);
  max-height: 78vh;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  z-index: 201;
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 40px rgba(26,31,54,0.15);
}
.app-sheet.open {
  transform: translateX(-50%) translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: #d1d5db;
  border-radius: 4px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.sheet-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.sheet-header > div:nth-child(2) { flex: 1; }

.sheet-app-icon {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sheet-app-icon svg {
  width: 24px;
  height: 24px;
}

.sheet-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.sheet-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(113,75,103,0.08);
  color: var(--odoo-purple);
  margin-top: 2px;
}

.sheet-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-shell);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.sheet-close:hover { background: var(--border); }
.sheet-close svg { width: 16px; height: 16px; color: var(--muted); }

.sheet-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}
.sheet-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 16px;
}
.sheet-features {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.sheet-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.84rem;
  color: var(--text);
}
.sheet-features li:last-child { border-bottom: none; }
.sheet-features li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--odoo-teal);
  flex-shrink: 0;
}

.sheet-cta {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 13px;
  background: linear-gradient(135deg, var(--odoo-purple), var(--odoo-purple-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-ar);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(113,75,103,0.25);
}
.sheet-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(113,75,103,0.3);
}

/* ===== No results ===== */
.no-results {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 0.88rem;
  display: none;
}
.no-results.show { display: block; }

/* ===== Wider screens ===== */
@media (min-width: 480px) {
  body { padding: 20px 0; }
  .app-shell {
    min-height: calc(100vh - 40px);
    border-radius: 24px;
    overflow: hidden;
  }
  .app-header { border-radius: 24px 24px 0 0; }
}

@media (max-width: 360px) {
  .apps-grid { grid-template-columns: repeat(3, 1fr); }
  .app-icon { width: 48px; height: 48px; }
  .app-name { font-size: 0.64rem; }
  .nav-pill { font-size: 0.68rem; padding: 5px 11px; }
}
