/* ==========================================
   QEDEVELOPER - COMPONENTS CSS
   Komponen UI yang digunakan berulang
========================================== */

/* ==========================================
   1. BUTTON
========================================== */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  padding: 12px 17px;

  border: 1px solid transparent;
  border-radius: 12px;

  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.4;
  text-align: center;

  cursor: pointer;

  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

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

/* Tombol utama */

.button.primary {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 7px 16px rgba(21, 94, 239, 0.16);
}

.button.primary:hover {
  background: var(--blue-dark);
  color: #ffffff;
}

/* Tombol sekunder */

.button.secondary {
  border-color: #dbe5f2;
  background: #ffffff;
  color: var(--navy);
}

.button.secondary:hover {
  border-color: #b8cef0;
  background: #f5f9ff;
  color: var(--blue);
}

/* Ukuran tombol */

.button.large {
  padding: 15px 19px;
  border-radius: 14px;
  font-size: 0.92rem;
}

/* Tombol lebar penuh */

.button.block {
  display: flex;
  width: 100%;
}

/* Tombol nonaktif */

.button:disabled,
.button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================
   2. KARTU ALAT BANTU
========================================== */

.tool-card {
  min-width: 0;
  overflow: hidden;

  border: 1px solid var(--border);
  border-radius: 17px;

  background: #ffffff;
  box-shadow: var(--shadow);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: #d0def1;
  box-shadow: 0 12px 34px rgba(19, 48, 91, 0.1);
}

/* ==========================================
   3. THUMBNAIL
========================================== */

.tool-thumbnail {
  position: relative;

  display: block;
  overflow: hidden;

  aspect-ratio: 16 / 9;

  background: #edf3fb;
}

.tool-thumbnail img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;

  transition: transform 0.3s ease;
}

.tool-card:hover .tool-thumbnail img {
  transform: scale(1.035);
}

/* Placeholder jika thumbnail belum tersedia */

.thumb-fallback {
  display: grid;
  place-items: center;

  width: 100%;
  height: 100%;
  min-height: 100px;

  background: linear-gradient(135deg, #e8f2ff, #f5f8ff);

  color: #4c7fc8;
  font-size: 2rem;
  font-weight: 800;
}

/* Label pada thumbnail */

.thumbnail-label {
  position: absolute;
  top: 10px;
  left: 10px;

  padding: 5px 9px;

  border-radius: 7px;

  background: rgba(16, 42, 86, 0.9);
  color: #ffffff;

  font-size: 0.68rem;
  font-weight: 750;
}

/* ==========================================
   4. ISI KARTU
========================================== */

.tool-card-body {
  padding: 16px;
}

.tool-card h3 {
  margin-bottom: 7px;

  color: var(--navy);
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.tool-card h3 a {
  color: inherit;
}

.tool-card h3 a:hover {
  color: var(--blue);
}

.tool-card p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

/* ==========================================
   5. BADGE DAN KATEGORI
========================================== */

.tool-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;

  margin-bottom: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 4px 8px;

  border-radius: 999px;

  background: #edf4ff;
  color: #2266c5;

  font-size: 0.66rem;
  font-weight: 750;
  line-height: 1.35;
}

.tag.green {
  background: #e5f8ef;
  color: #128258;
}

.tag.purple {
  background: #f1eaff;
  color: #7138c9;
}

.tag.yellow {
  background: #fff4d6;
  color: #a87300;
}

/* ==========================================
   6. FOOTER KARTU
========================================== */

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;

  margin-top: 13px;
  padding-top: 12px;

  border-top: 1px solid #eef2f7;

  font-size: 0.78rem;
}

.tool-card-footer a {
  color: var(--blue);
  font-weight: 750;
}

.tool-card-footer a:hover {
  color: var(--blue-dark);
}

.tool-card-footer span {
  color: #7d8ba0;
}

/* ==========================================
   7. STATUS DAN LABEL
========================================== */

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 5px 9px;

  border-radius: 999px;

  font-size: 0.72rem;
  font-weight: 700;
}

.status.success {
  background: #e5f8ef;
  color: #128258;
}

.status.info {
  background: #edf4ff;
  color: #2266c5;
}

.status.warning {
  background: #fff4d6;
  color: #a87300;
}

/* ==========================================
   8. LOADING DAN EMPTY STATE
========================================== */

.loading-card,
.empty-state {
  grid-column: 1 / -1;

  padding: 28px;

  border: 1px dashed #cdd9e8;
  border-radius: 15px;

  background: #ffffff;

  color: var(--muted);
  text-align: center;
}

.loading-card {
  min-height: 100px;

  display: grid;
  place-items: center;
}

.empty-state {
  line-height: 1.7;
}

/* ==========================================
   9. PEMISAH KONTEN
========================================== */

.divider {
  width: 100%;
  height: 1px;

  border: 0;
  background: var(--border);
}

/* ==========================================
   10. RESPONSIVE IMAGE
========================================== */

.image-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-contain {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ==========================================
   11. AKSESIBILITAS
========================================== */

@media (prefers-reduced-motion: reduce) {
  .button,
  .tool-card,
  .tool-thumbnail img {
    transition: none;
  }
}
