@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #eef7f0;
  --green: #2e9e5b;
  --green-dark: #1e7a42;
  --green-light: #d4f0e0;
  --green-xlight: #f0faf4;
  --ink: #1a2e22;
  --muted: #6a8a74;
  --card-bg: #ffffff;
  --border: #c8e4d2;
  --tag-bg: #d4f0e0;
  --shadow: 0 2px 12px rgba(46, 158, 91, 0.1);
  --radius: 14px;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

header {
  background: var(--green);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(30, 122, 66, 0.2);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.logo-smurf {
  font-size: 2rem;
  line-height: 1;
}

.logo-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.logo-sub {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  white-space: nowrap;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.search-bar-wrap {
  max-width: 1100px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
}
.search-wrap {
  position: relative;
}
.search-wrap input {
  width: 100%;
  padding: 0.7rem 1.1rem 0.7rem 2.6rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: white;
  font-family: 'Nunito', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  outline: none;
  box-shadow: var(--shadow);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.search-wrap input::placeholder {
  color: var(--muted);
  font-weight: 500;
}
.search-wrap input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46, 158, 91, 0.12);
}
.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.ig-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: white;
  text-decoration: none;
  flex-shrink: 0;
  transition:
    background 0.18s,
    border-color 0.18s;
}
.ig-link:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.7);
}

.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
}

.sidebar {
  width: 210px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-box {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
}

.filter-box-title {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--green);
  margin-bottom: 0.65rem;
}

.filter-pills {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pill {
  padding: 0.38rem 0.8rem;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-size: 0.82rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.pill:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-xlight);
}
.pill.active {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.content {
  flex: 1;
  min-width: 0;
}
.results-info {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 1.1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: var(--shadow);
  transition:
    transform 0.18s,
    box-shadow 0.18s,
    border-color 0.18s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(46, 158, 91, 0.16);
  border-color: var(--green);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-icon {
  font-size: 1.3rem;
}
.card-type {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
.type-exam {
  background: #fde8e0;
  color: #b83010;
}
.type-notes {
  background: #e0edf8;
  color: #1a5fa0;
}
.type-practice {
  background: var(--green-light);
  color: var(--green-dark);
}

.card-title {
  font-size: 0.97rem;
  font-weight: 700;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
  padding-right: 0.5rem;
}
.card-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
}
.card-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.tag {
  background: var(--tag-bg);
  color: var(--green-dark);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.17rem 0.5rem;
  border-radius: 5px;
}
.card-pdf-link {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 3.5rem 2rem;
}
.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}
.empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.empty-sub {
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .header-inner {
    padding: 0.9rem 1rem;
  }
  .logo-sub {
    display: none;
  }
  .page-wrap {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }
  .sidebar {
    width: 100%;
    box-sizing: border-box;
  }
  .content {
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
  }
  .filter-pills {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .search-bar-wrap {
    margin-top: 1rem;
    padding: 0 1rem;
  }
  .notice-banner-inner {
    padding: 0.6rem 1rem;
  }
  .grid {
    grid-template-columns: 1fr;
    width: 100%;
  }
  .card {
    width: 100%;
    box-sizing: border-box;
  }
}

/* ── NOTICE BANNER ── */
.notice-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.notice-banner {
  background: #fffbe6;
  border-bottom: 1.5px solid #f0d96a;
  padding: 0;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #7a6000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.notice-banner a {
  color: var(--green-dark);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.notice-banner a:hover {
  color: var(--green);
}
/* ── KO-FI MODAL ── */
.kofi-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.kofi-overlay.open {
  display: flex;
}

.kofi-modal {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  text-align: center;
  animation: modalIn 0.25s ease;
  position: relative;
}

@keyframes modalIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.kofi-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  background: var(--bg);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.kofi-close:hover {
  background: var(--border);
}

.kofi-emoji {
  font-size: 2.8rem;
  margin-bottom: 0.75rem;
}

.kofi-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.kofi-sub {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

.kofi-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ff5e5b;
  color: white;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  text-decoration: none;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(255, 94, 91, 0.35);
}
.kofi-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 94, 91, 0.45);
}

.kofi-skip {
  display: block;
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  font-family: 'Nunito', sans-serif;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.kofi-skip:hover {
  color: var(--ink);
}

/* ── KOFI MODAL ── */
.kofi-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.kofi-overlay.open {
  display: flex;
}

.kofi-modal {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  position: relative;
  text-align: center;
  animation: modalIn 0.22s ease;
}

@keyframes modalIn {
  from {
    transform: translateY(16px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.kofi-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  background: var(--bg);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1rem;
  transition: background 0.15s;
}
.kofi-close:hover {
  background: var(--border);
}

.kofi-emoji {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.kofi-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.kofi-sub {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.kofi-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ff5e5b;
  color: white;
  font-family: 'Nunito', sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  transition:
    background 0.18s,
    transform 0.15s;
  margin-bottom: 0.75rem;
}
.kofi-btn:hover {
  background: #e04a47;
  transform: translateY(-2px);
}

.kofi-skip {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  font-family: 'Nunito', sans-serif;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.kofi-skip:hover {
  color: var(--ink);
}

/* ── TOGGLE SECTIONS ── */
.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.toggle-item {
  border-radius: 7px;
  overflow: hidden;
}

.toggle-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  user-select: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: 'Nunito', sans-serif;
  background: none;
  border-radius: 6px;
  transition: background 0.15s;
}
.toggle-header:hover {
  background: var(--green-xlight);
}

.toggle-arrow {
  font-size: 0.55rem;
  color: var(--green);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.toggle-item.open .toggle-arrow {
  transform: rotate(90deg);
}

.toggle-body {
  display: none;
  padding: 0.1rem 0.5rem 0.5rem 1.45rem;
}
.toggle-item.open .toggle-body {
  display: block;
}

.toggle-text {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.55;
}
