:root {
  --accent: #00b894;
  --text: #2c3e50;
  --muted: #636e72;
  --card-bg: #ffffff;
  --card-border: #e0e0e0;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: #ffffff;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

header {
  background-color: var(--accent);
  color: white;
  padding: 0.8rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  min-width: 0;
}

.header-left img {
  height: 50px;
  width: 50px;
  object-fit: contain;
  border-radius: 50%;
  background-color: #cfffe9;
  /* padding: 8px; */
  /* border: 2px solid #ffffff; */
  box-shadow: 0 0 0 4px #d8ebda;
}



.header-text {
  border-left: 2px solid #87d8c8;
  padding-left: 1rem;
  min-width: 0;
}

.header-text h1 {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.2rem;
  text-align: left;
}

.header-text .sub {
  font-size: 0.95rem;
  opacity: 0.9;
  text-align: left;
}

.header-tagline {
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.95;
  white-space: normal;
  margin-left: auto;
  text-align: right;
}

nav {
  text-align: center;
  margin-top: 1.5rem;
  margin-bottom: 0;
  padding: 0 1rem;
}

.category-button {
  display: inline-flex;
  align-items: center;
  background: #f1f2f6;
  color: var(--text);
  border: 1px solid #dfe6e9;
  padding: 0;
  margin: 0.5rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  overflow: hidden;
  transition: background 0.2s ease, color 0.2s;
}

.category-button .icon-box {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-button .label-text {
  padding: 0.6rem 1rem;
  display: inline-block;
}

.category-button i {
  font-size: 1.2rem;
}

.category-button.active,
.category-button:hover {
  background: var(--accent);
  color: #fff;
}

.category-button.active .icon-box {
  background: rgba(0, 0, 0, 0.1);
}

.container {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 0.85rem;
}

.container.is-sparse {
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 260px));
  justify-content: start;
}

.catalog-shell {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 2rem auto;
  padding: 0 clamp(1rem, 3.2vw, 2.5rem) 3rem;
  display: grid;
  gap: 2rem;
}

.engine-section {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #e6eeea;
  border-radius: 1rem;
  background: #fcfffd;
}

.engine-head {
  display: grid;
  gap: 0.35rem;
}

.engine-head h2 {
  font-size: 1.3rem;
  color: var(--accent);
}

.engine-head p {
  color: var(--muted);
  font-size: 0.9rem;
}

#html-section {
  border-color: rgba(227, 79, 38, 0.22);
  background:
    linear-gradient(180deg, rgba(227, 79, 38, 0.06), transparent 120px),
    #fffdfa;
}

#html-section .engine-head h2 {
  color: #d94f27;
}

#html-section .engine-head p {
  color: #8c6257;
}

#python-section {
  border-color: rgba(55, 118, 171, 0.24);
  background:
    radial-gradient(circle at top right, rgba(255, 212, 59, 0.16), transparent 24%),
    linear-gradient(180deg, rgba(55, 118, 171, 0.06), transparent 120px),
    #fcfefc;
}

#python-section .engine-head h2 {
  color: #2f669d;
}

#python-section .engine-head p {
  color: #6d748a;
}

.engine-section[hidden] {
  display: none !important;
}

.engine-empty {
  padding: 1rem 1.1rem;
  border: 1px dashed #d7e6df;
  border-radius: 0.8rem;
  color: var(--muted);
  background: #fbfefd;
  font-size: 0.9rem;
  align-items: stretch;
}


.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-5px);
}

.card-media {
  aspect-ratio: 16 / 9;
  background: #e8f6f1;
  overflow: hidden;
}

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

.card-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.68rem;
  padding: 1rem;
}

.card h2 {
  font-size: 0.95rem;
  color: var(--accent);
}

.card p {
  font-size: 0.72rem;
  color: var(--muted);
  flex: 1;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: -0.15rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 1.45rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid #d9e7e1;
  border-radius: 999px;
  background: #f7fbf9;
  color: #47645b;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.badge-html {
  border-color: rgba(227, 79, 38, 0.22);
  background: rgba(227, 79, 38, 0.08);
  color: #b84724;
}

.badge-streamlit,
.badge-python {
  border-color: rgba(55, 118, 171, 0.22);
  background: rgba(55, 118, 171, 0.08);
  color: #2f669d;
}

.badge-graf {
  border-color: rgba(0, 184, 148, 0.22);
  background: rgba(0, 184, 148, 0.08);
  color: #087f68;
}

.badge-fuzzy {
  border-color: rgba(142, 68, 173, 0.22);
  background: rgba(142, 68, 173, 0.08);
  color: #7c3a98;
}

.badge-statistik {
  border-color: rgba(214, 154, 45, 0.26);
  background: rgba(214, 154, 45, 0.1);
  color: #986712;
}

.card a {
  display: inline-block;
  padding: 0.56rem 1rem;
  background-color: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: background 0.2s;
  margin-top: auto;
}

.card a:hover {
  background-color: #00a383;
}

.segera-hadir {
  opacity: 0.6;
  filter: grayscale(0.2);
  pointer-events: none;
}

.segera-hadir h2,
.segera-hadir p,
.segera-hadir a {
  color: var(--muted) !important;
}

.segera-hadir a {
  background-color: #dfe6e9;
  cursor: default;
}

.hidden {
  display: none !important;
}

footer {
  text-align: center;
  padding: 0.5rem;
  font-size: 0.85rem;
  color: #b2bec3;
  background: transparent;
  border-top: 1px solid #dfe6e9;
}

.fade-in {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.4s ease forwards;
}

@media (max-width: 640px) {
  header {
    padding: 0.9rem 1rem;
    align-items: center;
  }

  .header-left {
    width: 100%;
    align-items: center;
  }

  .header-left img {
    height: 44px;
    width: 44px;
    flex: 0 0 auto;
  }

  .header-text h1 {
    font-size: 1.45rem;
  }

  .header-text .sub {
    font-size: 0.85rem;
  }

  .header-tagline {
    width: 100%;
    margin-left: 0;
    text-align: left;
    font-size: 0.9rem;
  }

  nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 0.25rem 1rem 0.75rem;
    margin-top: 1rem;
  }

  .category-button {
    flex: 0 1 auto;
    margin: 0;
  }

  #search-input {
    width: calc(100% - 2rem) !important;
    max-width: none !important;
  }

  .container {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .container.is-sparse {
    grid-template-columns: 1fr;
  }

  .catalog-shell {
    gap: 1.5rem;
    padding: 0 1rem 1.5rem;
    margin: 1rem auto;
  }

  .card {
    border-radius: 0.8rem;
  }
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
