	  :root {
  /* Color Scheme */
  --accent: #ffffff;
  --accent-hover: #828282;
  --grey-1: #ffffff;
  --grey-2: #ffffff;
  --grey-3: #ffffff;
  --grey-4: #ffffff;
  --white: #ffffff;
  --white: #ffffff;
  
  /* Effects */
  --frost-a: rgba(255, 255, 255, 1);
  --frost-b: rgba(255, 255, 255, 1);
  --shadow-lg: 0 0 8px 1px rgba(128, 128, 128, 0.9);
}



/* ----------  RESET & BASE STYLES  ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Roboto, sans-serif;
  user-select: none;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #2f343a;
  color: var(--white);
}

/* ----------  MAIN LAYOUT  ---------- */
body {
  display: flex;
  flex-direction: column;
}

/* Toolbar */
header.toolbar {
  height: 42px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  background: #2f343a;
  border-bottom: 1px solid #2f343a;
  z-index: 30;
  position: relative; /* Added for absolute positioning */
}

/* Fullscreen button in top-right corner */
header.toolbar .fullscreen-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 4px;
  background: #ffffff;
  border: #fff5e0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  color: #828282;
  cursor: pointer;
  font-size: 22px;
}

header.toolbar .fullscreen-btn:hover {
  background: #ffffff;
  color: #828282;
  box-shadow: var(--shadow-lg);
}

/* Adjust other toolbar items to not overlap */
header.toolbar .tools {
  display: flex;
  flex-grow: 1;
  justify-content: flex-start;
  padding-right: 40px; /* Space for fullscreen button */
}

header.toolbar .btn {
  width: 30px;
  height: 30px;
  margin-right: 4px;
  border-radius: 4px;
  background: var(--frost-a);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--white);
  transition: all 0.15s ease;
  color: #828282;
  cursor: pointer;
  font-size: 14px;
}

header.toolbar .btn:hover {
  background: var(--accent);
  color: #828282;
  box-shadow: var(--shadow-lg);
}

/* Main Content Area */
.main {
  flex: 1;
  display: flex;
  height: calc(100vh - 42px);
  position: relative;
}



/* ----------  VIEWER AREA  ---------- */
.viewer {
  flex: 1;
  right: 0px;
  bottom: 0px;
  position: absolute;
  background: linear-gradient(1deg, #e1dfdf, #f9f6f6, #fbf7ed);
  border: 1px solid var(--grey-3);
  border-radius: 10px;
  z-index: 1;
}

#webgl-canvas {
  width: 100%;
  height: 100%;
  display: block;
}


/*----------------------------------*/

/* Re‑usable button wrapper */
.tool-button { position: relative; }

/* Base dropdown */
.dropdown{
  position: absolute;
  top: 100%;            /* just below the button */
  left: 0;
  min-width: 160px;
  display: none;
  flex-direction: column;
  background: var(--grey-4);
  border: 1px solid var(--grey-3);
  border-radius: 4px;
  z-index: 500;
  box-shadow: var(--shadow-lg);
}

/* Show when active */
.dropdown.active{ display:flex; }

/* Menu rows */
.context-item{
  padding: 6px 10px;
  color: var(--white);
  white-space: nowrap;
  cursor: pointer;
}
.context-item:hover{
  background: var(--accent);
  color: #828282;
}


/* ----------  RIGHT CONTROLS (Outside viewer) ---------- */
.side-buttons {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 100;
}



.side-buttons .btn-icon {
  width: 45px;
  height: 45px;
  border-radius: 6px;
  background: var(--frost-a);
  border: 1px solid var(--grey-3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  color: #828282;
  cursor: pointer;
  padding: 6px;
}

.side-buttons .btn-icon img {
  width: 35px;
  height: 35px;
  object-fit: contain;
}

.side-buttons .btn-icon:hover {
  background: var(--accent);
  color: #828282; 
  box-shadow: var(--shadow-lg);
}


/* ----------  BOTTOM CONTROLS (Below viewer) ---------- */
.bottom-controls {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 10px 15px;
  background: var(--grey-4);
  border-radius: 6px 6px 6px 6px;
  border: 1px solid var(--grey-3);
  border-bottom: none;
  z-index: 100;
  width: 420px;
  justify-content: space-between;  
}

.bottom-controls .btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 5px;
  background: var(--frost-a);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s;
  color: #828282;
  cursor: pointer;
  border: 1px solid var(--grey-3);
  padding: 5px;
}

.bottom-controls .btn-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.bottom-controls .btn-icon:hover {
  background: var(--accent);
  color: #828282;
  box-shadow: var(--shadow-lg);
}

.home-icon {
  padding: 10px;
  font-size: 26px;
}




/* ----------  LOADING INDICATOR  ---------- */
#loading-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  z-index: 1000; /* Above everything */
  background: rgba(255, 255, 255, 1);
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0);
}

#loading-container {
  width: 100%;
  height: 4px;
  background: black;
  border-radius: 2px;
  overflow: hidden;
  margin: 10px 0;
  color: black;
}

#loading-bar {
  height: 100%;
  width: 0%;
  background: red;
  color: black;
  transition: width 0.3s ease;
}

#loading-text {
  color: black;
  font-size: 14px;
  font-weight: 500;
}

/* ----------  GIZMO  ---------- */
#gizmo-canvas {
  position: absolute;
  bottom: 40px;
  left: 40px;
  width: 20px;
  height: 20px;
  z-index: 1002;
  pointer-events: auto;

}

/* ----------  SCROLLBAR  ---------- */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
 /* background: var(--grey-4); */
  background: var(--white);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

/* ----------  MISC  ---------- */
.format-label {
  position: fixed;
  bottom: 4px;
  right: 4px;
  color: var(--grey-1);
  font-size: 11px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 6px;
  border-radius: 3px;
}
