/* ================================================================
   chozi Search — modern Google-inspired UI
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand-teal:    #0a9396;
  --brand-dark:    #005f73;
  --brand-accent:  #ee9b00;
  --brand-green:   #10b981;
  --brand-red:     #ef4444;
  --bg:            #f8fafb;
  --surface:       #ffffff;
  --text:          #1f2937;
  --text-muted:    #6b7280;
  --border:        #e5e7eb;
  --radius:        12px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.06);
  --shadow-md:     0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:     0 12px 40px rgba(0,0,0,.12);
  --transition:    .3s cubic-bezier(.4,0,.2,1);
}

html { font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── Brand ─── */
.hero-title,
.header-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-logo {
  display: block;
  height: auto;
  max-width: 100%;
}

.hero-logo {
  width: min(420px, 88vw);
  margin: 0 auto;
  background-color: var(--bg);
}

.header-logo {
  height: 2.85rem;
  width: auto;
}

.brand-jom {
  color: var(--brand-dark);
  font-weight: 800;
  display: inline-block;
  transform: skewX(-14deg) rotate(-8deg);
  transform-origin: right bottom;
  margin-right: -6px; /* visually tucks "Jom" into "Check" */
  position: relative;
  top: -2px;
}

.brand-check {
  color: var(--brand-accent);
  font-weight: 800;
  display: inline-block;
}

/* ================================================================
   HERO — centred landing
   ================================================================ */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  transition: opacity var(--transition), transform var(--transition);
}
.hero.fade-out {
  opacity: 0;
  transform: translateY(-30px);
  pointer-events: none;
}
.hero.hidden { display: none; }

.hero-content { text-align: center; width: 100%; max-width: 640px; }

.hero-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
}

.hero-title {
  margin: 0;
  width: 100%;
}

.hero-tagline {
  color: var(--brand-dark);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: .4rem 0 0;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.55;
  max-width: 520px;
  margin: 0 auto 1rem;
}

/* ─── Brunei product shortcuts ─── */
.product-shortcuts {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 auto 1.15rem;
  max-width: 100%;
}

.product-shortcut {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 500;
  color: var(--text);
  position: relative;
  border-radius: 6px;
  transition: color .2s, background .2s;
}

.product-shortcut:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 1.2rem;
  background: var(--border);
}

.product-shortcut:hover,
.product-shortcut.active {
  color: var(--brand-dark);
  background: rgba(10, 147, 150, .06);
}

.product-shortcut-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.product-shortcut-icon.umrah { color: #0a9396; }
.product-shortcut-icon.telco { color: #7c3aed; }
.product-shortcut-icon.hotels { color: #2563eb; }
.product-shortcut-icon.food { color: #ea580c; }
.product-shortcut-icon.more { color: #64748b; }

@media (max-width: 520px) {
  .product-shortcut {
    padding: .5rem .65rem;
    font-size: .875rem;
  }
  .product-shortcut:not(:last-child)::after {
    display: none;
  }
  .product-shortcuts {
    gap: .15rem .35rem;
  }
}

/* ================================================================
   SEARCH BOX (shared between hero + header)
   ================================================================ */
.search-box-wrapper { width: 100%; }

.search-box {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: .5rem .5rem .5rem 1.25rem;
  gap: .6rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-box:focus-within {
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 4px rgba(10,147,150,.15);
}

.search-icon { color: var(--text-muted); font-size: 1rem; flex-shrink: 0; }

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: inherit;
  background: transparent;
  color: var(--text);
  min-width: 0;
}
.search-input::placeholder { color: #b0b8c4; }

.search-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-teal));
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: .65rem 1.6rem;
  font-size: .95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(10,147,150,.35);
}
.search-btn:active { transform: translateY(0); }

.search-btn.compact { padding: .5rem .9rem; font-size: .85rem; }

.search-options {
  display: flex;
  justify-content: center;
  margin-top: .75rem;
  gap: 1rem;
}
.search-options.hidden { display: none; }
.search-options.compact { margin-top: .4rem; justify-content: flex-start; }

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.toggle-label input[type="checkbox"] {
  accent-color: var(--brand-teal);
  width: 16px;
  height: 16px;
}

/* ================================================================
   HEADER BAR (compact, after search)
   ================================================================ */
.header-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: .6rem 1.5rem;
  transition: opacity var(--transition), transform var(--transition);
}
.header-bar.hidden { display: none; }
.header-bar.slide-in {
  animation: slideDown .35s ease-out;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-100%); }
  to   { opacity: 1; transform: translateY(0); }
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-brand {
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.header-search { flex: 1; max-width: 620px; }
.header-search .search-box { padding: .35rem .35rem .35rem 1rem; }
.header-search .search-input { font-size: .92rem; }

/* ─── Business login (enterprise portal) ─── */
.enterprise-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1.1rem;
  min-height: 44px;
  background: var(--surface);
  color: var(--brand-dark);
  border: 1.5px solid var(--brand-teal);
  border-radius: 999px;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
}

.enterprise-btn i {
  font-size: 1.05rem;
  color: var(--brand-teal);
  transition: color var(--transition);
}

.enterprise-btn:hover {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-teal));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(10, 147, 150, .35);
  transform: translateY(-1px);
}

.enterprise-btn:hover i { color: #fff; }

.enterprise-btn:focus {
  outline: 2px solid var(--brand-teal);
  outline-offset: 2px;
}

.enterprise-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.hero-actions {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: .65rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-shrink: 0;
}

.game-menu {
  position: relative;
}

.game-menu > summary {
  list-style: none;
  display: inline-flex;
}

.game-menu > summary::-webkit-details-marker,
.game-menu > summary::marker {
  display: none;
  content: "";
}

.game-menu-panel {
  position: absolute;
  top: calc(100% + .45rem);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: .4rem;
  z-index: 1001;
}

.game-menu-panel a {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .7rem .85rem;
  border-radius: 8px;
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: .875rem;
}

.game-menu-panel a i {
  color: var(--brand-teal);
  width: 1.1rem;
  text-align: center;
}

.game-menu-panel a:hover {
  background: #e0f7f7;
}

/* ================================================================
   RESULTS AREA
   ================================================================ */
.results-area {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
}
.results-area.hidden { display: none; }

/* Summary line */
.results-summary {
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  min-height: 1.4em;
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 3rem 0;
  color: var(--brand-teal);
  font-weight: 500;
}
.loading.hidden { display: none; }

.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--brand-teal);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Error */
.error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: .9rem;
  margin-bottom: 1rem;
}
.error-box.hidden { display: none; }

/* ================================================================
   RESULTS TABLE
   ================================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.table-wrapper.hidden { display: none; }

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.results-table thead th {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-teal));
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: .78rem;
  padding: .85rem 1rem;
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.results-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.results-table tbody tr:last-child { border-bottom: none; }
.results-table tbody tr:hover { background: #f0fafb; }
.results-table tbody tr:nth-child(even) { background: #fafbfc; }
.results-table tbody tr:nth-child(even):hover { background: #f0fafb; }

.results-table tbody td {
  padding: .75rem 1rem;
  vertical-align: top;
  color: var(--text);
}

/* Column widths */
.col-num   { width: 48px; text-align: center; }
.col-company { width: 150px; }
.col-desc  { min-width: 300px; }
.col-likes { width: 80px; text-align: right; }
.col-date  { width: 130px; white-space: nowrap; }
.col-umrah { width: 90px; text-align: center; }

/* Description cell */
.desc-text { line-height: 1.5; }
.desc-text.truncated {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.desc-toggle {
  display: inline-block;
  margin-top: .3rem;
  font-size: .8rem;
  color: var(--brand-teal);
  cursor: pointer;
  font-weight: 500;
  border: none;
  background: none;
  padding: 0;
}
.desc-toggle:hover { text-decoration: underline; }

/* Badges */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.badge-yes { background: #d1fae5; color: #065f46; }
.badge-no  { background: #fee2e2; color: #991b1b; }

/* Likes number */
.likes-num {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* Company name */
.company-name {
  font-weight: 600;
  color: var(--brand-dark);
}

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .35rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.pagination.hidden { display: none; }

.page-btn {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: .85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}
.page-btn:hover:not(.active):not(:disabled) {
  background: #ecfeff;
  border-color: var(--brand-teal);
  color: var(--brand-teal);
}
.page-btn.active {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-teal));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(10,147,150,.3);
}
.page-btn:disabled {
  opacity: .45;
  cursor: default;
}
.page-ellipsis {
  width: 36px;
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
  .hero-logo { width: min(320px, 90vw); }
  .header-inner { flex-direction: column; gap: .5rem; }
  .header-actions { align-self: flex-end; }
  .header-logo { height: 2.45rem; }
  .header-search { max-width: 100%; }
  .results-area { padding: 1rem; }
  .col-company { width: 110px; }
  .col-desc { min-width: 200px; }
  .hero-actions {
    top: 1rem;
    right: 1rem;
  }
}

@media (max-width: 480px) {
  .enterprise-btn-label { display: none; }
  .enterprise-btn {
    padding: .55rem .65rem;
    min-width: 44px;
    justify-content: center;
  }
  .search-btn:not(.compact) {
    padding: .55rem 1rem;
    font-size: .85rem;
  }
  .results-table { font-size: .8rem; }
  .results-table thead th { padding: .6rem .5rem; font-size: .72rem; }
  .results-table tbody td { padding: .55rem .5rem; }
}
