/* =========================================
   PasteSaja — Modern UI
   ========================================= */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #171a21;
  --muted: #687083;
  --border: #e4e7ee;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --shadow: 0 8px 28px rgba(20, 25, 40, .055);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid rgba(228, 231, 238, .8);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  text-decoration: none;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.7px;
  color: #171a21;
}

.brand span {
  color: var(--primary);
}

/* =========================================
   Search
   ========================================= */

.search-form {
  width: min(760px, 100%);
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-form.compact {
  max-width: 820px;
  margin: 24px auto 20px;
}

.search-box {
  flex: 1;
  min-width: 0;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 3px 14px rgba(20, 25, 40, .025);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.search-box:focus-within {
  border-color: rgba(79, 70, 229, .45);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .08);
}

.search-icon {
  flex: 0 0 auto;
  color: #8b92a3;
  font-size: 25px;
  line-height: 1;
  transform: rotate(-15deg);
}

.search-box input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.search-box input::placeholder {
  color: #9aa1b0;
}

.search-form button {
  height: 50px;
  padding: 0 23px;
  border: 0;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(79, 70, 229, .18);
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.search-form button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, .22);
}

.search-form button:active {
  transform: translateY(0);
}

/* =========================================
   Main / Ads
   ========================================= */

.results-wrap {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 10px;
}

.ad-slot {
  min-height: 88px;
  margin: 20px auto 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border: 1px dashed #d8dce6;
  border-radius: 16px;
  background: rgba(255, 255, 255, .52);
  color: #9299a8;
  font-size: 11px;
  letter-spacing: .35px;
  text-align: center;
}

.second-ad {
  margin-top: 30px;
  margin-bottom: 34px;
}

/* =========================================
   Results heading
   ========================================= */

.results-head {
  margin: 0 0 16px;
}

.results-head h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -.2px;
}

.results-head h1 strong {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.results-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.results-head .notice {
  color: #b45309;
}

/* =========================================
   Result cards
   ========================================= */

.result-list {
  display: grid;
  gap: 12px;
}

.result-card {
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.result-card:hover {
  transform: translateY(-2px);
  border-color: #dce0e8;
  box-shadow: 0 12px 32px rgba(20, 25, 40, .075);
}

.result-source {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 20px;
  margin-bottom: 8px;
  color: #7b8393;
  font-size: 12px;
}

.result-source img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 5px;
}

.favicon-fallback {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9aa1b0;
  font-size: 9px;
}

.result-source .dot {
  color: #b4bac6;
}

.result-card h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: -.2px;
}

.result-card h2 a {
  color: #151821;
  text-decoration: none;
}

.result-card h2 a:hover {
  color: var(--primary);
}

.result-card > p {
  margin: 7px 0 0;
  color: #697183;
  font-size: 13.5px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.result-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 13px;
  color: var(--primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.result-link:hover {
  color: var(--primary-hover);
}

.result-link span {
  font-size: 14px;
  transition: transform .18s ease;
}

.result-link:hover span {
  transform: translate(2px, -2px);
}

/* =========================================
   Pagination
   ========================================= */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 28px 0 34px;
  flex-wrap: wrap;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-number,
.page-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--border);
  background: #fff;
  color: #596173;
  text-decoration: none;
  transition: all .18s ease;
  box-shadow: 0 2px 8px rgba(20, 25, 40, .025);
}

.page-number {
  min-width: 38px;
  padding: 0 9px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
}

.page-nav {
  padding: 0 14px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
}

.page-number:hover,
.page-nav:hover {
  border-color: #cfd4df;
  background: #f8f9fc;
  color: #171a21;
  transform: translateY(-1px);
}

.page-number.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 5px 14px rgba(79, 70, 229, .18);
}

/* =========================================
   Empty state
   ========================================= */

.empty {
  padding: 54px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.empty-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #f0f1f6;
  color: #7b8291;
  font-weight: 800;
}

.empty h2 {
  margin: 0;
  font-size: 18px;
}

.empty p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* =========================================
   Footer
   ========================================= */

footer {
  padding: 22px 20px 30px;
  color: #969dac;
  font-size: 12px;
  text-align: center;
}

/* =========================================
   Mobile
   ========================================= */

@media (max-width: 700px) {
  .topbar {
    height: 60px;
    padding: 0 16px;
  }

  .brand {
    font-size: 20px;
  }

  .results-wrap {
    width: min(100% - 22px, 900px);
  }

  .search-form.compact {
    margin-top: 16px;
    gap: 8px;
  }

  .search-box {
    height: 46px;
    padding: 0 13px;
    border-radius: 12px;
  }

  .search-form button {
    height: 46px;
    padding: 0 17px;
    border-radius: 12px;
  }

  .ad-slot {
    min-height: 76px;
    margin: 16px auto 20px;
    border-radius: 14px;
    padding: 14px;
  }

  .results-head {
    margin-bottom: 12px;
  }

  .results-head h1 {
    font-size: 17px;
  }

  .result-list {
    gap: 10px;
  }

  .result-card {
    padding: 17px 16px;
    border-radius: 15px;
  }

  .result-card h2 {
    font-size: 16px;
  }

  .result-card > p {
    font-size: 13px;
    line-height: 1.6;
  }

  .pagination {
    gap: 8px;
    margin: 23px 0 28px;
  }

  .page-numbers {
    gap: 4px;
  }

  .page-number {
    min-width: 35px;
    min-height: 35px;
    padding: 0 7px;
    border-radius: 10px;
  }

  .page-nav {
    min-height: 35px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 12px;
  }
}

@media (max-width: 430px) {
  .search-form.compact {
    align-items: stretch;
  }

  .search-box {
    min-width: 0;
  }

  .search-form button {
    padding: 0 14px;
  }

  .pagination {
    gap: 7px;
  }

  .page-nav {
    order: 3;
  }
}
