/* responsive.css */

/* Base reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #1a1a1a;
  color: #fff;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #111;
  border-bottom: 1px solid #2a2d31;
}

header span {
  font-weight: bold;
  font-size: 20px;
}

/* Utility classes */
.hidden {
  display: none !important;
}

.inline {
  display: inline-flex;
  align-items: center;
}

.input-4digit {
  width: 80px;         /* width fits 4 characters */
  /* font-size: 1.2rem; */
  text-align: center;  /* center digits */
  letter-spacing: 2px; /* optional spacing between digits */
  padding: 2px;
}
.half-width {
  width: 50%;
  box-sizing: border-box; /* keeps padding/border inside the 50% */
}
.global-audio-controls-header {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  align-items: center;
  padding: 0.2rem;
  background: #2d2d2d;
  border-radius: 8px;
  justify-content: center;
  overflow-x: auto;
  
}
.global-audio-controls-header  button {
  padding: 0.4rem;
  background: #3a3a3a;
  border: 1px solid #555;
  border-radius: 4px;
  color: white;
  font-size: 0.8rem;
  white-space: nowrap;
  padding: 0.1rem;
  gap: 0.2rem;
}
.global-audio-controls-header label {
  font-size: 1.2rem;
  color: #9aa0a6;
  white-space: nowrap;
}
.global-audio-controls-header span {
  font-weight: bold;
  font-size: 24px;
  padding: 0.4rem;
}

.global-audio-controls {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.1rem;
  align-items: center;
  padding: 0.1rem;
  background: #2d2d2d;
  border-radius: 8px;
  justify-content: center;
  overflow-x: auto;
}
.global-audio-controls label {
  font-size: 0.8rem;
  color: #9aa0a6;
  white-space: nowrap;
}

.global-audio-controls input[type="range"] {
  width: 80px;
}

.global-audio-controls input[type="number"] {
  width: 60px;
  padding: 0.3rem;
}

.global-audio-controls button {
  padding: 0.4rem;
  background: #3a3a3a;
  border: 1px solid #555;
  border-radius: 4px;
  color: white;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* Button */
.openModalBtn {
  padding: 4px;
  padding: 1px;
  background: #4d4d4d;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
.openModalBtn:hover {
  background: #005ea0;
}

/* Modal overlay */
.modal {
  display: none; 
  position: fixed; 
  z-index: 1000; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  overflow: auto;
  background-color: rgba(0,0,0,0.5); 
}

/* Modal content */
.modal-content {
  background: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Close button */
.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}
.close:hover {
  color: black;
}

/* .controls-left label,
.controls-left button {
  display: block;
  margin: 10px 0;
}

.quick-add {
  margin-top: 20px;
}

.quick-add button {
  margin: 5px 0;
} */

.shape-picker {
  display: flex;
  gap: 5px;
  margin-top: 10px;
}

/* Layout */
main {
  display: flex;
  gap: 12px;
  padding: 12px;
  width:100%
}


/* .sidebar {
  width: 280px;
  background: #1f2226;
  border-left: 1px solid #2a2d31;
  padding: 12px;
  overflow-y: auto;
} */

/* Canvas area */
.canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.canvas-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  border-radius: 8px;
  padding: 8px;
}

canvas {
  width: 100%;
  height: auto;
  max-height: 70vh;
}

/* Footer */
footer {
  background: #111;
  padding: 10px 16px;
  font-size: 13px;
  border-top: 1px solid #2a2d31;
  text-align: center;
}

.footer-links a {
  color: #9aa0a6;
  text-decoration: none;
  margin: 0 6px;
}

.footer-links a:hover {
  text-decoration: underline;
}


/* .bin-list li { */
  /* display: flex; */
  /* align-items: center; */
  /* gap: 8px; */
  /* margin-bottom: 6px; */
/* } */

/* Modal base */
.bins-overlay,
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  z-index: 9000;
}

.bins-overlay.open,
.sidebar-overlay.open {
  display: block;
}

/* Bins modal */
.bins-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 70%;
  background: #1f2226;
  border-radius: 12px 12px 0 0;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 10000;
  overflow-y: auto;
}

.bins-modal.open {
  transform: translateY(0);
}

.bins-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #2a2d31;
}

.bins-modal-title {
  font-size: 16px;
}

.bins-modal-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

/* Sidebar with popup functionality */
.sidebar {
  width: 250px;
  background: #2d2d2d;
  border-radius: 8px;
  padding: 0.8rem;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-popup-toggle {
  display: none;
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1000;
  padding: 0.5rem;
  background: #0066cc;
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 0.8rem;
}

.sidebar h3 {
  margin: 0.8rem 0 0.4rem 0;
  font-size: 0.9rem;
  color: #ccc;
}

.sidebar h3:first-child {
  margin-top: 0;
}

/* Sidebar popup (mobile) */
/* .sidebar { */
  /* position: fixed; */
  /* top: 0; */
  /* right: -320px; */
  /* width: 280px; */
  /* height: 100%; */
  /* background: #1f2226; */
  /* transition: right 0.3s ease; */
  /* z-index: 10000; */
/* } */

/* .sidebar.open { */
  /* right: 0; */
/* } */

.hideFromDesktop{
	display: none !important; /* replaced by bins modal */
}

/* Collapsible bins styling */
.bins {
  width: 220px;
  background: #1f2226;
  border-right: 1px solid #2a2d31;
  padding: 12px;
  overflow-y: auto;
}

/* Collapsible bin sections (accordion on mobile) */
.bins section h3,
.bins-modal-content h4 {
  font-size: 15px;
  padding: 0;
  margin:0;
  background: #2a2d31;
  border-radius: 6px;

  cursor: pointer;
}

.bins section ul,
.bins-modal-content ul {
  margin: o;
  padding:0;
  list-style: none;
}

.bin-list {
  list-style: none;
  margin-bottom: 0;
}
.bin-list li {
  padding: 0.4rem;
  background: #3a3a3a;
  margin-bottom: 0;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0;
}

.bin-list li:hover {
  background: #4a4a4a;
}

.bins section h3 {
  margin: 0;
  padding: 10px 12px;
  background: #2a2d31;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.bins section h3::after {
  content: "▼";
  transition: transform 0.3s ease;
  font-size: 12px;
}

.bins section.collapsed h3::after {
  transform: rotate(-90deg);
}

.bins .bin-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: 500px;
  overflow-y: auto;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.bins section.collapsed .bin-list {
  max-height: 0;
  padding: 0;
  overflow: hidden;
}







/* Mobile responsiveness */
@media (max-width: 768px) {
  main {
    flex-direction: column;
    padding: 8px;
  }

  .bins {
    display: none !important; /* replaced by bins modal */ 
  }
  .hideFromDesktop{
	display: block !important; /* replaced by bins modal */
  }
  .hideFromMobile{
	display: none !important; /* replaced by bins modal */
  }

  /* .sidebar { */
    /* border-left: none; */
  /* } */

  .canvas-wrapper {
    max-height: 80vh;
    padding: 4px;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .openModalBtn {
    margin-left: 0;
    /* margin-right: 6px; */
  }

  footer {
    font-size: 12px;
    padding: 8px;
  }
}

.bin-thumb {
  width: 40px;   /* smaller width */
  height: auto;  /* keep aspect ratio */
  max-height: 60px;
  object-fit: contain;
  border-radius: 6px;
  background: #111;
}

.video-popup {
  display: none; /* hidden by default */
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
}

.video-popup-content {
  position: relative;
  max-width: 90%;
  max-height: 80%;
}

#popupVideo {
  width: 100%;
  height: auto;
  background: black;
  border-radius: 8px;
}

.video-popup-close {
  position: absolute;
  top: -30px;
  right: -10px;
  font-size: 28px;
  font-weight: bold;
  color: white;
  cursor: pointer;
}
.video-popup-download {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 14px;
  background: #ffcc00;
  color: #000;
  border-radius: 6px;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
}

.video-popup-download:hover {
  background: #ffaa00;
}

.table-container {
	  width: 100%;
	  margin: 10px 0;
	}
	

   .table-container {
  max-height: 400px;       /* set your preferred scroll height */
  overflow-y: auto;
  border: 1px solid #555;
}

/* Make header static */
.custum-table thead th {
  position: sticky;
  top: 0;
  background: #222;        /* keep same header background */
  z-index: 2;              /* ensure header stays on top */
}

/* Optional: smooth hover and smaller font */
.custum-table {
  font-size: 0.85rem;      /* smaller font */
  text-align: center;      /* center text */
  width: 100%;
  border-collapse: collapse;
}

.custum-table th, 
.custum-table td {
  padding: 8px;
}

.custum-table tr:hover {
  background: #444;
  transition: background 0.2s ease;
}

	
	/* === Chart Container === */
    .chart-container {
      width: 100%;
      max-width: 800px;
      margin: 30px auto;
      background: #1c1c1c;
      padding: 20px;
      border-radius: 10px;
    }