/*
 * Copyright (c) 2025 VDS Framework
 * Part of the Virtual Desktop Site Framework
 * Mandelbrot Visualizer Styles
 */

/* Mandelbrot window content layout */
#mandelbrot-window .window-content {
  display: flex;
  flex-direction: row;
  padding: 0;
  overflow: hidden;
  background: #1a1a1a;
}

/* Main canvas container */
.mandelbrot-canvas-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #000;
  padding: 10px;
}

/* Canvas styling */
#mandelbrot-canvas {
  display: block;
  border: 2px solid #333;
  cursor: crosshair;
  background: #000;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Loading overlay */
#mandelbrot-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: #0f0;
  padding: 20px 40px;
  border-radius: 8px;
  border: 2px solid #0f0;
  font-family: monospace;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 10;
}

#mandelbrot-loading .spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(0, 255, 0, 0.3);
  border-top-color: #0f0;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Controls panel */
.mandelbrot-controls-panel {
  width: 280px;
  background: #2a2a2a;
  border-left: 1px solid #444;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: #ddd;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

.mandelbrot-controls-panel h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: #fff;
  border-bottom: 1px solid #444;
  padding-bottom: 5px;
}

.mandelbrot-controls-panel h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #aaa;
}

/* Control sections */
.control-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Labels and inputs */
.control-section label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #ccc;
  font-size: 13px;
}

.control-section input[type="range"] {
  width: 100%;
  margin: 5px 0;
}

.control-section select {
  width: 100%;
  padding: 6px;
  background: #333;
  color: #fff;
  border: 1px solid #555;
  border-radius: 4px;
  font-size: 13px;
}

.control-section select:focus {
  outline: none;
  border-color: #0af;
}

/* Value display */
#iter-value {
  font-weight: bold;
  color: #0af;
  font-size: 14px;
}

/* Buttons */
.mandelbrot-controls-panel button {
  padding: 8px 12px;
  background: #444;
  color: #fff;
  border: 1px solid #666;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.mandelbrot-controls-panel button:hover {
  background: #555;
  border-color: #0af;
}

.mandelbrot-controls-panel button:active {
  background: #333;
}

/* Button group */
.button-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.button-group button {
  flex: 1;
  min-width: 0;
}

/* Info panel */
.info-panel {
  background: #1a1a1a;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #333;
}

.info-panel p {
  margin: 5px 0;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-panel code {
  background: #000;
  padding: 2px 6px;
  border-radius: 3px;
  color: #0f0;
  font-family: 'Courier New', monospace;
  font-size: 11px;
}

/* Instructions */
.instructions {
  background: #1a1a1a;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #333;
}

.instructions ul {
  margin: 5px 0;
  padding-left: 20px;
  font-size: 12px;
}

.instructions li {
  margin: 4px 0;
  line-height: 1.4;
}

.instructions strong {
  color: #0af;
}

/* Bookmarks */
.bookmarks-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#bookmark-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bookmark-btn {
  padding: 6px 10px !important;
  font-size: 12px !important;
  text-align: left;
  background: #333 !important;
  border: 1px solid #555 !important;
}

.bookmark-btn:hover {
  background: #444 !important;
  border-color: #0af !important;
}

/* Coordinate tooltip */
#coord-tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.9);
  color: #0f0;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid #0f0;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  pointer-events: none;
  z-index: 10000;
  white-space: nowrap;
}

#coord-tooltip code {
  color: #0f0;
  background: transparent;
}

/* Hidden utility class */
.hidden {
  display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #mandelbrot-window .window-content {
    flex-direction: column;
  }

  .mandelbrot-controls-panel {
    width: 100%;
    max-height: 200px;
    border-left: none;
    border-top: 1px solid #444;
  }

  .mandelbrot-canvas-container {
    min-height: 300px;
  }
}

/* Range slider customization */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #444;
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #0af;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: #0cf;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #0af;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

input[type="range"]::-moz-range-thumb:hover {
  background: #0cf;
}

/* Scrollbar styling for controls panel */
.mandelbrot-controls-panel::-webkit-scrollbar {
  width: 8px;
}

.mandelbrot-controls-panel::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.mandelbrot-controls-panel::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

.mandelbrot-controls-panel::-webkit-scrollbar-thumb:hover {
  background: #555;
}
