/* Scene Builder Styles */

.scene-builder-container {
  display: grid;
  grid-template-columns: 300px 1fr 320px;
  height: calc(100vh - 60px);
  background: #f5f5f5;
  gap: 0;
}

/* ==================== LEFT PANEL ==================== */
.left-panel {
  background: white;
  border-right: 1px solid #ddd;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.panel-header {
  padding: 20px;
  border-bottom: 2px solid #4CAF50;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.panel-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.section {
  padding: 20px;
  border-bottom: 1px solid #eee;
}

.section h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Background Type Selector */
.bg-type-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}

.bg-type-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid #ddd;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.bg-type-btn:hover {
  border-color: #4CAF50;
  background: #f0f9ff;
}

.bg-type-btn.active {
  border-color: #4CAF50;
  background: #4CAF50;
  color: white;
}

.bg-panel {
  display: none;
}

.bg-panel.active {
  display: block;
}

.help-text {
  font-size: 12px;
  color: #666;
  margin-bottom: 12px;
  line-height: 1.4;
}

.parallax-layer-item {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}

.layer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.layer-header h4 {
  margin: 0;
  font-size: 14px;
  color: #333;
}

.layer-header button {
  padding: 4px 10px;
  background: #f44336;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

/* Status Box */
.status-box {
  padding: 12px;
  border-radius: 8px;
  margin-top: 12px;
  font-size: 14px;
}

.status-box.loading {
  background: #e3f2fd;
  border: 1px solid #2196F3;
  color: #1976d2;
}

.status-box.success {
  background: #e8f5e9;
  border: 1px solid #4CAF50;
  color: #2e7d32;
}

.status-box.error {
  background: #ffebee;
  border: 1px solid #f44336;
  color: #c62828;
}

/* ==================== CENTER PANEL ==================== */
.center-panel {
  display: flex;
  flex-direction: column;
  background: #e0e0e0;
}

.canvas-header {
  background: white;
  padding: 15px 20px;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.canvas-header h2 {
  margin: 0;
  font-size: 18px;
  color: #333;
}

.canvas-tools {
  display: flex;
  gap: 5px;
}

.tool-btn {
  padding: 8px 12px;
  background: white;
  border: 2px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tool-btn:hover {
  border-color: #4CAF50;
  background: #f0f9ff;
}

.tool-btn.active {
  background: #4CAF50;
  border-color: #4CAF50;
  color: white;
}

.tool-btn span {
  font-size: 16px;
}

.canvas-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

#scene-canvas {
  border: 2px solid #333;
  background: white;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.canvas-overlay {
  position: absolute;
  pointer-events: none;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.canvas-footer {
  background: white;
  padding: 10px 20px;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.canvas-info {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: #666;
}

.canvas-info span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.canvas-controls {
  display: flex;
  gap: 8px;
}

.canvas-controls button {
  padding: 6px 12px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.canvas-controls button:hover {
  background: #f5f5f5;
  border-color: #4CAF50;
}

/* ==================== RIGHT PANEL ==================== */
.right-panel {
  background: white;
  border-left: 1px solid #ddd;
  display: flex;
  flex-direction: column;
}

.panel-tabs {
  display: flex;
  border-bottom: 2px solid #ddd;
  background: #f9f9f9;
}

.tab-btn {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: white;
  color: #4CAF50;
}

.tab-btn.active {
  background: white;
  color: #4CAF50;
  border-bottom-color: #4CAF50;
}

.tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
}

.tab-content.active {
  display: block;
}

/* Asset Library */
.asset-categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 15px;
}

.cat-btn {
  padding: 10px;
  background: white;
  border: 2px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.cat-btn:hover {
  border-color: #4CAF50;
  background: #f0f9ff;
}

.cat-btn.active {
  background: #4CAF50;
  border-color: #4CAF50;
  color: white;
}

.asset-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.asset-search {
  margin-bottom: 12px;
}

.asset-search input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.asset-item {
  aspect-ratio: 1;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: white;
}

.asset-item:hover {
  border-color: #4CAF50;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.asset-item img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  margin-bottom: 5px;
}

.asset-item span {
  font-size: 11px;
  text-align: center;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

/* Asset Info Container */
.asset-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.asset-name {
  font-size: 11px;
  text-align: center;
  color: #333;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

/* Asset Badges */
.asset-badges {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
}

.asset-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-2-5d {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.badge-no-bg {
  background: #4CAF50;
  color: white;
}

.badge-layered {
  background: #FF9800;
  color: white;
}

/* Asset Metadata */
.asset-meta {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}

.asset-dimensions {
  font-size: 9px;
  color: #999;
}

/* Properties Panel */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

.empty-state p {
  margin: 0;
  font-size: 14px;
}

#object-properties {
  padding: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.form-group input[type="color"] {
  width: 100%;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
}

.form-group input[type="range"] {
  width: 100%;
}

.form-group input[type="checkbox"] {
  margin-right: 8px;
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#object-properties hr {
  margin: 20px 0;
  border: none;
  border-top: 1px solid #eee;
}

#object-properties h4 {
  margin: 0 0 15px 0;
  font-size: 15px;
  color: #4CAF50;
}

/* Layers List */
.layers-list {
  padding: 0;
}

.layer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: all 0.2s;
}

.layer-item:hover {
  background: #f5f5f5;
}

.layer-item.selected {
  background: #e3f2fd;
  border-left: 3px solid #4CAF50;
}

.layer-icon {
  font-size: 20px;
}

.layer-name {
  flex: 1;
  font-size: 14px;
  color: #333;
}

.layer-z {
  font-size: 12px;
  color: #999;
  background: #f0f0f0;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ==================== MODALS ==================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content.modal-large {
  max-width: 800px;
}

.modal-header {
  padding: 20px;
  border-bottom: 2px solid #4CAF50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px 12px 0 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 32px;
  color: white;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ==================== BUTTONS ==================== */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-primary {
  background: #4CAF50;
  color: white;
}

.btn-primary:hover {
  background: #45a049;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-secondary {
  background: #757575;
  color: white;
}

.btn-secondary:hover {
  background: #616161;
}

.btn-success {
  background: #4CAF50;
  color: white;
}

.btn-success:hover {
  background: #45a049;
}

.btn-info {
  background: #2196F3;
  color: white;
}

.btn-info:hover {
  background: #1976d2;
}

.btn-danger {
  background: #f44336;
  color: white;
}

.btn-danger:hover {
  background: #d32f2f;
}

/* ==================== UTILITIES ==================== */
.hidden {
  display: none !important;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1400px) {
  .scene-builder-container {
    grid-template-columns: 280px 1fr 300px;
  }
}

@media (max-width: 1200px) {
  .scene-builder-container {
    grid-template-columns: 260px 1fr 280px;
  }

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

@media (max-width: 992px) {
  .scene-builder-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  .left-panel,
  .right-panel {
    max-height: 300px;
  }
}
