/* =============================================
   features.css — Cuaca, Grafik, BG Selector
   ============================================= */

/* ════ BG TOGGLE BUTTON ════ */
#bgToggleBtn {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 300;
  background: rgba(13,27,42,0.85);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  writing-mode: vertical-rl;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-family: 'DM Mono', monospace;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
}
#bgToggleBtn:hover { border-color: var(--red); color: var(--red); }

/* ════ BG PANEL ════ */
#bgPanel {
  position: fixed;
  right: -340px;
  top: 0;
  bottom: 0;
  width: 320px;
  z-index: 800;
  background: rgba(10,14,20,0.97);
  border-left: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(24px);
  overflow-y: auto;
  transition: right 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
  padding: 24px 20px;
}
#bgPanel.open { right: 0; }

.bgp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.bgp-header span {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.bgp-close {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.4);
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 12px;
  border-radius: 3px;
  transition: all 0.2s;
}
.bgp-close:hover { border-color: var(--red); color: var(--red); }

.bgp-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.bgp-item {
  background: none;
  border: 1px solid rgba(255,255,255,0.07);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s;
  text-align: center;
}
.bgp-item:hover { border-color: rgba(255,255,255,0.2); }
.bgp-item.active { border-color: var(--red); }
.bgp-preview {
  width: 100%;
  height: 52px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bgp-preview span { font-size: 18px; }
.bgp-item > span {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.5px;
}

.bgp-opacity {
  margin-bottom: 16px;
}
.bgp-opacity label {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: rgba(255,255,255,0.35);
  display: block;
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.bgp-opacity input[type="range"] {
  width: 100%;
  accent-color: var(--red);
}

.bgp-upload-area {
  border: 2px dashed rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 20px;
  text-align: center;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.bgp-upload-area:hover { border-color: rgba(192,57,43,0.5); }
.bgp-upload-label {
  cursor: pointer;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
}
.bgp-upload-label small { font-size: 11px; color: rgba(255,255,255,0.25); }

.bgp-yt-wrap { padding: 4px 0; }
.bgp-yt-wrap label {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: rgba(255,255,255,0.35);
  letter-spacing: 1px;
  display: block;
  margin-bottom: 8px;
}
.bgp-yt-row { display: flex; gap: 8px; margin-bottom: 8px; }
.bgp-yt-row input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 9px 12px;
  color: #fff;
  font-size: 13px;
  outline: none;
  border-radius: 4px;
}
.bgp-yt-row button {
  background: var(--red);
  border: none;
  color: #fff;
  padding: 9px 14px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
}
.bgp-yt-wrap small { font-size: 11px; color: rgba(255,255,255,0.25); line-height: 1.5; display: block; }


/* ════ WEATHER WIDGET ════ */
#weatherWidget {
  background: rgba(13,27,42,0.85);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  color: #fff;
  overflow: hidden;
  transition: all 0.3s;
}

.ww-main { padding: 20px; }

.ww-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.ww-city {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 1px;
  display: block;
  margin-bottom: 3px;
}
.ww-time {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.5px;
}
.ww-live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #39ff14;
  animation: wwPulse 2s infinite;
  margin-top: 4px;
}
@keyframes wwPulse { 0%,100%{opacity:1}50%{opacity:0.3} }

.ww-center {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.ww-icon { font-size: 48px; line-height: 1; }
.ww-temp {
  font-family: 'Playfair Display', serif;
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  display: block;
  color: #fff;
}
.ww-feel {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  display: block;
  margin-top: 2px;
}
.ww-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  display: block;
  margin-top: 4px;
}

.ww-details {
  display: flex;
  gap: 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 14px;
}
.ww-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
  font-size: 11px;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.ww-detail:last-child { border-right: none; }
.ww-detail span:nth-child(2) { font-size: 13px; font-weight: 600; }
.ww-detail span:nth-child(3) { color: rgba(255,255,255,0.35); font-size: 10px; }

.ww-forecast {
  display: flex;
  gap: 0;
}
.ww-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  padding: 8px 0;
  border-right: 1px solid rgba(255,255,255,0.04);
}
.ww-day:last-child { border-right: none; }

.ww-error {
  padding: 24px;
  text-align: center;
  color: rgba(255,255,255,0.4);
}
.ww-error span { font-size: 32px; display: block; margin-bottom: 8px; }
.ww-error small { font-size: 11px; }

/* Weather Chart */
.weather-chart-wrap {
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(255,255,255,0.04);
  height: 160px;
}
.weather-chart-label {
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  margin-bottom: 10px;
}
#weatherChartCanvas { width: 100% !important; height: 120px !important; }


/* ════ GRAFIK SECTION ════ */
#grafik {
  background: var(--navy);
  padding: 100px 0;
}
#grafik .section-tag  { color: var(--gold); border-color: rgba(201,168,76,0.3); }
#grafik .section-title { color: #fff; }
#grafik .section-desc  { color: rgba(255,255,255,0.4); }

.grafik-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 48px;
}
.grafik-full { grid-column: span 2; }

.chart-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 24px;
  border-radius: 4px;
}
.chart-card h4 {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  color: #fff;
  margin-bottom: 4px;
}
.chart-card p {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  margin-bottom: 20px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 1px;
}
.chart-card canvas {
  width: 100% !important;
  height: 220px !important;
}
.chart-card.tall canvas {
  height: 260px !important;
}

/* ════ HERO OVERLAY ════ */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,14,20,0.60);
  z-index: 1;
  pointer-events: none;
}
.yt-bg-frame {
  position: absolute;
  border: none;
  z-index: 0;
  pointer-events: none;
}

/* ════ RESPONSIVE ════ */
@media (max-width: 1024px) {
  .grafik-grid { grid-template-columns: 1fr; }
  .grafik-full { grid-column: span 1; }
}
@media (max-width: 768px) {
  #bgPanel { width: 280px; }
  #bgToggleBtn { top: auto; bottom: 80px; writing-mode: horizontal-tb; }
  .grafik-grid { gap: 16px; }
}
