/* ==========================================================================
   Image to 2D & 3D Converter Studio CSS
   ========================================================================== */

:root {
  --bg-dark: #0a0c10;
  --bg-panel: #121620;
  --bg-card: #181d2a;
  --bg-input: #0f131d;
  --border-color: #262e42;
  --border-focus: #00f0ff;
  
  --text-main: #f0f4fc;
  --text-muted: #8c9ba5;
  --text-dim: #5c6b75;
  
  --laser-cyan: #00f0ff;
  --laser-cyan-glow: rgba(0, 240, 255, 0.35);
  --laser-amber: #ff6b00;
  --laser-amber-glow: rgba(255, 107, 0, 0.4);
  --laser-green: #00ff88;
  --laser-purple: #9d4edd;
  --danger-red: #ff3b5c;

  --sidebar-width: 360px;
  --header-height: 60px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-main: 0 10px 30px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* App Header */
.app-header {
  height: var(--header-height);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.15rem;
}

.brand-icon {
  font-size: 1.4rem;
}

.brand-text span {
  color: var(--laser-cyan);
}

.brand-badge {
  background: linear-gradient(135deg, var(--laser-cyan), var(--laser-purple));
  color: #000;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Main Layout */
.converter-container {
  display: flex;
  flex: 1;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}

/* Sidebar */
.converter-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 10;
}

.mode-switcher {
  display: flex;
  padding: 0.75rem 1rem;
  gap: 0.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.mode-tab {
  flex: 1;
  padding: 0.6rem 0.5rem;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.mode-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.mode-tab.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(157, 78, 221, 0.15));
  border-color: var(--laser-cyan);
  color: var(--laser-cyan);
  box-shadow: 0 0 12px var(--laser-cyan-glow);
}

/* Panel Sections */
.panel-section {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.4;
}

/* Upload Dropzone */
.dropzone {
  border: 2px dashed var(--border-color);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--laser-cyan);
  background: rgba(0, 240, 255, 0.05);
  box-shadow: 0 0 15px var(--laser-cyan-glow);
}

.dropzone input[type="file"] {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.drop-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.drop-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Preset Buttons */
.preset-chips {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--laser-cyan);
  color: var(--text-main);
}

/* Controls Form */
.control-group {
  margin-bottom: 1rem;
}

.control-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.control-val {
  color: var(--laser-cyan);
  font-family: monospace;
}

.form-select, .form-range {
  width: 100%;
}

.form-select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.form-select:focus {
  border-color: var(--laser-cyan);
}

.form-range {
  accent-color: var(--laser-cyan);
  cursor: pointer;
}

/* Toggle Checkboxes */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.85rem;
}

.toggle-switch {
  position: relative;
  width: 38px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0; height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border-color);
  transition: .2s;
  border-radius: 20px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

input:checked + .slider-round {
  background-color: var(--laser-cyan);
}

input:checked + .slider-round:before {
  transform: translateX(18px);
}

/* Action Buttons */
.btn {
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--laser-cyan);
  color: #000;
}

.btn-primary:hover {
  background: #33f3ff;
  box-shadow: 0 0 15px var(--laser-cyan-glow);
}

.btn-purple {
  background: linear-gradient(135deg, var(--laser-cyan), var(--laser-purple));
  color: #fff;
  font-weight: 700;
}

.btn-purple:hover {
  box-shadow: 0 0 15px rgba(157, 78, 221, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  border-color: var(--laser-cyan);
}

.btn-full {
  width: 100%;
}

/* Viewport / Display Area */
.converter-viewport {
  flex: 1;
  background: #06070a;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.viewport-toolbar {
  height: 48px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
}

.view-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.info-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  color: var(--laser-cyan);
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Canvas Area */
.canvas-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 0);
  background-size: 24px 24px;
}

.canvas-container {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  max-width: 95%;
  max-height: 90%;
}

.view-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-main);
  position: relative;
}

.view-card-header {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
}

.view-canvas {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
  background: #111;
}

/* 3D Canvas Viewport */
#viewport3D {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0; left: 0;
  display: none;
}

/* Empty State overlay */
.empty-state {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.empty-icon {
  font-size: 3.5rem;
  opacity: 0.4;
  margin-bottom: 1rem;
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
}

.empty-subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

/* 3D Floating Controls Overlay */
.viewport-3d-controls {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  display: flex;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  z-index: 20;
}

/* Responsive */
@media (max-width: 900px) {
  .converter-container {
    flex-direction: column;
    overflow-y: auto;
  }
  .converter-sidebar {
    width: 100%;
    height: auto;
  }
  .canvas-container {
    flex-direction: column;
  }
}
