
html, body {
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    background: var(--body-background);
    font-family: var(--main-font);
    line-height: var(--line-height);
	overflow: hidden;
}

#container {
    width: 100%;
    height: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	padding: 1rem;
	gap: 1rem;
	position: fixed;
	top:0;
	left:0;
	z-index: 1000;
	min-height: 100vh;
	overflow-y: auto;
	height: 100vh;
	width: 30rem;
	background: var(--sidebar-bg);
	transition: all 0.3s;
}

.sidebar-scroll {
	scrollbar-width: thin;
	scrollbar-color: rgba(255,255,255,0.3) rgba(0,0,0,0.1);
}

.nosidebar {
	left: -30rem;
}

.side-section {
	display: flex;
	text-align: center;
	justify-content: space-between;
	align-items: center;
}

.nav-list {
	font-size: 0.95rem;
	color: var(--main-font-color);
	padding: 0;
	margin: 0;
}

.nav-list li {
	list-style-type: none;
	margin-bottom: 0.5rem;
	display: flex;
	flex-wrap: wrap;
	border-radius: 0.375rem;
	background-color: var(--section-background-color);
}

.nav-section-header {
	display: flex;
	justify-content: space-between;
	font-size: 1rem;
	cursor: pointer;
	width: 100%;
	padding: 0.7rem 1rem;
	color: var(--section-header-font-color);
}

.nav-section-header .chevron::before {
  content: "\25BF";
  color: #aaa;
  margin: auto 0;
}
.nav-section-header.unfold .chevron::before {
  content: "\25B5";
}

.nav-section-header ~ div {
	max-height: 0;
	height: auto;
	overflow: hidden;
	padding: 0 1rem;
	border-top: none;
	transition: max-height 0.3s, padding 0.3s;
}

.nav-section-header.unfold ~ div {
	max-height: 100vh;
	height: auto;
	padding: 1rem;
	border-top: solid 1px var(--section-header-sep-color);
}

.nav-client-status {
  width: 100%;
	display: flex;
  justify-content: space-between;
}

.nav-client-status div {
  width: 50%;
  text-align: left;
}

#sidebar-client-status {
  font-style: italic;
}


#doc {
	padding: 0;
}

.doc-url-params {
	text-align: left;
	overflow: auto;
	height: 30rem;
	padding: 1rem;
}
.doc-url-params li {
	display: block;
	padding: 0;
	background-color: #fff0;
}
.doc-url-params h2 {
	margin: 0;
	font-size: 1rem;
}

#sidebar-logo {
	flex-grow: 1;
	height: 3rem;
	margin: 1rem;
	background: var(--logo-pic);
	background-size: contain;
	background-repeat: no-repeat;
}

#pin-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin: 8px;
  font-size: 13px;
  user-select: none;
  color: #333;
}

#pin_sidebar_checkbox {
  width: 18px;
  height: 18px;
  accent-color: #333; /* square checked color */
  cursor: pointer;
}

#hide_sidebar_btn {
	position: absolute;
	bottom: 3%;
	left: 3%;
	background: none;
	border: none;
	text-decoration: none;
	color: black;
	font-size: 2rem;
}

.params-section {
	text-align: left;
	width: 100%;
}

.params-section .input-row {
	display: flex;
	flex-wrap: nowrap;
	text-align: left;
	justify-content: left;
	padding-bottom: 0.5rem;
}

.params-section label {
	width: 50%;
}

.params-section input[type=text],
.params-section input[type=number],
.params-section input[type=password],
.params-section select {
	color: var(--main-font-color);
	width: 50%;
	padding: 0.2rem 0 0.2rem 0.3rem;
	display: inline-block;
	border: var(--input-border);
	border-radius: 4px;
	box-sizing: border-box;
}

.params-section input[type=checkbox] {
	accent-color: var(--input-active-color);
}


.actions {
	display: flex;
	justify-content: space-between;
	width: 100%;
}

.actions input[type=button] {
	background-color: var(--button-background-color);
	border: var(--input-border);
	border-radius: 6px;
	box-shadow: #fff5 1px 1px 5px inset;
	box-sizing: border-box;
	color: var(--section-header-font-color);
	cursor: pointer;
	font-family: var(--button-font-family);
	font-size: 0.8rem;
	line-height: var(--line-height);
	padding: 0.25rem 0.8rem;
	transition: background-color 0.2s;
}

.actions input[type=button]:hover {
	background-color: var(--button-hover-color);
}
.actions input[type=button]:active {
	background-color: var(--button-active-background-color);
	color: var(--button-active-font-color);
}

.information {
	width: 100%;
}

#audio-notice {
	position: absolute;
	inset: 0;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	z-index: 5000;
}

#audio-notice:not([hidden]) {
	display: flex;
}

.metrics-section {
  margin-top: 15px;
  padding: 15px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #ddd;
  color: #333;
}

.metrics-section h3 {
  margin: 0 0 10px 0;
  font-size: 13px;
  color: #333;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#metricsChart {
  width: 100% !important;
  height: 120px !important;
  margin-bottom: 10px;
}

.metrics-stats {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #555;
  padding: 5px 0;
  border-bottom: 1px solid #eee;
  width: 100%;
}

.stat-item:last-child {
  border-bottom: none;
}

.stat-label {
  color: #230247;
}

#latency-value,
#bitrate-value {
  color: #230247;
  font-weight: 600;
}

.stat-segments {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 12px;
  padding-left: 10px;
  border-left: 2px solid #ccc;
  margin-top: 4px;
  margin-bottom: 4px;
}

.stat-item.small {
  font-size: 11px;
  color: #777;
  border-bottom: none;
  padding: 2px 0;
}

.stat-item.small .stat-label {
  font-weight: normal;
}

/* Pills toggles */
.metrics-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.metric-pill {
  opacity: 0.45;
  border-color: transparent;
}

.metric-pill[data-active="true"] {
  opacity: 1;
  border-color: #FFFFFF00;
}

.metric-pill:active {
  transform: scale(0.98);
}

.metric-pill.encoding   { border-left-color: #FF7F50; }
.metric-pill.encoded    { border-left-color: #9B59B6; }
.metric-pill.sent       { border-left-color: #E63946; }
.metric-pill.received   { border-left-color: #F1A7A7; }
.metric-pill.decoding   { border-left-color: #A8DADC; }
.metric-pill.decoded    { border-left-color: #457B9D; }
.metric-pill.prepared   { border-left-color: #1D3557; }
.metric-pill.displayed  { border-left-color: #F1C40F; }
.metric-pill.skipped    { border-left-color: #2ECC71; }
.metric-pill.lat_server    { border-left-color: #1e40af; }
.metric-pill.lat_network    { border-left-color: #d97706; }
.metric-pill.lat_client    { border-left-color: #166534; }

.metrics-graph-options {
  margin-top: 15px;
  border-top: 1px solid #ccc;
  padding-top: 10px;

  label {
    display: flex;
    align-items: baseline;
    cursor: pointer;
    gap: 8px;
  }
}

#graph-overlay-wrapper {
  width: 100%;
  margin-top: 10px;
  position: relative;
  transition: all 0.3s ease;
}
/* readability */
#graph-overlay-wrapper.hud-active {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 250px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  padding: 15px;
  z-index: 9999;
  pointer-events: none;
  backdrop-filter: none;
}

#graph-overlay-wrapper.hud-active .stat-item,
#graph-overlay-wrapper.hud-active .stat-label,
#graph-overlay-wrapper.hud-active span {
  color: #fff !important;
  text-shadow: 1px 1px 2px #000;
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

#graph-overlay-wrapper.hud-active .stat-segments {
  border-left-color: rgba(255, 255, 255, 0.4);
}

#graph-overlay-wrapper.hud-active .stat-item.small {
  color: #ddd !important;
}
