/* Game Builder Styles */

/* Scenes List */
.scenes-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.scene-item {
  background: #f5f5f5;
  border: 2px solid #e0e0e0;
  border-radius: 4px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scene-item:hover {
  border-color: #667eea;
  background: #f0f0f5;
}

.scene-item.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.scene-item-name {
  font-weight: 600;
  flex: 1;
}

.scene-item-badge {
  background: rgba(255, 255, 255, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.scene-item.active .scene-item-badge {
  background: rgba(255, 255, 255, 0.4);
}

.scene-item-actions {
  display: flex;
  gap: 0.25rem;
  margin-left: 0.5rem;
}

.scene-item-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.scene-item-actions button:hover {
  opacity: 1;
}

/* Portal and NPC visualization on canvas */
.portal-overlay {
  position: absolute;
  border: 3px dashed #00bcd4;
  background: rgba(0, 188, 212, 0.15);
  pointer-events: none;
}

.npc-overlay {
  position: absolute;
  border: 3px solid #4caf50;
  background: rgba(76, 175, 80, 0.15);
  pointer-events: none;
}

/* Areas Grid */
.areas-section {
  margin-bottom: 3rem;
}

.areas-section h2 {
  color: #333;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.areas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.area-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  cursor: pointer;
}

.area-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.area-card-preview {
  height: 150px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
}

.area-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.area-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: white;
  color: #667eea;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.area-card-content {
  padding: 1.5rem;
}

.area-card-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.area-card-description {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.area-card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 1rem;
}

.area-card-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

/* Editor Layout */
.editor-layout {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 1.5rem;
  height: calc(100vh - 200px);
}

/* Editor Sidebar */
.editor-sidebar {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}

.sidebar-section:last-child {
  border-bottom: none;
}

.sidebar-section h3 {
  color: #333;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.asset-categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.category-btn {
  padding: 0.5rem;
  border: 2px solid #e0e0e0;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s;
}

.category-btn:hover {
  border-color: #667eea;
}

.category-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.upload-asset {
  margin-bottom: 1rem;
}

.upload-asset input[type="file"] {
  margin-bottom: 0.5rem;
}

.asset-library {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.asset-item {
  border: 2px solid #e0e0e0;
  border-radius: 4px;
  padding: 0.5rem;
  cursor: grab;
  transition: all 0.3s;
  background: white;
  text-align: center;
}

.asset-item:hover {
  border-color: #667eea;
  transform: scale(1.05);
}

.asset-item img {
  width: 100%;
  height: 60px;
  object-fit: contain;
  margin-bottom: 0.25rem;
}

.asset-item-name {
  font-size: 0.75rem;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Canvas Container */
.editor-canvas-container {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.canvas-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #eee;
}

.tool-btn {
  padding: 0.5rem 1rem;
  border: 2px solid #e0e0e0;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s;
}

.tool-btn:hover {
  border-color: #667eea;
}

.tool-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.canvas-wrapper {
  flex: 1;
  overflow: auto;
  background: #f5f5f5;
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-canvas {
  border: 2px solid #ddd;
  background: white;
  cursor: crosshair;
  max-width: 100%;
  max-height: 100%;
}

#game-canvas.dragging {
  cursor: grabbing;
}

#game-canvas.panning {
  cursor: move;
}

.canvas-info {
  display: flex;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 2px solid #eee;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #666;
}

/* Properties Panel */
.editor-properties {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.editor-properties h3 {
  color: #333;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.editor-properties hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 1.5rem 0;
}

/* Challenges */
.challenges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.challenge-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
}

.challenge-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.challenge-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.challenge-type-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  background: #e3f2fd;
  color: #1976d2;
}

.challenge-question {
  color: #333;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.challenge-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 1rem;
}

.challenge-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

/* Answer/Hint Sections */
.answer-item,
.hint-item {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  position: relative;
}

.answer-item-header,
.hint-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.answer-item label,
.hint-item label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
}

.remove-btn {
  background: #ffebee;
  color: #c62828;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.remove-btn:hover {
  background: #ffcdd2;
}

/* Responsive */
@media (max-width: 1400px) {
  .editor-layout {
    grid-template-columns: 250px 1fr 250px;
  }
}

@media (max-width: 1200px) {
  .editor-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .editor-sidebar,
  .editor-properties {
    max-height: 400px;
  }

  .canvas-wrapper {
    height: 600px;
  }
}

@media (max-width: 768px) {
  .areas-grid,
  .challenges-grid {
    grid-template-columns: 1fr;
  }

  .asset-categories {
    grid-template-columns: 1fr;
  }
}

/* Selection Indicator */
.selection-box {
  position: absolute;
  border: 2px dashed #667eea;
  background: rgba(102, 126, 234, 0.1);
  pointer-events: none;
}

/* Drag Preview */
.drag-preview {
  position: fixed;
  pointer-events: none;
  opacity: 0.7;
  z-index: 10000;
}

/* AI Assistant Panel */
.ai-assistant-toggle {
  margin-bottom: 1.5rem;
  text-align: center;
}

.ai-panel {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.ai-panel h3 {
  color: white;
  margin-bottom: 0.5rem;
}

.ai-panel label {
  color: white;
  font-weight: 600;
}

.ai-panel textarea,
.ai-panel input,
.ai-panel select {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.ai-panel textarea:focus,
.ai-panel input:focus,
.ai-panel select:focus {
  background: white;
  border-color: white;
}

.ai-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.ai-status {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 0.9rem;
}

.ai-status.loading {
  background: rgba(255, 255, 255, 0.3);
}

.ai-status.success {
  background: rgba(76, 175, 80, 0.3);
}

.ai-status.error {
  background: rgba(244, 67, 54, 0.3);
}

.ai-suggestions {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.ai-suggestions ul {
  margin-left: 1.5rem;
  margin-top: 0.5rem;
}

.ai-suggestions li {
  margin-bottom: 0.5rem;
}
