/* ========== THEME VARIABLES ========== */
:root {
  --bg: #0b0f14;
  --panel: #121820;
  --muted: #1a2430;
  --border: #233142;
  --text: #e7edf3;
  --text-dim: #a9b7c6;
  --acc: #2dd4bf;
  --acc-2: #60a5fa;
  --warn: #f59e0b;
  --danger: #ef4444;

  --radius: 16px;
  --shadow: 0 10px 25px rgba(0,0,0,.25);
  --header-h: 72px; /* default header height */
}

/* ========== BASE RESET ========== */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-top: var(--header-h); /* offset fixed header */
}
html { scroll-padding-top: var(--header-h); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ========== HEADER / NAV ========== */
header {
  position: fixed;
  left: 0; right: 0; top: 0;
  z-index: 1000;
  width: 100%;
  backdrop-filter: saturate(1.2) blur(10px);
  background: linear-gradient(180deg, rgba(11,15,20,.85), rgba(11,15,20,.65));
  border-bottom: 1px solid var(--border);
}
.logo-img {
  height: 32px;
  width: auto;
  border-radius: 8px;
}
.nav {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.links a {
  padding: 8px 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.links a:hover {
  background: var(--muted);
}
.links a.active {
  background: rgba(255, 255, 255, 0.1); /* abu transparan */
  border-color: var(--border);
  color: var(--text); /* tetap warna teks normal */
}
.hamburger {
  display: none;
  font-size: 24px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
}

@media(max-width: 768px){
  .hamburger {
    display: block;
  }

  .links {
    display: none;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    position: absolute;
    top: 70px;
    right: 16px;
    width: 200px;
    padding: 12px;
    z-index: 999;
  }

  .links.show {
    display: flex;
  }
}

/* ========== SEARCH BAR ========== */
.searchbar {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 999px;
  width: 100%;
  max-width: 150px;
}
.searchbar input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
}

/* ========== LAYOUT ========== */
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.grid { display: grid; gap: 16px; }
@media(min-width:700px) { .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
@media(min-width:1000px) { .grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ========== COMPONENTS ========== */
.card {
  min-height: 400px; /* ubah sesuai kebutuhan */
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card .pad { padding: 14px; }

.grid .card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.grid.cols-3, .grid.cols-4 {
  align-items: stretch; /* biar semua item rata tinggi */
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--muted);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.price { font-weight: 700; }
.muted { color: var(--text-dim); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn:hover { opacity: 0.9; }
.btn.primary {
  background: linear-gradient(135deg, var(--acc), var(--acc-2));
  color: #071218;
  border-color: transparent;
  font-weight: 700;
}
.btn.warn {
  background: var(--warn);
  color: #fff;
  border-color: transparent;
}
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.block { width: 100%; }

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--muted);
  border: 1px solid var(--border);
}

/* ========== PANELS & FOOTER ========== */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.footer {
  padding: 48px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 14px;
}
.footer-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  padding: 10px 0;
  background: var(--panel); /* atau warna footer */
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 14px;
  z-index: 100; /* biar di atas konten lain */
}

/* ===== SLIDER HERO ===== */
.hero-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 1;      /* rasio 3:1 */
  min-height: 120px;        /* biar di HP gak terlalu tipis */
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 30px;
}

.slides {
  position: relative;
  display: flex;
}

.slide {
  min-width: 100%;
  display: none;
  transition: opacity 0.5s ease-in-out;
}

.slide.active {
  display: block;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* Kontrol panah */
.slider-controls {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
}

.slider-controls button {
  background: transparent;   
  border: none;
  color: white;              
  font-size: 32px;           
  cursor: pointer;
  padding: 0 10px;           
}

/* Dots indikator */
.dots {
  position: absolute;
  bottom: 15px;
  width: 100%;
  text-align: center;
}

.dot {
  height: 12px;
  width: 12px;
  margin: 0 4px;
  background-color: rgba(255,255,255,0.5);
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
}

.dot.active {
  background-color: white;
}

/* Responsif tambahan */
@media (max-width: 768px) {
  .hero-slider {
    min-height: 150px;
  }
}

@media (max-width: 480px) {
  .hero-slider {
    min-height: 180px;
  }
}

/* ========== ARTICLE STYLE ========== */
.article-content h1, .article-content h2, .article-content h3 {
  margin: 16px 0 8px;
}
.article-content p {
  line-height: 1.7;
  margin: 12px 0;
}
.article-content img {
  margin: 16px 0;
  border-radius: 12px;
}
.toolbar .btn {
  font-size: 14px;
  padding: 8px 12px;
}
#article-editor:focus {
  outline: 2px solid var(--acc);
}
.article-meta {
  font-size: 14px;
  color: var(--text-dim); /* abu-abu */
  margin-top: -10px;      /* rapat ke judul */
  margin-bottom: 20px;
  font-style: italic;
}
/* Paragraf terima kasih */
.thanks {
  margin-top: 25px;
  padding: 15px;
  background: #111;
  border-left: 4px solid #4CAF50;
  border-radius: 4px;
  color: #ddd;
  font-size: 0.95rem;
}

/* Sumber artikel */
.source {
  margin-top: 15px;
  font-size: 0.9rem;
  color: #aaa;
}

.source a {
  color: #4aa3ff;
  text-decoration: none;
}

.source a:hover {
  text-decoration: underline;
}

/* Tabel lisensi */
.license-table {
  width: 100%;               /* buat tabel sama panjang dengan iklan */
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.95rem;
}

.license-table th,
.license-table td {
  border: 1px solid #666;
  padding: 10px 14px;
  text-align: left;
}

.license-table th {
  background: #222;
  color: #fff;
}

.license-table tr:nth-child(even) {
  background: #111;
}

.license-table tr:nth-child(odd) {
  background: #1c1c1c;
}

.license-table td {
  color: #ddd;
}
.card.clickable {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card.clickable:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}



/* ========== STICKY CTA (mobile) ========== */
.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 12px;
  backdrop-filter: saturate(1.2) blur(10px);
  background: linear-gradient(0deg, rgba(11,15,20,.92), rgba(11,15,20,.75));
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}
@media(min-width:900px) { .sticky-cta { display: none; } }

/* ========== TOOLS ========== */
.tool-wrap { display: grid; gap: 16px; }
@media(min-width:900px) { .tool-wrap { grid-template-columns: 340px 1fr; } }
.canvas-wrap {
  background: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  overflow: auto;
}
.toolbar .group {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: var(--panel);
}
.toolbar label { font-size: 12px; color: var(--text-dim); }
input[type="range"] { width: 100%; }
input[type="file"], select, input[type="number"], input[type="text"], textarea {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}
textarea { min-height: 120px; }
.hidden { display: none !important; }

.loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  text-align: center;
  z-index: 10;
}

.loader::after {
  content: "";
  display: inline-block;
  margin-left: 10px;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}



/* ========== DROPZONE ========== */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--muted);
  color: var(--text-dim);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.dropzone.dragover {
  border-color: var(--acc);
  background: rgba(96,165,250,.08);
}

.article-img {
  width: 100%;
  aspect-ratio: 4/3;   /* tinggi otomatis 3/4 dari lebar */
  overflow: hidden;
  border-radius: 12px;
  margin: 16px 0;
}

.article-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* isi penuh area, tidak gepeng */
  display: block;
}

.article-imgg {
  width: 400px;
  height: 300px;
  display: block;
}

.article-cover {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 16px;
}

.article-title {
  font-size: 2rem;
  margin: 0 0 8px 0;
}

.article-meta {
  color: #aaa;
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.article-body {
  line-height: 1.6;
}


/* Ads container */
.ad {
  width: 100%;
  margin: 24px 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* gambar & video menyesuaikan */
.ad img,
.ad video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Ads ratio */
.ad-small {
  aspect-ratio: 16 / 1;   /* sangat tipis horizontal */
}

.ad-medium {
  aspect-ratio: 16 / 4;   /* agak besar */
}

.ad-large {
  aspect-ratio: 16 / 8;   /* paling besar */
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* ========== SHOP PAGE ========== */
.product-card {
  background: var(--panel);
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.product-card img {
  width: 100%;
  height: auto;        /* kamu bisa sesuaikan tinggi */
  object-fit: cover;    /* cover = isi penuh, crop kalau perlu */
  border-radius: 5pt;
}

.price {
  color: var(--accent);
  font-weight: bold;
}

.product-card.clickable {
  cursor: pointer;
  transition: transform 0.2s;
}
.product-card.clickable:hover {
  transform: translateY(-4px);
}

/* Detail layout landscape */
.product-detail.landscape {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 30px;
}

.product-detail .detail-img {
  width: 300px;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius);
}

.product-detail .detail-info {
  flex: 1;
}

.btn-order {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 24px;
  background: #00a884; /* warna WA */
  color: #fff;
  font-weight: bold;
  border-radius: var(--radius);
  text-decoration: none;
}

.btn-order:hover {
  background: #007c65;
}

.category-filter {
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-filter button {
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
  font-weight: bold;
  color: #fff;
}

.category-filter button:hover {
  background: var(--accent);
  color: #6d6d6d;
}


/* ========== REFERRAL PAGE ========== */
.referral-page {
  padding: 20px;
}

.referral-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}


.referral-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

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

.referral-thumb {
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: #fafafa;
}

.referral-content {
  padding: 16px;
}

.referral-content h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.referral-content p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.4;
  min-height: 48px;
}

/* Tombol khusus referral */
.referral-btn-group {
  margin-top: 12px;
}

.referral-btn.referral-join {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  background: #007bff;   /* biru */
  border: 1px solid #007bff;
  color: #fff;
  transition: all 0.25s ease;
}

.referral-btn.referral-join:hover {
  background: #28a745;   /* hijau saat hover */
  border-color: #28a745;
  color: #fff;
}

