/* ============================================
   PREMIUM FEATURES - 3Lensa
   ============================================ */

#reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, #c8102e, #ff6b6b);
  width: 0%;
  z-index: 9999;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(200, 16, 46, 0.5);
}

#back-to-top {
  position: fixed;
  bottom: 30px; right: 30px;
  width: 50px; height: 50px;
  background: #c8102e;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(200, 16, 46, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}
#back-to-top.show { opacity: 1; visibility: visible; }
#back-to-top:hover { background: #a00d24; transform: translateY(-3px); box-shadow: 0 6px 20px rgba(200, 16, 46, 0.5); }

#wa-floating {
  position: fixed;
  bottom: 90px; right: 30px;
  width: 55px; height: 55px;
  background: #25d366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  z-index: 9998;
  transition: all 0.3s;
  animation: wa-pulse 2s infinite;
}
#wa-floating:hover { transform: scale(1.1); background: #1eb856; }
#wa-floating svg { width: 30px; height: 30px; }
@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4); }
  50% { box-shadow: 0 4px 25px rgba(37, 211, 102, 0.8); }
}

body.dark-mode { background: #1a1a1a; color: #e5e5e5; }
body.dark-mode .header,
body.dark-mode .topbar-admin,
body.dark-mode .card-admin { background: #2a2a2a; color: #e5e5e5; }
body.dark-mode .card,
body.dark-mode .editor-card { background: #2a2a2a; color: #e5e5e5; }
body.dark-mode .card h3,
body.dark-mode .editor-card h3 { color: #fff; }
body.dark-mode .section-title { color: #fff; }
body.dark-mode .nav a,
body.dark-mode .topbar-links a { color: #ccc; }
body.dark-mode .form-control,
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select { background: #2a2a2a; color: #fff; border-color: #444; }
body.dark-mode .footer { background: #0a0a0a; }
body.dark-mode .footer a { color: #aaa; }

#dark-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  transition: all 0.3s;
}
#dark-toggle:hover { background: rgba(200, 16, 46, 0.1); color: #c8102e; }

#font-controls {
  position: fixed;
  left: 20px; top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border-radius: 30px;
  padding: 8px 5px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  z-index: 9997;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
#font-controls button {
  width: 38px; height: 38px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 700;
  color: #333;
  font-family: inherit;
  transition: all 0.2s;
  font-size: 15px;
}
#font-controls button:hover { background: #f5f5f5; color: #c8102e; }
#font-controls button.active { background: #c8102e; color: #fff; }

body.dark-mode #font-controls { background: #2a2a2a; }
body.dark-mode #font-controls button { color: #ccc; }
body.dark-mode #font-controls button:hover { background: #333; color: #c8102e; }
body.dark-mode #font-controls button.active { background: #c8102e; color: #fff; }

.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #666;
  background: #f5f5f5;
  padding: 4px 10px;
  border-radius: 15px;
}
body.dark-mode .reading-time { background: #333; color: #aaa; }

.popular-sidebar {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.popular-sidebar h3 {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #c8102e;
}
.popular-sidebar .item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: inherit;
}
.popular-sidebar .item:last-child { border-bottom: none; }
.popular-sidebar .item .num {
  font-size: 24px;
  font-weight: 900;
  color: #c8102e;
  opacity: 0.3;
  line-height: 1;
}
.popular-sidebar .item h4 {
  font-size: 14px;
  line-height: 1.4;
  margin: 0 0 5px;
}
.popular-sidebar .item:hover h4 { color: #c8102e; }
.popular-sidebar .item small { color: #888; font-size: 12px; }

.layout-with-sidebar {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}
@media (max-width: 1024px) { .layout-with-sidebar { grid-template-columns: 1fr; } }

@media (max-width: 640px) {
  #font-controls { left: 10px; padding: 5px 3px; }
  #font-controls button { width: 32px; height: 32px; font-size: 13px; }
  #back-to-top { bottom: 20px; right: 20px; width: 45px; height: 45px; }
  #wa-floating { bottom: 75px; right: 20px; width: 50px; height: 50px; }
}
/* ============ DARK MODE TOGGLE (SVG) ============ */
#dark-toggle {
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1a1a1a;
  transition: all 0.25s ease;
  position: relative;
  padding: 0;
}

#dark-toggle:hover {
  background: #f5f5f5;
  color: #c8102e;
  transform: rotate(15deg);
}

#dark-toggle svg {
  position: absolute;
  transition: all 0.35s ease;
}

/* Default (light mode) → tampilkan bulan */
#dark-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
#dark-toggle .icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

/* Dark mode aktif → tampilkan matahari */
body.dark-mode #dark-toggle .icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}
body.dark-mode #dark-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
body.dark-mode #dark-toggle {
  color: #ffd966;
}
body.dark-mode #dark-toggle:hover {
  background: #333;
  color: #ffd966;
}