/* ============ RESET & BASE ============ */
* { box-sizing: border-box; }
:root{
  --brand-orange:#ff8800;
  --brand-blue:#2ea7ff;
  --text:#222;
  --muted:#777;
  --border:#eee;
  --bg:#f4f4f4;
  --ball:#2196F3;
  --tab-active:#2dd36f;
}

html,body{ height:100%; }
body{
  margin:0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Optional wrapper kalau mau center konten */
.container{
  max-width: 900px;
  margin: 0 auto;
  padding: 0 12px 24px;
}

/* ============ APP BANNER (opsional) ============ */
.app-banner{
  display:flex; justify-content:space-between; align-items:center;
  gap:10px; padding:10px 12px; background:#fff; border-bottom:1px solid var(--border);
}
.app-left{display:flex; align-items:center; gap:10px}
.app-banner img{width:32px;height:32px;border-radius:8px;object-fit:cover}
.app-title{font-weight:700; font-size:14px}
.app-sub{font-size:12px; color:var(--muted)}
.app-btn{background:#26aefc; color:#fff; padding:6px 12px; border-radius:16px; font-size:13px; text-decoration:none}

/* ============ TOPBAR ala 168 ============ */
.topbar{
  position: sticky; top: 0; z-index: 1000;
  height: 48px; background:#fa8136f1;
  display:flex; align-items:center; justify-content:space-between;
  padding: 0 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  border-bottom: 1px solid var(--border);
}
.nav-btn{
  width: 36px; height: 36px; border:0; background:transparent; cursor:pointer;
  display:block; align-items:center; justify-content:center; border-radius:8px;
}
.nav-btn:active{ background:#f2f2f2; }
/* hamburger */
.nav-btn.menu .bar{
  display:block; width:18px; height:2px; background:var(--text); margin:2px 0; border-radius:2px;
}
/* logo tengah */
.topbar .brand{
  position:absolute; left:50%; transform:translateX(-50%);
  height:24px; display:flex; align-items:center; justify-content:center;
}
.topbar .brand img{ height:70px; display:block; margin-top: 10px; }
/* ikon kanan */
.right-icons{ display:flex; align-items:center; gap:6px; }
/* lonceng */
.nav-btn.bell{ position:relative }
.nav-btn.bell::before,
.nav-btn.bell::after{ content:""; position:absolute; display:block; }
.nav-btn.bell::before{
  width:14px; height:12px; border:2px solid var(--text); border-bottom:none;
  border-radius:14px 14px 0 0; top:8px;
}
.nav-btn.bell::after{ width:6px; height:6px; background:var(--text); border-radius:50%; bottom:8px; }
/* user */
.nav-btn.user{ position:relative; }
.nav-btn.user::before{
  content:""; width:14px; height:14px; border:2px solid var(--text); border-radius:50%;
  position:absolute; top:7px;
}
.nav-btn.user::after{
  content:""; width:16px; height:7px; border:2px solid var(--text); border-top:none;
  border-radius:0 0 12px 12px; position:absolute; bottom:7px;
}

/* ============ TICKER ============ */
/* ===== Marquee / Ticker ===== */
.ticker{
  display:flex; align-items:center; gap:10px;
  background:#2ea7ff; color:#fff;
  padding:8px 12px; position:relative; overflow:hidden;
 
}

.announce-icon{
  width:18px; height:18px; flex:0 0 auto; color:#fff;
}

.marquee{ flex:1 1 auto; overflow:hidden; }
.marquee__track{
  display:inline-block; white-space:nowrap;
  will-change: transform;
  animation: marquee-scroll 18s linear infinite;
}
.marquee__track > span{
  margin-right:32px; /* jarak antar item */
  opacity:.95;
}

.ticker:hover .marquee__track{ animation-play-state: paused; } /* pause saat hover */
.badge{
  flex:0 0 auto;
  background:rgba(255,255,255,.25);
  padding:4px 8px; border-radius:12px; font-size:12px;
}

/* Kecepatan marquee: ubah durasi kalau perlu */
@keyframes marquee-scroll{
  from { transform: translateX(100%); }
  to   { transform: translateX(-100%); }
}

@media (max-width:600px){
  .marquee__track{ animation-duration: 22s; } /* sedikit diperlambat di HP */
}


/* ============ CAROUSEL ============ */
.carousel{position:relative; overflow:hidden; background:#f3f6fb}
.carousel .slides{position:relative; height:180px}
.carousel .slides img{
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover;
  opacity:0; transition:opacity .5s ease;
}
.carousel .slides img.active{opacity:1}
.carousel .nav{
  position:absolute; top:50%; transform:translateY(-50%);
  background:rgba(0,0,0,.35); color:#fff; border:0; width:36px; height:36px;
  border-radius:50%; cursor:pointer
}
.carousel .prev{left:8px}
.carousel .next{right:8px}
.carousel .dots{position:absolute; left:0; right:0; bottom:8px; text-align:center}
.carousel .dots .dot{
  display:inline-block; width:8px; height:8px; border-radius:50%; margin:0 3px;
  background:rgba(255,255,255,.55); cursor:pointer
}
.carousel .dots .dot.active{background:#fff}

/* ============ HEADINGS ============ */
h1{ text-align:center; margin:18px 0; }

/* ============ TABS (Tanggal) ============ */
#tabs{
  display:flex; gap:8px; justify-content:center; align-items:center;
  flex-wrap:wrap; padding: 0 12px; margin-bottom: 12px;
}
.tab{
  display:inline-block; padding:10px 12px; background:#eee; border-radius:8px;
  cursor:pointer; font-size:14px; user-select:none; min-width:96px; text-align:center;
}
.tab.active{ background:var(--tab-active); color:#fff; font-weight:700; }

/* ============ SEARCH ============ */
.search-bar{
  display:flex; gap:8px; align-items:center; justify-content:center; margin: 10px 12px 16px;
}
#searchInput{
  flex:1; max-width: 420px; padding:10px 12px; border:1px solid #d0d0d0; border-radius:6px; font-size:14px;
}
#clearSearch{
  padding:10px 14px; border:0; border-radius:6px; background:#e0e0e0; cursor:pointer; font-size:14px;
}
#clearSearch:hover{ background:#d5d5d5; }

/* ============ TABLE RESULT ============ */
table{ width:100%; border-collapse: collapse; background:#fff; }
th, td{ padding:10px; border:1px solid #ccc; text-align:center; }
thead th{ background:#f8f8f8; font-weight:700; }
tbody tr:nth-child(odd){ background:#fcfcfc; }

.logo-img{
  width:24px; height:24px; vertical-align:middle; margin-right:8px; object-fit:contain;
}

/* angka bulat biru */
.number-balls{ display:inline-flex; gap:6px; flex-wrap:wrap; align-items:center; }
.ball{
  background: var(--ball);
  color:#fff; font-weight:700; font-size:16px;
  width:30px; height:30px; display:flex; justify-content:center; align-items:center; border-radius:50%;
}

/* ============ PAGINATION (index) ============ */
#pagination{
  text-align:center; margin:10px 0 0;
}
#pagination button{
  margin:0 4px; padding:6px 10px; border:1px solid #ddd; background:#fff; border-radius:6px; cursor:pointer;
}
#pagination button[disabled],
#pagination button.active{
  background: var(--ball); color:#fff; border-color: var(--ball);
}

/* ============ FORMS (admin/manage) ============ */
form{
  background:#fff; padding:16px; margin:16px auto; max-width:520px; border-radius:8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
form input, form select, form button{
  width:100%; padding:10px; margin-bottom:12px; font-size:16px;
}
form button{
  background: var(--ball); color:#fff; border:0; border-radius:6px; cursor:pointer;
}
form button:hover{ filter: brightness(.95); }

/* ============ MOBILE ============ */
@media (max-width: 600px){
  .carousel .slides{ height:150px; }
  th, td{ font-size:12px; }
  .ball{ width:26px; height:26px; font-size:14px; }
  #tabs{ margin-bottom: 10px; }
  .search-bar{ padding:0 8px; }
}

/* Drawer & Backdrop */
.drawer{
  position: fixed; top:0; left:0; height:100vh; width:270px;
  background:#fff; box-shadow: 2px 0 12px rgba(0,0,0,.15);
  transform: translateX(-100%); transition: transform .25s ease;
  z-index: 1100; padding: 12px;
  display:flex; flex-direction:column; gap:8px;
}
.drawer.open{ transform: translateX(0); }

.drawer-header{ font-weight:700; font-size:16px; padding:6px 4px; margin-bottom:6px; }
.drawer a{
  padding:10px 8px; border-radius:8px; color:#222; text-decoration:none;
}
.drawer a:hover{ background:#f4f4f4; }

.backdrop{
  position: fixed; inset:0; background: rgba(0,0,0,.35);
  opacity:0; pointer-events:none; transition: opacity .2s ease;
  z-index: 1090;
}
.backdrop.open{ opacity:1; pointer-events:auto; }

/* grid 3 bulatan */
.market-grid{
  display: flex;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 18px 22px;
  justify-items: center; /* pusatkan setiap kartu */
}

/* setiap kartu punya lebar tetap */
.market-card{
  width: 120px;                 /* penting: batasi lebar label */
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* bulatan/logo */
.market-card .circle{
  width: 90px; height: 90px;
  border-radius: 50%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.market-card .circle img{
  width: 68px; height: 68px; object-fit: contain;
}

/* label di bawah: wrap + tinggi seragam */
.market-card .label{
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.25;
  text-align: center;
  white-space: normal;          /* izinkan turun baris */
  overflow-wrap: anywhere;      /* paksa putus kata panjang */
  word-break: break-word;

  /* jaga tinggi sama (max 2 baris) */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;        /* potong setelah 2 baris */
  overflow: hidden;
  min-height: calc(1.25em * 2); /* ruang dua baris untuk sejajar */
}

@media (max-width: 420px){
  .market-card .circle{ width:78px; height:78px; }
  .market-card .circle img{ width:60px; height:60px; }
}

