* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}

html, body { 
  height: 100%; 
  background-color: #111217;
  overflow-y: auto; /* Allow vertical scrolling */
  overflow-x: hidden; 
}

#dashboard {
  margin-left: 48px; /* Width of the collapsed sidebar */
  margin-top: 40px;  /* Height of the topbar */
  background-color: #111217;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px; /* Space between charts */
}

.disclaimer {
  display: block;
  width: 100%;
  padding: 0px 16px 5px 16px;
  margin-top: 5px;
  background: #111217; 
}

.disclaimer p {
  color: #8e8e8e; 
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 13px; 
  line-height: 1.6; 
  margin-bottom: 4px;
}

.statistics {
  display: flex;
  flex-direction: row;
  gap: 10px;
  flex: 1;
  min-width: 0; /* prevents flex children from overflowing */
  height: 300px;
}

.chart-wrapper {
  position: relative; 
  width: 100%;
  height: 500px;      
  margin-bottom: 20px;
}

.chart-wrapper-stats {
  position: relative; 
  width: 100%;
  height: 275px;      
}

.chart-wrapper-stats iframe {
  width: 100%;
  height: 100%;       
  display: block;
}

.chart-wrapper:last-of-type {
  margin-bottom: 0;
}

.chart-wrapper iframe {
  width: 100%;
  height: 100%;       
  display: block;
}

.click-shield {
  position: absolute;
  background: transparent;
  top: 0;
  right: 0;
  width: 150px;       
  height: 50px;      
  z-index: 999;       /* Sit on top of everything */
}

#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 48px;
  background: #141619;
  border-right: 1px solid #2a2d32;
  overflow: hidden;
  transition: width 0.2s ease;
  z-index: 200;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  width: 100%;
}

#sidebar a.github-link {
  margin-top: auto;         /* Pushes it to the very bottom */
  padding: 16px 14px;
  opacity: 1;               
  color: #555;              /* Highly transparent/muted state by default */
  transition: opacity 0.15s ease, color 0.15s ease;
  border-left: 2px solid transparent; /* Keeps layout alignment with other items */
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
}

#sidebar .github-icon {
  width: 18px;
  height: 18px;
}

/* Reveal the logo container ONLY when the sidebar itself is hovered */
#sidebar:hover a.github-link {
  opacity: 1; 
}

#sidebar a.github-link:hover {
  color: #ffffff;           /* Crisp white on direct hover */
}

#sidebar:hover { width: 180px; }

#sidebar a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px;
  color: #888;
  text-decoration: none;
  font-family: 'Inter', 'SF Pro Display', system-ui, sans-serif;
  font-size: 13px;
  white-space: nowrap;
  border-left: 2px solid transparent;
}

#sidebar .icon { font-size: 18px; flex-shrink: 0; }

#sidebar a:hover { color: #fff; }
#sidebar a.active { color: #00e5ff; border-left-color: #00e5ff; }

#sidebar .label {
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

#sidebar:hover .label { opacity: 1; }

.sidebar-section-label {
  display: block; 
  color: #555;
  font-size: 10px;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 14px 4px 14px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  text-align: center;
}

#sidebar:hover .sidebar-section-label {
  opacity: 1;
}



#topbar {
  position: fixed;
  top: 0;
  left: 48px;
  right: 0;
  gap: 8px;
  height: 40px;
  background: #141619;
  border-bottom: 1px solid #2a2d32;
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 199;
  overflow:visible;
}

custom-topbar, 
custom-topbar-two-coins, 
custom-topbar-sliding-windows {
  display: flex !important;       
  flex-direction: row; 
  align-items: center;
  justify-content: flex-start; /* Ensures items layout left-to-right natively */
  gap: 12px;           
  position: relative;
  width: 100%;                /* Forces the web component wrapper to take up the full topbar space */
}

.filter-group {
  display: flex;
  align-items: center;
  background: #1e2128;
  border: 1px solid #2c3140;
  border-radius: 6px;
  overflow: visible;
  flex-shrink: 0;            /* Prevents filters from aggressively expanding and pushing the button out of bounds */
}

#time-picker, #sliding-picker {
  position: relative;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
}

#time-options, #sliding-options {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #1e2228;
  border: 1px solid #2a2d32;
  border-radius: 4px;
  min-width: 160px;
  z-index: 99;
}

#time-options.open, #sliding-options.open { 
  display: block; 
}

.time-option, .sliding-option {
  padding: 8px 12px;
  color: #888;
  cursor: pointer;
  white-space: nowrap;
}

.time-option:hover, .sliding-option:hover { 
  color: #fff; 
  background: #2a2d32; 
}

.time-option.active, .sliding-option.active { 
  color: #00e5ff; 
}


#candlesize-picker {
  position: relative;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
}

#time-selected,
#candlesize-selected,
#sliding-selected {
  padding: 6px 10px;
  color: #d4d9e3;
  font-size: 13px;
  font-family: 'Inter', system-ui, sans-serif;
  cursor: pointer;
  user-select: none;
  background: transparent;
  border: none;
  white-space: nowrap;
}

#time-selected:hover,
#candlesize-selected:hover,
#sliding-selected:hover {
  background: #2c3140;
  color: #fff;
}


#candlesize-options {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #1e2228;
  border: 1px solid #2a2d32;
  border-radius: 4px;
  min-width: 160px;
  z-index: 200;
}

#candlesize-options.open { 
  display: block; 
}

.candlesize-option {
  padding: 8px 12px;
  color: #888;
  cursor: pointer;
  white-space: nowrap;
}

.candlesize-option:hover { 
  color: #fff; 
  background: #2a2d32; 
}

.candlesize-option.active { 
  color: #00e5ff; 
}


.filter-group {
  display: flex;
  align-items: center;
  background: #1e2128;
  border: 1px solid #2c3140;
  border-radius: 6px;
  overflow: visible;
}

.filter-label {
  font-size: 13px;
  color: #8e9bb5;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.02em;
  padding: 6px 10px;
  border-right: 1px solid #2c3140;
  border-radius: 5px 0 0 5px;
  background: #181b20;
  font-family: 'Inter', system-ui, sans-serif;
}



#coin-picker, #coin2-picker {
  position: relative;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
}

#coin-selected, #coin2-selected {
  padding: 6px 10px;
  color: #d4d9e3;
  font-size: 13px;
  font-family: 'Inter', system-ui, sans-serif;
  cursor: pointer;
  user-select: none;
  background: transparent;
  border: none;
  white-space: nowrap;
}

#coin-selected:hover, #coin2-selected:hover {
  background: #2c3140;
  color: #fff;
}

#coin-options, #coin2-options {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #1e2228;
  border: 1px solid #2a2d32;
  border-radius: 4px;
  min-width: 160px;
  max-height: 260px;   /* ~8 visible options */
  overflow-y: auto;
  z-index: 200;
}

#coin-options.open, #coin2-options.open { 
  display: block; 
}

.coin-option, .coin2-option {
  padding: 8px 12px;
  color: #888;
  cursor: pointer;
  white-space: nowrap;
}

.coin-option:hover, .coin2-option:hover { 
  color: #fff; background: #2a2d32; 
}
.coin-option.active, .coin2-option.active { 
  color: #00e5ff; 
}


#coin-options, #coin2-options {
  scrollbar-width: thin;                        /* Firefox */
  scrollbar-color: #2c3140 transparent;         /* Firefox: thumb track */
}

#coin-options::-webkit-scrollbar, #coin2-options::-webkit-scrollbar {
  width: 6px;
}

#coin-options::-webkit-scrollbar-track, #coin2-options::-webkit-scrollbar-track {
  background: transparent;
}

#coin-options::-webkit-scrollbar-thumb, #coin2-options::-webkit-scrollbar-thumb {
  background: #2c3140;
  border-radius: 3px;
}

#coin-options::-webkit-scrollbar-thumb:hover, #coin2-options::-webkit-scrollbar-thumb:hover {
  background: #3d4459;
}



iframe {
  display: block;
  width: 100%;       /* Fill the container width */
  height: 500px;     
  border: none;
  border-radius: 4px;
  background: #141619; /* Match Grafana background while loading */
}


@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

#candle-error-popup {
  display: none;
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;

  background: #1a1d21;
  border: 1px solid #f59e0b;
  border-left: 3px solid #f59e0b;
  color: #f59e0b;

  padding: 10px 16px;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);

  font-family: Inter, 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;

  align-items: center;
  gap: 8px;
}

#candle-error-popup.visible {
  display: flex;
  animation: slideDown 0.18s ease-out forwards;
}

