
/* ============================================
   FULLSCREEN ARTICLE + ADS LAYOUT
   ============================================ */

/* ============================================
   ARTICLE FULLSCREEN MODE
   ============================================ */
body.article-fullscreen .app-header,
body.article-fullscreen .bottom-nav,
body.article-fullscreen .theme-toggle,
body.article-fullscreen #pwa-install-btn {
  display: none !important;
}

body.article-fullscreen {
  padding-bottom: 0 !important;
  padding-top: 0 !important;
  background: #f7f8fa;
}

body.article-fullscreen .app-main {
  max-width: 100% !important;
  padding: 12px 12px 100px !important;
}

/* Custom topbar untuk article fullscreen */
.article-fullscreen-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1.5px solid rgba(0,0,0,0.05);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.article-fullscreen-bar .fs-logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #58cc02, #89e219);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  color: white;
  box-shadow: 0 4px 12px rgba(88,204,2,0.3);
  flex-shrink: 0;
}
.article-fullscreen-bar .fs-title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 900;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.article-fullscreen-bar .fs-coins {
  display: flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(251,191,36,0.35);
}
.article-fullscreen-bar .fs-menu-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #f3f4f6;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: all 0.2s;
}
.article-fullscreen-bar .fs-menu-btn:active {
  transform: scale(0.92);
}

/* ============================================
   AD SLOTS
   ============================================ */
.ad-slot {
  width: 100%;
  min-height: 60px;
  margin: 16px 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border: 1.5px dashed rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  padding: 8px;
  transition: all 0.3s;
}

.ad-slot::before {
  content: 'SPONSOR';
  position: absolute;
  top: 6px;
  left: 12px;
  font-size: 8px;
  font-weight: 900;
  color: #999;
  letter-spacing: 1px;
  text-transform: uppercase;
  z-index: 1;
}

.ad-slot.ad-loaded {
  border-style: solid;
  border-color: rgba(88,204,2,0.15);
  background: white;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.ad-slot.ad-loaded::before {
  color: #58cc02;
}

/* Ad slot variants */
.ad-slot-top {
  margin-top: 4px;
  margin-bottom: 20px;
  min-height: 100px;
}
.ad-slot-middle {
  min-height: 250px;
  margin: 24px 0;
}
.ad-slot-bottom {
  min-height: 100px;
  margin-top: 24px;
}
.ad-slot-inline {
  min-height: 60px;
  margin: 16px 0;
}

/* Banner ad inside list */
.ad-slot-between-cards {
  margin: 8px 0;
  min-height: 80px;
}

/* ============================================
   STICKY BOTTOM AD (Mobile friendly)
   ============================================ */
.sticky-bottom-ad {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1.5px solid rgba(0,0,0,0.06);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  display: none;
}
.sticky-bottom-ad.show {
  display: block;
}

.sticky-bottom-ad-close {
  position: absolute;
  top: -10px;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.sticky-bottom-ad-content {
  min-height: 50px;
  max-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ============================================
   ARTICLE LIST DENGAN ADS
   ============================================ */
.article-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] .article-fullscreen-bar {
  background: rgba(20,20,20,0.95);
  border-bottom-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .article-fullscreen-bar .fs-title {
  color: #f3f4f6;
}
[data-theme="dark"] .article-fullscreen-bar .fs-menu-btn {
  background: #1f1f1f;
  color: #f3f4f6;
}
[data-theme="dark"] .ad-slot {
  background: linear-gradient(135deg, #1a1a1a, #1f1f1f);
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .ad-slot.ad-loaded {
  background: #1f1f1f;
}
[data-theme="dark"] .sticky-bottom-ad {
  background: rgba(20,20,20,0.98);
  border-top-color: rgba(255,255,255,0.06);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
  .article-fullscreen-bar {
    padding: 8px 12px;
  }
  .article-fullscreen-bar .fs-logo {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  .article-fullscreen-bar .fs-title {
    font-size: 14px;
  }
  .article-fullscreen-bar .fs-coins {
    padding: 5px 10px;
    font-size: 11px;
  }
  .article-fullscreen-bar .fs-menu-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  .ad-slot-top {
    min-height: 80px;
  }
  .ad-slot-middle {
    min-height: 200px;
  }
}

/* Hide ad saat load gagal */
.ad-slot.ad-failed {
  display: none !important;
}
