/*--------------------------------------------------------------
# Custom Dashboard Public Styles
# File ini berisi style khusus halaman dashboard monitoring public
# Dipindahkan dari inline <style> di dashboard_public.php agar lebih rapi
--------------------------------------------------------------*/

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: url('../img/dark-forest.jpg') center/cover no-repeat fixed;
}

/* Kontainer 16:9 untuk Smart TV — isi selalu proporsional layar TV */
.dashboard-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: url('../img/dark-forest.jpg') center/cover no-repeat;
  background-attachment: fixed;
  width: 100%;
  max-width: 100vw;
}

.dashboard-wrap.tv-16-9 {
  width: 100vw;
  max-width: 177.78vh; /* 16/9 * 100vh agar tetap 16:9 saat height dibatasi */
  height: 56.25vw; /* 9/16 = 16:9 */
  max-height: 100vh;
  min-height: 0;
  margin: 0 auto;
}

.dashboard-header {
  flex-shrink: 0;
  background: transparent;
  box-shadow: none;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-header a.logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #eee;
}

.dashboard-header .logo-wrap:hover {
  color: #fff;
}

.dashboard-header .logo-wrap img {
  height: 42px;
}

.dashboard-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #198754;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
}

.dashboard-header .back-link:hover {
  background: #157347;
  color: #fff;
}

.dashboard-header .text-muted {
  color: #aaa !important;
}

.dashboard-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #eee;
  margin: 0;
}

.dashboard-body {
  flex: 1;
  padding: 20px;
  overflow: auto;
  background: transparent;
  min-height: 0;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 20px;
}

.chart-card {
  position: relative;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  box-shadow: none;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

/* Play/Pause button for pie chart animation */
.pie-play-pause-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(4px);
  transition: background 0.2s, transform 0.2s;
  padding: 0;
  line-height: 1;
}
.pie-play-pause-btn:hover {
  background: rgba(0,0,0,0.65);
  transform: scale(1.1);
}

/* ============================================================
   Line Chart Play/Pause Controls & Range Slider
   ============================================================ */
.line-play-pause-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(4px);
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  padding: 0;
  line-height: 1;
}
.line-play-pause-btn:hover {
  background: rgba(0,0,0,0.65);
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(76,175,80,0.4);
}
.line-play-pause-btn.is-playing {
  animation: line-btn-pulse 2s ease-in-out infinite;
}
@keyframes line-btn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(76,175,80,0.45); }
  50% { box-shadow: 0 0 0 7px rgba(76,175,80,0); }
}

.line-play-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 10px;
  margin-bottom: 4px;
}
.line-month-label {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  min-width: 68px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.line-month-label.visible {
  opacity: 1;
}
.line-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
  outline: none;
  cursor: pointer;
  transition: background 0.3s ease;
}
.line-range-slider:hover {
  background: rgba(255,255,255,0.28);
}
.line-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4CAF50, #81C784);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(76,175,80,0.5);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.line-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.35);
  box-shadow: 0 0 12px rgba(76,175,80,0.8);
}
.line-range-slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4CAF50, #81C784);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 6px rgba(76,175,80,0.5);
}
.line-range-slider::-moz-range-track {
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
  border: none;
}

.chart-card .chart-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.95), 0 0 3px rgba(0,0,0,0.8);
}

.chart-card .chart-subtitle {
  font-size: 11px;
  color: #fff;
  text-align: center;
  margin: 0 0 8px 0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 2px rgba(0,0,0,0.7);
}

.chart-card .chart-container {
  width: 100%;
  height: 320px;
  min-height: 320px;
  background: transparent !important;
}

.refresh-info {
  text-align: center;
  color: rgba(255,255,255,0.95);
  font-size: 13px;
  margin-top: 8px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9), 0 0 2px rgba(0,0,0,0.8);
}

/* ============================================================
   Highcharts Dark Theme Overrides
   ============================================================ */
.highcharts-data-labels text,
.highcharts-legend-item text {
  fill: #fff !important;
}

.highcharts-background {
  fill: transparent !important;
}

.highcharts-axis-labels text,
.highcharts-axis-title tspan {
  fill: #fff !important;
}

.highcharts-xaxis .highcharts-axis-line,
.highcharts-xaxis-grid .highcharts-grid-line,
.highcharts-yaxis .highcharts-axis-line,
.highcharts-yaxis-grid .highcharts-grid-line {
  stroke: rgba(255,255,255,0.35) !important;
}

.highcharts-tooltip {
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
}

.highcharts-legend-item text {
  paint-order: stroke;
  stroke: rgba(0,0,0,0.9);
  stroke-width: 2px;
}

.highcharts-data-labels text {
  paint-order: stroke;
  stroke: rgba(0,0,0,0.85);
  stroke-width: 2px;
}

.highcharts-axis-labels text {
  paint-order: stroke;
  stroke: rgba(0,0,0,0.8);
  stroke-width: 1.5px;
}

/* ============================================================
   Responsive
   ============================================================ */

/* Tablet (max-width: 768px) */
@media (max-width: 768px) {
  .chart-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-header {
    flex-wrap: wrap;
  }
  .pie-play-pause-btn,
  .line-play-pause-btn {
    width: 38px;
    height: 38px;
    font-size: 16px;
    top: 8px;
    right: 8px;
  }
  .line-month-label {
    font-size: 11px;
    min-width: 60px;
  }
}

/* Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .pie-play-pause-btn,
  .line-play-pause-btn {
    width: 44px;
    height: 44px;
    font-size: 18px;
    top: 6px;
    right: 6px;
    border-width: 1.5px;
    background: rgba(0,0,0,0.5);
  }
  .pie-play-pause-btn:hover,
  .pie-play-pause-btn:active,
  .line-play-pause-btn:hover,
  .line-play-pause-btn:active {
    background: rgba(0,0,0,0.7);
    transform: scale(1.05);
  }
  .line-range-slider::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
  }
  .line-range-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
  }
}

/* Layar lebar 16:9 (Smart TV / monitor) — sudah diatur di .tv-16-9 */

/* ============================================================
   Visitor Counter Badge
   ============================================================ */
.visitor-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.visitor-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: #ddd;
  white-space: nowrap;
}

.visitor-badge i {
  font-size: 14px;
}

.visitor-badge .vb-count {
  font-weight: 700;
  color: #fff;
}

.visitor-badge.online .vb-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  animation: blink-dot 1.5s infinite;
}

@keyframes blink-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}
