/* Made To Last - Modern CSS Styles */

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

:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --secondary: #f1f5f9;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --background: #ffffff;
  --card-bg: #ffffff;
  --hover-bg: #f8fafc;
  --success: #10b981;
  --radius: 0.5rem;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--secondary);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

.container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Viewer Area */
.viewer-area {
  flex: 1;
  position: relative;
  background: linear-gradient(135deg, #f0f4f8 0%, #e8eef3 100%);
}

#v3-viewer-container {
  width: 100%;
  height: 100%;
}

.loading-text {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Control Panel */
.control-panel {
  width: 400px;
  background: var(--card-bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title .icon {
  color: var(--primary);
  font-size: 24px;
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Sections */
.section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-header .icon {
  font-size: 20px;
  color: var(--primary);
}

/* Search Box */
.search-box {
  position: relative;
  margin-bottom: 16px;
}

.search-box input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
  background: var(--background);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
}

/* Product List */
.product-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
}

.product-item {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-item:last-child {
  border-bottom: none;
}

.product-item:hover {
  background: var(--hover-bg);
}

.product-item.active {
  background: var(--primary);
  color: white;
}

.product-item.active .product-code {
  color: rgba(255, 255, 255, 0.8);
}

.product-name {
  font-size: 14px;
  font-weight: 500;
}

.product-code {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.active-indicator {
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
}

/* Product Types */
.product-type-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-type-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s;
}

.product-type-button:hover {
  border-color: var(--primary);
  background: var(--hover-bg);
}

.product-type-button.active {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
  color: var(--primary);
  font-weight: 600;
}

/* Options Card */
.options-card {
  background: var(--hover-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.option-label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Toggle Switch */
.switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s;
}

.switch.active {
  background: var(--primary);
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch.active .switch-thumb {
  transform: translateX(20px);
}

/* URL Display */
.url-display {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.url-display input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--hover-bg);
  color: var(--text-primary);
  font-size: 12px;
  font-family: "Courier New", monospace;
  outline: none;
}

.url-display input:focus {
  border-color: var(--primary);
}

.copy-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.copy-button:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.copy-button:active {
  transform: translateY(0);
}

.copy-button .material-symbols-outlined {
  font-size: 18px;
}

/* URL Parameters */
.url-params {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.url-param {
  display: inline-flex;
  align-items: center;
  background: var(--hover-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 12px;
  font-family: "Courier New", monospace;
}

.url-param-key {
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 6px;
}

.url-param-key::after {
  content: "=";
  margin-left: 2px;
}

.url-param-value {
  color: var(--primary);
  font-weight: 500;
}

/* Virtual Photography */
.virtual-photo-card {
  display: flex;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--hover-bg);
  padding: 10px;
}

.virtual-photo-thumbnail {
  display: block;
  width: calc((100% - 10px) / 2);
  max-width: 150px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: #fcfcfc;
  cursor: pointer;
}

/* Animations */
.animation-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--background);
}

.animation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.animation-row:last-child {
  border-bottom: none;
}

.animation-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

.animation-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  gap: 8px;
}

.animation-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--hover-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  white-space: nowrap;
  transition:
    border-color 0.2s,
    background 0.2s,
    color 0.2s,
    transform 0.2s;
}

.animation-button:hover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.06);
  color: var(--primary);
}

.animation-button:active {
  transform: translateY(1px);
}

.animation-button .material-symbols-outlined {
  font-size: 16px;
  line-height: 1;
}

/* Leg Options */
.leg-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.leg-button {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-align: center;
}

.leg-button:hover {
  border-color: var(--primary);
  background: var(--hover-bg);
}

.leg-button.active {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
  color: var(--primary);
  font-weight: 600;
}

/* Material Grid */
.material-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.material-swatch {
  aspect-ratio: 1;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
  background: var(--secondary);
}

.material-swatch:hover {
  transform: scale(1.05);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.material-swatch.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.material-swatch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.material-swatch::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 50%
  );
  pointer-events: none;
}

.material-swatch.active::after {
  content: "\e5ca";
  font-family: "Material Symbols Outlined";
  position: absolute;
  top: 4px;
  right: 4px;
  color: var(--primary);
  background: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.material-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 10px;
  padding: 4px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.material-swatch:hover .material-name {
  opacity: 1;
}

/* Scrollbar Styling */
.panel-content::-webkit-scrollbar,
.product-list::-webkit-scrollbar {
  width: 8px;
}

.panel-content::-webkit-scrollbar-track,
.product-list::-webkit-scrollbar-track {
  background: var(--secondary);
}

.panel-content::-webkit-scrollbar-thumb,
.product-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb:hover,
.product-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Zoom Controls */
.zoom-controls {
  position: absolute;
  bottom: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 30;
}

.zoom-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s;
  user-select: none;
}

.zoom-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  border-color: var(--primary);
}

.zoom-button:active {
  transform: scale(1.05);
}

.zoom-button .material-symbols-outlined {
  font-size: 24px;
  color: var(--text-primary);
}

/* Mobile Support */
.mobile-toggle {
  display: none;
}

.panel-close-button {
  display: none;
}

/* Desktop: Position zoom controls on the right */
@media (min-width: 1025px) {
  .zoom-controls {
    left: auto;
    right: 24px;
  }
}

@media (max-width: 1024px) {
  .control-panel {
    position: fixed;
    right: -400px;
    top: 0;
    height: 100vh;
    z-index: 100;
    transition: right 0.3s;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  }

  .control-panel.open {
    right: 0;
  }

  .mobile-toggle {
    display: flex;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 99;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
  }

  .mobile-toggle:hover {
    transform: scale(1.1);
  }

  .panel-close-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--hover-bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    flex-shrink: 0;
  }

  .panel-close-button:hover {
    background: var(--border);
    color: var(--text);
  }

  .panel-close-button .material-symbols-outlined {
    font-size: 20px;
  }
}

.hidden {
  display: none !important;
}
