/* TPEX Premium Search UI - all selectors are namespaced to avoid touching core styles */
:root {
  --tpex-bg: #07111f;
  --tpex-bg-2: #102a43;
  --tpex-card: rgba(255,255,255,.92);
  --tpex-text: #0f172a;
  --tpex-muted: #64748b;
  --tpex-accent: #00c6ff;
  --tpex-accent-2: #0072ff;
  --tpex-border: rgba(15,23,42,.10);
  --tpex-shadow: 0 22px 55px rgba(2,8,23,.18);
  --tpex-radius: 24px;
}

body.tpex-premium-active.home,
.tpex-premium-active.home body {
  background: radial-gradient(circle at top left, rgba(0,198,255,.28), transparent 32%), linear-gradient(135deg, var(--tpex-bg), var(--tpex-bg-2));
}

.tpex-home {
  max-width: 1180px;
  padding-top: 24px;
  padding-bottom: 42px;
}

.tpex-hero {
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  padding: 42px 28px 32px;
  color: #fff;
  background:
    radial-gradient(circle at 15% 20%, rgba(0,198,255,.32), transparent 25%),
    radial-gradient(circle at 92% 5%, rgba(255,255,255,.18), transparent 26%),
    linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.07));
  border: 1px solid rgba(255,255,255,.20);
  box-shadow: var(--tpex-shadow);
  backdrop-filter: blur(18px);
}

.tpex-hero::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  right: -120px;
  bottom: -160px;
  background: rgba(0,198,255,.22);
  border-radius: 999px;
  filter: blur(4px);
}

.tpex-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.tpex-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.22);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tpex-brand-title {
  margin: 0;
  font-size: clamp(42px, 8vw, 76px);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: .94;
}

.tpex-brand-title span {
  background: linear-gradient(90deg, #fff, #8be8ff);
  -webkit-background-clip: text;
  color: transparent;
}

.tpex-tagline {
  max-width: 680px;
  margin: 16px auto 28px;
  color: rgba(255,255,255,.84);
  font-size: 18px;
  line-height: 1.55;
}

.tpex-search-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto;
  padding: 8px;
  border-radius: 22px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 18px 40px rgba(2,8,23,.24);
}

.tpex-search-shell .search-input,
.tpex-search-shell input[type="text"] {
  height: 58px;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  color: #0f172a;
  font-size: 18px;
  padding-left: 18px;
}

.tpex-search-shell .search-input::placeholder {
  color: #94a3b8;
}

.tpex-search-shell .search-btn,
.tpex-voice-btn,
.tpex-tool-btn,
.tpex-install-btn,
.tpex-save-btn {
  border: 0;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.tpex-search-shell .search-btn {
  position: static !important;
  min-width: 58px;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--tpex-accent), var(--tpex-accent-2));
  box-shadow: 0 12px 24px rgba(0,114,255,.22);
}

.tpex-search-shell .search-btn:hover,
.tpex-voice-btn:hover,
.tpex-tool-btn:hover,
.tpex-install-btn:hover,
.tpex-service-card:hover,
.tpex-mini-card:hover,
.tpex-chip:hover {
  transform: translateY(-2px);
}

.tpex-voice-btn {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: #0f172a;
  background: #eef6ff;
  font-size: 20px;
}

.tpex-voice-btn.is-listening {
  animation: tpexPulse 1.2s infinite;
  background: #fee2e2;
}

@keyframes tpexPulse {
  0% { box-shadow: 0 0 0 0 rgba(239,68,68,.45); }
  100% { box-shadow: 0 0 0 14px rgba(239,68,68,0); }
}

.tpex-tool-row,
.tpex-chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.tpex-tool-btn,
.tpex-install-btn,
.tpex-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none !important;
  color: #fff;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.18);
  font-weight: 500;
}

.tpex-chip {
  color: #0f172a;
  background: #fff;
  border-color: rgba(255,255,255,.7);
  box-shadow: 0 8px 24px rgba(2,8,23,.12);
}

.tpex-install-btn {
  display: none;
}

.tpex-section-title {
  margin: 32px 0 14px;
  color: #fff;
  text-align: center;
  font-weight: 800;
  letter-spacing: -.03em;
}

.tpex-service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.tpex-service-card,
.tpex-smart-answer,
.tpex-mini-card,
.tpex-sidebar-card,
.tpex-related-box {
  border-radius: var(--tpex-radius);
  background: var(--tpex-card);
  color: var(--tpex-text);
  border: 1px solid var(--tpex-border);
  box-shadow: var(--tpex-shadow);
}

.tpex-service-card {
  padding: 20px;
  text-decoration: none !important;
  transition: transform .18s ease, box-shadow .18s ease;
}

.tpex-service-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0,198,255,.16), rgba(0,114,255,.12));
  font-size: 22px;
  margin-bottom: 12px;
}

.tpex-service-card h3,
.tpex-mini-card h4,
.tpex-sidebar-card h4,
.tpex-smart-answer h3 {
  margin: 0 0 8px;
  color: var(--tpex-text);
  font-weight: 800;
  letter-spacing: -.02em;
}

.tpex-service-card p,
.tpex-mini-card p,
.tpex-sidebar-card p,
.tpex-smart-answer p,
.tpex-smart-answer li {
  color: var(--tpex-muted);
  line-height: 1.55;
}

.tpex-card-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--tpex-accent-2);
  font-weight: 700;
}

.searchbar .tpex-voice-btn {
  position: absolute;
  right: 58px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  font-size: 16px;
  z-index: 2;
}

.searchbar .search-input {
  padding-right: 104px !important;
}

.tpex-results-top {
  margin-bottom: 16px;
}

.tpex-smart-answer {
  padding: 18px 20px;
  margin: 0 0 16px;
  position: relative;
  overflow: hidden;
}

.tpex-smart-answer::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(var(--tpex-accent), var(--tpex-accent-2));
}

.tpex-answer-label {
  display: inline-flex;
  padding: 5px 9px;
  margin-bottom: 8px;
  border-radius: 999px;
  color: #075985;
  background: #e0f2fe;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.tpex-smart-answer ul {
  padding-left: 18px;
  margin-bottom: 0;
}

.tpex-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.tpex-mini-card {
  padding: 16px;
  text-decoration: none !important;
  transition: transform .18s ease;
}

.tpex-mini-card .tpex-service-icon {
  width: 36px;
  height: 36px;
  font-size: 18px;
  margin-bottom: 8px;
}

.tpex-sidebar-card,
.tpex-related-box {
  padding: 18px;
  margin-bottom: 16px;
}

.tpex-whatsapp-btn,
.tpex-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 16px;
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 800;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 12px 24px rgba(22,163,74,.22);
}

.tpex-primary-btn {
  width: auto;
  background: linear-gradient(135deg, var(--tpex-accent), var(--tpex-accent-2));
  box-shadow: 0 12px 24px rgba(0,114,255,.22);
}

.tpex-related-box a,
.tpex-recent-list a,
.tpex-saved-list a {
  display: inline-flex;
  margin: 4px 4px 4px 0;
  padding: 7px 10px;
  border-radius: 999px;
  color: #0f172a;
  background: #f1f5f9;
  text-decoration: none !important;
  font-size: 13px;
}

.tpex-result-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}

.tpex-save-btn {
  padding: 6px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
}

.tpex-no-results-helper {
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid var(--tpex-border);
}

.darkmode .tpex-service-card,
.darkmode .tpex-smart-answer,
.darkmode .tpex-mini-card,
.darkmode .tpex-sidebar-card,
.darkmode .tpex-related-box {
  --tpex-card: rgba(15,23,42,.92);
  --tpex-text: #f8fafc;
  --tpex-muted: #cbd5e1;
  --tpex-border: rgba(255,255,255,.10);
}

.darkmode .tpex-chip,
.darkmode .tpex-related-box a,
.darkmode .tpex-recent-list a,
.darkmode .tpex-saved-list a,
.darkmode .tpex-save-btn {
  color: #e2e8f0;
  background: rgba(255,255,255,.08);
}

@media (max-width: 991px) {
  .tpex-service-grid,
  .tpex-mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .tpex-home {
    padding-left: 12px;
    padding-right: 12px;
  }

  .tpex-hero {
    border-radius: 24px;
    padding: 30px 14px 24px;
  }

  .tpex-search-shell {
    border-radius: 18px;
    padding: 6px;
  }

  .tpex-search-shell .search-input,
  .tpex-search-shell input[type="text"] {
    height: 52px;
    font-size: 16px;
    padding-left: 10px;
  }

  .tpex-search-shell .search-btn {
    width: 52px;
    min-width: 52px;
    height: 52px;
  }

  .tpex-voice-btn {
    width: 42px;
    height: 42px;
  }

  .tpex-service-grid,
  .tpex-mini-grid {
    grid-template-columns: 1fr;
  }
}


/* TPEX Google-style SERP v2 */
body.search-results.tpex-premium-active {
  background: #fff;
}

.darkmode body.search-results.tpex-premium-active,
body.darkmode.search-results.tpex-premium-active {
  background: #111827;
}

.tpex-google-serp {
  max-width: 1180px;
  padding-top: 18px;
}

.tpex-serp-shell {
  background: transparent;
}

.tpex-google-serp .gsc-control-cse,
.tpex-google-serp .gsc-control-cse .gsc-table-result {
  font-family: Arial, sans-serif !important;
}

.tpex-google-serp .gsc-control-cse {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.tpex-google-serp .gsc-above-wrapper-area {
  border: 0 !important;
  padding: 0 0 12px !important;
}

.tpex-google-serp .gsc-result-info {
  padding: 0 !important;
  color: #70757a !important;
  font-size: 14px !important;
}

.tpex-google-serp .gsc-webResult.gsc-result,
.tpex-google-serp .gsc-results .gsc-imageResult {
  margin: 0 0 28px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.tpex-google-serp .gsc-webResult.gsc-result:hover,
.tpex-google-serp .gsc-results .gsc-imageResult:hover {
  border: 0 !important;
  box-shadow: none !important;
}

.tpex-google-serp .gs-webResult .gs-title,
.tpex-google-serp .gs-webResult .gs-title *,
.tpex-google-serp .gsc-imageResult .gs-title,
.tpex-google-serp .gsc-imageResult .gs-title * {
  color: #1a0dab !important;
  font-size: 20px !important;
  line-height: 1.3 !important;
  text-decoration: none !important;
  font-weight: 400 !important;
}

.tpex-google-serp .gs-webResult .gs-title:hover,
.tpex-google-serp .gs-webResult .gs-title:hover * {
  text-decoration: underline !important;
}

.tpex-google-serp .gs-webResult div.gs-visibleUrl,
.tpex-google-serp .gs-webResult .gs-visibleUrl,
.tpex-google-serp .gs-visibleUrl-long,
.tpex-google-serp .gs-visibleUrl-short {
  color: #202124 !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  margin: 2px 0 3px !important;
}

.tpex-google-serp .gs-webResult .gs-snippet,
.tpex-google-serp .gs-fileFormatType,
.tpex-google-serp .gs-webResult .gs-snippet * {
  color: #4d5156 !important;
  font-size: 14px !important;
  line-height: 1.58 !important;
}

.tpex-google-serp .gsc-thumbnail-inside,
.tpex-google-serp .gsc-url-top {
  padding: 0 !important;
}

.tpex-google-serp .gsc-cursor-box {
  margin: 28px 0 36px !important;
}

.tpex-google-serp .gsc-cursor-page {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  margin-right: 4px !important;
  border-radius: 50%;
  color: #1a0dab !important;
  text-decoration: none !important;
}

.tpex-google-serp .gsc-cursor-current-page {
  background: #e8f0fe;
  color: #202124 !important;
}

.tpex-google-serp .gcsc-find-more-on-google,
.tpex-google-serp .gcsc-find-more-on-google-magnifier {
  color: #1a0dab !important;
}

.searchbar.tpex-premium-active,
.tpex-premium-active .searchbar {
  background: #fff;
  border-bottom: 1px solid #ebedef;
}

.tpex-premium-active .searchbar .search-input {
  border-radius: 999px !important;
  border: 1px solid #dfe1e5 !important;
  box-shadow: 0 1px 6px rgba(32,33,36,.12) !important;
  height: 46px;
}

.tpex-premium-active .searchbar .search-btn {
  right: 8px !important;
  top: 5px !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: #4285f4 !important;
  box-shadow: none !important;
}

.tpex-premium-active .search-tabs {
  background: #fff;
  border-bottom: 1px solid #ebedef;
}

.tpex-premium-active .search-tabs .nav-tabs {
  border-bottom: 0;
}

.tpex-premium-active .search-tabs .nav-link {
  border: 0 !important;
  color: #5f6368;
  padding: 13px 16px;
  font-size: 14px;
}

.tpex-premium-active .search-tabs .nav-link.active {
  color: #1a73e8 !important;
  border-bottom: 3px solid #1a73e8 !important;
  background: transparent !important;
}

.tpex-serp-aside {
  padding-top: 4px;
}

.tpex-business-panel,
.tpex-serp-aside .infobox-card {
  border: 1px solid #dadce0;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  color: #202124;
  box-shadow: none;
  margin-bottom: 18px;
}

.tpex-business-cover {
  height: 178px;
  background: #f1f3f4;
  overflow: hidden;
}

.tpex-business-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tpex-business-body {
  padding: 18px;
}

.tpex-business-body h2 {
  margin: 0;
  color: #202124;
  font-size: 28px;
  line-height: 1.18;
  font-weight: 400;
}

.tpex-business-category {
  margin-top: 4px;
  color: #70757a;
  font-size: 14px;
}

.tpex-business-rating {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  color: #70757a;
  font-size: 14px;
}

.tpex-rating-score {
  color: #202124;
}

.tpex-stars {
  color: #fbbc04;
  letter-spacing: -1px;
  font-size: 13px;
}

.tpex-business-description {
  margin: 14px 0 0;
  color: #4d5156;
  line-height: 1.55;
  font-size: 14px;
}

.tpex-business-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 4px;
}

.tpex-business-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #f1f3f4;
  color: #1a73e8 !important;
  font-weight: 600;
  text-decoration: none !important;
  font-size: 13px;
}

.tpex-business-facts {
  border-top: 1px solid #edf0f2;
  margin-top: 14px;
  padding-top: 12px;
}

.tpex-business-fact {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  padding: 7px 0;
  font-size: 14px;
  line-height: 1.45;
}

.tpex-business-fact strong {
  color: #202124;
  font-weight: 600;
}

.tpex-business-fact span {
  color: #4d5156;
}

body.search-results.tpex-premium-active .tpex-smart-answer,
body.search-results.tpex-premium-active .tpex-mini-grid,
body.search-results.tpex-premium-active .tpex-sidebar-card,
body.search-results.tpex-premium-active .tpex-related-box {
  display: none !important;
}

.darkmode .tpex-google-serp .gsc-control-cse,
body.darkmode .tpex-google-serp .gsc-control-cse {
  background: transparent !important;
}

.darkmode .tpex-google-serp .gs-webResult .gs-title,
.darkmode .tpex-google-serp .gs-webResult .gs-title *,
body.darkmode .tpex-google-serp .gs-webResult .gs-title,
body.darkmode .tpex-google-serp .gs-webResult .gs-title * {
  color: #8ab4f8 !important;
}

.darkmode .tpex-google-serp .gs-visibleUrl,
body.darkmode .tpex-google-serp .gs-visibleUrl,
.darkmode .tpex-google-serp .gs-webResult div.gs-visibleUrl,
body.darkmode .tpex-google-serp .gs-webResult div.gs-visibleUrl {
  color: #bdc1c6 !important;
}

.darkmode .tpex-google-serp .gs-webResult .gs-snippet,
.darkmode .tpex-google-serp .gs-webResult .gs-snippet *,
body.darkmode .tpex-google-serp .gs-webResult .gs-snippet,
body.darkmode .tpex-google-serp .gs-webResult .gs-snippet * {
  color: #bdc1c6 !important;
}

.darkmode .tpex-business-panel,
.darkmode .tpex-serp-aside .infobox-card,
body.darkmode .tpex-business-panel,
body.darkmode .tpex-serp-aside .infobox-card {
  background: #202124;
  border-color: #3c4043;
  color: #e8eaed;
}

.darkmode .tpex-business-body h2,
.darkmode .tpex-business-fact strong,
.darkmode .tpex-rating-score,
body.darkmode .tpex-business-body h2,
body.darkmode .tpex-business-fact strong,
body.darkmode .tpex-rating-score {
  color: #e8eaed;
}

.darkmode .tpex-business-category,
.darkmode .tpex-business-description,
.darkmode .tpex-business-fact span,
body.darkmode .tpex-business-category,
body.darkmode .tpex-business-description,
body.darkmode .tpex-business-fact span {
  color: #bdc1c6;
}

.darkmode .tpex-business-action,
body.darkmode .tpex-business-action {
  background: #303134;
  color: #8ab4f8 !important;
}

@media (max-width: 767px) {
  .tpex-google-serp {
    padding-top: 10px;
  }
  .tpex-serp-aside {
    padding: 0 0 16px;
  }
  .tpex-business-panel {
    border-radius: 12px;
  }
  .tpex-business-actions {
    grid-template-columns: 1fr;
  }
}
