/* Visualization CSS - Tap Macro v1.3.0 */
/* Toolpath visualization, charts, and pattern styles */

/* ===== MILLING ADVISOR VISUALIZATION STYLES ===== */

/* Visualization Controls */
.visualization-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  justify-content: center;
}

.viz-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 0.9rem;
}

.viz-btn:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.viz-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.viz-icon {
  font-size: 1.2rem;
}

/* Analysis Grid */
.analysis-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .analysis-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.info-panel,
.performance-panel,
.material-panel {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 1rem;
  border: 1px solid var(--border-color);
}

.performance-panel h4,
.material-panel h4 {
  color: var(--accent-color);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.info-panel h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.path-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Comparison Controls */
.comparison-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  justify-content: center;
}

.compare-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 0.9rem;
}

.compare-btn:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.compare-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.compare-icon {
  font-size: 1.2rem;
}

.comparison-results {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comparison-placeholder {
  text-align: center;
  color: var(--text-secondary);
}

/* ===== TOOLPATH VISUALIZATION STYLES ===== */

/* Pattern Base Styles */
.toolpath-visualization {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.pattern-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  text-align: center;
}

.pattern-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 1rem;
  max-width: 300px;
}

/* Dynamic Milling Pattern */
.dynamic-pattern .pattern-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 1rem 0;
}

.grid-cell {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-secondary);
  transition: all 0.3s ease;
}

.grid-cell.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Flowline Pattern */
.flowline-pattern .flow-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 1rem 0;
}

.flow-line {
  width: 200px;
  height: 8px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  border-radius: 4px;
  opacity: 0.8;
}

.flow-line:nth-child(2) {
  width: 180px;
}
.flow-line:nth-child(3) {
  width: 220px;
}
.flow-line:nth-child(4) {
  width: 160px;
}
.flow-line:nth-child(5) {
  width: 200px;
}

/* Waterline Pattern */
.waterline-pattern .water-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 1rem 0;
}

.water-line {
  width: 250px;
  height: 6px;
  background: var(--accent-color);
  border-radius: 3px;
  opacity: 0.9;
}

/* Scallop Pattern */
.scallop-pattern .scallop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 1rem 0;
}

.scallop-cell {
  width: 50px;
  height: 50px;
  border: 2px solid var(--accent-color);
  border-radius: 50%;
  background: var(--bg-secondary);
  position: relative;
}

.scallop-cell::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  background: var(--accent-color);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.6;
}

/* Radial Pattern */
.radial-pattern .radial-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 1rem 0;
}

.radial-line {
  width: 120px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 2px;
  transform-origin: left center;
  opacity: 0.8;
}

.radial-line:nth-child(1) { transform: rotate(0deg); }
.radial-line:nth-child(2) { transform: rotate(45deg); }
.radial-line:nth-child(3) { transform: rotate(90deg); }
.radial-line:nth-child(4) { transform: rotate(135deg); }
.radial-line:nth-child(5) { transform: rotate(180deg); }
.radial-line:nth-child(6) { transform: rotate(225deg); }
.radial-line:nth-child(7) { transform: rotate(270deg); }
.radial-line:nth-child(8) { transform: rotate(315deg); }

/* Default Pattern */
.default-pattern .pattern-placeholder {
  text-align: center;
  color: var(--text-secondary);
}

.default-pattern .placeholder-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Visualization Area */
.visualization-area {
  min-height: 200px;
  max-height: 400px;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  border: 2px solid var(--border-color);
  margin: 1.5rem 0;
  position: relative;
  overflow: auto;
}

.visualization-controls,
.visualization-options {
  margin-bottom: 1.5rem;
}

/* Enhanced Pattern Stats */
.pattern-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Animation Keyframes */
@keyframes scallop-pattern {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes dynamic-milling {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}

/* ===== G-CODE ANALYZER 3D VIEWER ===== */

.gcode-drop-zone {
  display: block;
  padding: 0.5rem 1rem;
  margin-bottom: 0.5rem;
  border: 2px dashed var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.gcode-drop-zone:hover,
.gcode-drop-zone.drag-over {
  border-color: var(--accent-color, #3b82f6);
  background: rgba(59, 130, 246, 0.08);
  color: var(--foreground);
}

.gcode-drop-text {
  pointer-events: none;
}

.gcode-simulation-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0;
}

.gcode-speed-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.gcode-progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 120px;
}

.gcode-progress-wrap progress {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.gcode-progress-wrap progress::-webkit-progress-bar {
  background: var(--bg-secondary);
}

.gcode-progress-wrap progress::-webkit-progress-value {
  background: var(--accent-color, #3b82f6);
}

.gcode-progress-wrap progress::-moz-progress-bar {
  background: var(--accent-color, #3b82f6);
}

.gcode-3d-viewer {
  width: 100%;
  min-height: 300px;
  max-height: 400px;
  background: var(--bg-secondary);
  position: relative;
  overflow: auto;
}

.gcode-3d-viewer canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
  .visualization-controls,
  .comparison-controls {
    flex-direction: column;
    align-items: center;
  }
  
  .analysis-grid {
    grid-template-columns: 1fr;
  }
  
  .pattern-stats {
    grid-template-columns: 1fr;
  }
  
  .toolpath-visualization {
    padding: 1rem;
  }
  
  .grid-cell {
    width: 30px;
    height: 30px;
  }
  
  .scallop-cell {
    width: 40px;
    height: 40px;
  }
}
