/* Add a black background color to the top navigation */
.topnav {
  background-color: #111;
  overflow: hidden;
}

/* Style the links inside the navigation bar */
.topnav a, .topnav label {
  float: left;
  color: #f2f2f2;
  text-align: center;
  padding: 4px 16px;
  text-decoration: none;
  font-size: 14px;
  font-family: Consolas;
}

/* Change the color of links on hover */
.topnav a:hover, .topnav label:hover {
  background-color: #aaa;
  color: black;
}

/* Add a color to the active/current link */
.topnav a.active, label.active {
  background-color: #4CAF50;
  color: white;
}
.centered {
  position: fixed; top: 10%; left: 25%; z-index: 1000;
  width: 50%; height: 80%;
  background: rgb(19, 19, 19); color: white;
  overflow: auto;
}

/* TweakPane theme */
:root {
  --tp-font-family: Arial, sans-serif;
  --tp-base-background-color: #2e2e2e;
  --tp-button-background-color: hsl(0, 0%, 25%);
  --tp-button-background-color-active: hsl(0, 0%, 40%);
  --tp-button-background-color-focus: hsl(0, 0%, 35%);
  --tp-button-background-color-hover: hsl(0, 0%, 30%);
  --tp-button-foreground-color: #eeeeee;
  --tp-label-foreground-color: #aeb5b8;
}
.gui-panel {
  position: absolute;
  right: 0;
  max-height: 100%;
  overflow-y: auto;
}
.gui-panel::-webkit-scrollbar {
  width: 10px;
  background: var(--tp-base-background-color);
}
.gui-panel::-webkit-scrollbar-thumb {
  background: #777;
}
.tp-rotv {
  text-shadow: 1px 1px #000;
}
.tp-rotv button {
  text-shadow: inherit;
}

/* Engraving selection indicator */
.engraving-indicator {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(68, 136, 255, 0.9);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-family: 'Consolas', monospace;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 100;
  display: none;
}

.engraving-indicator.visible {
  display: block;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.engraving-indicator .title {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 16px;
}

.engraving-indicator .info {
  opacity: 0.9;
}

/* Engraving mode cursor */
.engraving-cursor {
  cursor: crosshair !important;
}

/* Engraving mode instruction overlay */
.engraving-instructions {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(76, 175, 80, 0.95);
  color: white;
  padding: 10px 24px;
  border-radius: 6px;
  font-family: 'Consolas', monospace;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 100;
  display: none;
  animation: pulse 2s ease-in-out infinite;
}

.engraving-instructions.visible {
  display: block;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* Engraving Dialog Modal */
.engraving-dialog {
  display: none;
  position: fixed;
  z-index: 1000;
  right: 0;
  top: 0;
  width: 400px;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s;
}

.engraving-dialog.visible {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.engraving-dialog-content {
  background-color: #2a2a2a;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.3);
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.engraving-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #444;
}

.engraving-dialog-header h2 {
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-family: 'Consolas', monospace;
}

.close-button {
  background: none;
  border: none;
  color: #aaa;
  font-size: 32px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  line-height: 24px;
  transition: color 0.2s;
}

.close-button:hover {
  color: #fff;
}

.engraving-dialog-body {
  padding: 24px;
}

.upload-section {
  margin-bottom: 24px;
}

.upload-box {
  border: 2px dashed #4488ff;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(68, 136, 255, 0.05);
}

.upload-box:hover {
  border-color: #66a3ff;
  background: rgba(68, 136, 255, 0.1);
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.upload-text {
  color: #fff;
  font-size: 16px;
  margin-bottom: 8px;
  font-family: 'Consolas', monospace;
}

.upload-formats {
  color: #aaa;
  font-size: 12px;
  font-family: 'Consolas', monospace;
}

.image-preview {
  text-align: center;
  background: #1a1a1a;
  padding: 20px;
  border-radius: 8px;
}

.image-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.change-image-btn {
  background: #444;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Consolas', monospace;
  transition: background 0.2s;
}

.change-image-btn:hover {
  background: #555;
}

.controls-section {
  margin-top: 24px;
}

.controls-section h3 {
  color: #fff;
  font-size: 16px;
  margin: 0 0 16px 0;
  font-family: 'Consolas', monospace;
}

.control-group {
  margin-bottom: 16px;
}

.control-group label {
  display: block;
  color: #ccc;
  font-size: 14px;
  margin-bottom: 8px;
  font-family: 'Consolas', monospace;
}

.control-group input[type="range"] {
  width: calc(100% - 80px);
  margin-right: 12px;
  vertical-align: middle;
}

.control-group input[type="number"] {
  width: 60px;
  padding: 4px 8px;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 4px;
  color: #fff;
  font-family: 'Consolas', monospace;
  vertical-align: middle;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  margin-right: 8px;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.engraving-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #444;
}

.btn-cancel, .btn-apply {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Consolas', monospace;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel {
  background: #444;
  color: #fff;
}

.btn-cancel:hover {
  background: #555;
}

.btn-apply {
  background: #4488ff;
  color: #fff;
}

.btn-apply:hover {
  background: #5599ff;
}

.btn-apply:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
}

/* Engrave button special styling */
#engraveBtn {
  background: linear-gradient(135deg, #ff6b35, #f72585);
  font-weight: bold;
  font-size: 15px;
  padding: 12px 24px;
}

#engraveBtn:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff7f50, #ff49a3);
  transform: scale(1.02);
}

#engraveBtn:disabled {
  background: #333;
  transform: none;
}

/* Calculation Status */
.calculation-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-top: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4CAF50;
  transition: all 0.3s ease;
}

.status-indicator.calculating {
  background: #FFC107;
  animation: pulse 1s ease-in-out infinite;
}

.status-indicator.error {
  background: #f44336;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.1); }
}

.status-text {
  color: #ccc;
  font-size: 14px;
}

.preview-info {
  margin-bottom: 20px;
}

.preview-info p {
  color: #aaa;
  font-size: 14px;
  margin: 0;
  line-height: 1.5;
}

