/**
 * Styles for LLM Creative Ability Demo
 * Clean, minimal design focused on the 3D visualization
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0f1419;
  --bg-secondary: #1a1f2e;
  --bg-tertiary: #252b3b;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --accent-blue: #58a6ff;
  --accent-purple: #bc8cff;
  --border-color: #30363d;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  height: 100vh;
  overflow: hidden;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 10px;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  text-align: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 15px;
  flex-shrink: 0;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 5px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Main Content */
main {
  display: grid;
  grid-template-columns: 280px 1fr 400px;
  gap: 15px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Left Column */
.left-column {
  display: flex;
  flex-direction: column;
  gap: 15px;
  height: 100%;
  overflow-y: auto;
}

@media (max-width: 1400px) {
  main {
    grid-template-columns: 250px 1fr;
  }
  .metadata-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1024px) {
  main {
    grid-template-columns: 1fr;
  }
}

/* Controls Panel */
.controls-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  height: fit-content;
  overflow-y: auto;
  flex-shrink: 0;
}

/* About Panel */
.about-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  height: fit-content;
  flex-shrink: 0;
}

.about-panel h3 {
  margin-bottom: 15px;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.about-panel p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.about-panel p:last-of-type {
  margin-bottom: 15px;
}

.learn-more-link {
  display: inline-flex;
  align-items: center;
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.learn-more-link:hover {
  color: var(--accent-purple);
}

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

.control-group:last-child {
  margin-bottom: 0;
}

.mode-description {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.4;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
  font-size: 0.95rem;
}

select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

select:hover {
  border-color: var(--accent-blue);
}

select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

input[type="range"] {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-blue);
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent-blue);
  cursor: pointer;
  border-radius: 50%;
  border: none;
  transition: transform 0.2s;
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

#scale-value {
  color: var(--accent-blue);
  font-weight: 600;
  font-size: 1.1rem;
}

/* Canvas Container */
#canvas-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  min-height: 0;
  touch-action: none; /* Prevent touch scrolling on canvas */
  position: relative;
}

#canvas-container canvas {
  display: block;
  border-radius: 12px;
  touch-action: none; /* Prevent touch gestures from affecting page scroll */
  cursor: grab;
}

#canvas-container canvas:active {
  cursor: grabbing;
}

/* Metadata Panel */
.metadata-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.metadata-panel h3 {
  margin-bottom: 15px;
  color: var(--text-primary);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.metadata-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 15px;
  flex-shrink: 0;
}

.metadata-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.metadata-item .label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.metadata-item .value {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.descriptor-info {
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.descriptor-info p {
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.5;
  font-size: 0.9rem;
}

.insight {
  background: var(--bg-tertiary);
  padding: 12px;
  border-radius: 6px;
  border-left: 3px solid var(--accent-purple);
}

.insight strong {
  color: var(--accent-purple);
  font-size: 0.85rem;
}

#key-insight {
  color: var(--text-primary);
  font-size: 0.85rem;
}

/* Footer - Hidden in no-scroll layout */
footer {
  display: none;
}

/* Loading State */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    overflow-y: auto;
  }

  .container {
    height: auto;
    overflow: visible;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: 0.85rem;
  }

  main {
    display: flex;
    flex-direction: column;
    height: auto;
    gap: 15px;
  }

  .left-column {
    display: contents;
  }

  .controls-panel,
  #canvas-container,
  .metadata-panel,
  .about-panel {
    height: auto;
    min-height: 300px;
  }

  #canvas-container {
    min-height: 400px;
  }

  .about-panel {
    order: 10;
  }
}
