/*
  SPARK accent-only overlay for DivumWX.
  Important: this file should NOT globally repaint normal DivumWX cards.
  Normal DivumWX cards keep their native title/footer structure.
  Only custom cards use SPARK panel header/footer treatment.
*/

:root {
  --spark-purple: #46148B;
  --spark-orange: #FA792F;
  --spark-orange-soft: rgba(250, 121, 47, 0.34);
  --spark-dvm-bar: rgba(178, 204, 244, 0.88);
  --spark-orange-strong: rgba(250, 121, 47, 0.52);
}

/* Scrollbar only */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--spark-orange) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--spark-purple), var(--spark-orange));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* General link hover accent only. Do not change card shell colors globally. */
.cardP a:hover,
.module a:hover,
#sidemenu a:hover,
.sidenav a:hover,
.menu a:hover,
.sidepanel a:hover {
  color: var(--spark-orange) !important;
}

.spark-panel-dot,
.spark-camera-v2-dot {
  color: var(--spark-orange) !important;
}

/* Webcam is a custom double-height tile. */
.card-container .cardP.cardP-webcam {
  grid-row: span 2 !important;
  height: 420px !important;
  min-height: 420px !important;
  overflow: hidden !important;
}

/* Only custom cards remove the DivumWX shell border bands because they render their own header/footer. */
.card-container .cardP.cardP-webcam,
.card-container .cardP.cardP-custom {
  border-top-width: 0 !important;
  border-bottom-width: 0 !important;
  overflow: hidden !important;
}

.card-container .cardP.cardP-webcam > .module,
.card-container .cardP.cardP-webcam #position10,
.card-container .cardP.cardP-custom > .module,
.card-container .cardP.cardP-custom [id^="position"] {
  height: 100% !important;
  max-height: none !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* Shared custom card layout. */
.spark-custom-panel,
.spark-custom-panel * {
  box-sizing: border-box;
}

.spark-custom-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden !important;
  display: grid;
  grid-template-rows: 24px minmax(0, 1fr) 24px;
  padding: 0;
  margin: 0;
}

.spark-custom-panel-title {
  height: 24px;
  line-height: 24px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--spark-dvm-bar);
  color: inherit;
  padding: 0 8px;
}

.spark-custom-panel-body {
  min-height: 0;
  overflow: hidden !important;
  position: relative;
  padding: 6px 8px;
}

.spark-custom-panel-footer {
  height: 24px;
  line-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow: hidden;
  white-space: nowrap;
  background: var(--spark-dvm-bar);
  padding: 0 8px;
  font-size: 12px;
}

.spark-custom-panel-footer a,
.spark-custom-panel-footer span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Webcam module v2. */
#position10 .spark-camera-v2,
#position10 .spark-camera-v2 * {
  box-sizing: border-box;
}

#position10 .spark-camera-v2 {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden !important;
  display: grid;
  grid-template-rows: 24px minmax(0, 1fr) 24px;
  padding: 0;
  margin: 0;
}

#position10 .spark-camera-v2-title {
  height: 24px;
  line-height: 24px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  background: var(--spark-dvm-bar);
  color: inherit;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0 8px;
}

#position10 .spark-camera-v2-body {
  position: relative;
  min-height: 0;
  overflow: hidden !important;
  padding: 10px 12px;
}

#position10 .spark-camera-v2-frame {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(250, 121, 47, 0.42);
  background: #0f1118;
}

#position10 .spark-camera-v2-link,
#position10 .spark-camera-v2-img {
  display: block;
  width: 100%;
  height: 100%;
}

#position10 .spark-camera-v2-img {
  object-fit: cover;
  object-position: center 58%;
  border: 0;
}

#position10 .spark-camera-v2-footer {
  height: 24px;
  line-height: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow: hidden;
  white-space: nowrap;
  background: var(--spark-dvm-bar);
  padding: 0 8px;
  font-size: 12px;
}

#position10 .spark-camera-v2-footer a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  font-weight: 600;
}

#position10 .spark-camera-v2-footer a:hover {
  color: var(--spark-orange) !important;
}

#position10 .spark-camera-v2-dot {
  color: var(--spark-orange);
  font-size: 11px;
  line-height: 1;
  flex: 0 0 auto;
}

/* === SPARK FINAL: sync custom tile bars to active DivumWX theme ===
   JS samples the native DivumWX title/footer bar and sets:
   --spark-live-bar-bg / --spark-live-bar-fg / --spark-live-bar-border.
*/
:root {
  --spark-live-bar-bg: var(--spark-dvm-bar, rgba(178, 204, 244, 0.88));
  --spark-live-bar-fg: inherit;
  --spark-live-bar-border: rgba(70, 20, 139, 0.22);
}

.cardP.cardP-webcam #position10 .spark-camera-v2-title,
.cardP.cardP-webcam #position10 .spark-camera-v2-footer,
.cardP.cardP-custom .spark-custom-panel-title,
.cardP.cardP-custom .spark-custom-panel-footer {
  background: var(--spark-live-bar-bg) !important;
  color: var(--spark-live-bar-fg) !important;
  border-color: var(--spark-live-bar-border) !important;
}

.cardP.cardP-webcam #position10 .spark-camera-v2-title,
.cardP.cardP-custom .spark-custom-panel-title {
  border-bottom: 1px solid var(--spark-live-bar-border) !important;
}

.cardP.cardP-webcam #position10 .spark-camera-v2-footer,
.cardP.cardP-custom .spark-custom-panel-footer {
  border-top: 1px solid var(--spark-live-bar-border) !important;
}

.cardP.cardP-webcam,
.cardP.cardP-custom {
  border-color: var(--spark-live-bar-border) !important;
}
