/* ========================================================
   Unity Editor - Build Settings (Reimagined for XR Devices)
   Authentic Unity Dark Theme with Interactive Device Scenes
   ======================================================== */

/* Floating Launcher Button */
.pico-bot-float-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  user-select: none;
}

/* Tooltip / Speech bubble */
.pico-bot-tooltip {
  position: absolute;
  bottom: 74px;
  right: 4px;
  background: rgba(24, 27, 34, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #e2e8f0;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pico-bot-tooltip.visible,
.pico-bot-float-btn:hover .pico-bot-tooltip {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.pico-bot-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 24px;
  width: 12px;
  height: 12px;
  background: rgba(24, 27, 34, 0.95);
  border-right: 1px solid rgba(56, 189, 248, 0.25);
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  transform: rotate(45deg);
}

.pico-bot-badge {
  background: #2c5d88;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Floating Trigger Button */
.pico-bot-float-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2a313d 0%, #12161f 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 
              0 0 20px rgba(0, 242, 254, 0.25),
              inset 0 1px 2px rgba(255, 255, 255, 0.25);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  overflow: visible;
}

.pico-bot-float-btn:hover {
  transform: scale(1.08) translateY(-2px);
  border-color: rgba(56, 189, 248, 0.85);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7), 
              0 0 30px rgba(0, 242, 254, 0.5),
              inset 0 1px 3px rgba(255, 255, 255, 0.4);
}

.pico-bot-float-btn:active {
  transform: scale(0.96);
}

/* Visor Screen & Animated Eyes */
.pico-visor-wrapper {
  width: 50px;
  height: 50px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pico-visor-base-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
}

.pico-visor-eyes-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.pico-visor-eyes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: pico-eyes-move 5.5s infinite ease-in-out;
  transform-origin: center center;
  margin-top: 1px;
}

.pico-eye {
  width: 8px;
  height: 11px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 7px 2px #00f2fe, 
              0 0 15px 4px rgba(0, 114, 255, 0.85),
              inset 0 0 2px #38bdf8;
  position: relative;
  transition: transform 0.15s ease;
}

/* Eye movement keyframes matching bot behavior */
@keyframes pico-eyes-move {
  0%, 15% { transform: translate(0, 0) scale(1, 1); }
  17% { transform: translate(0, 0) scale(1.1, 0.08); }
  19%, 25% { transform: translate(0, 0) scale(1, 1); }
  30%, 42% { transform: translate(4px, 0) scale(1, 1); }
  44% { transform: translate(4px, 0) scale(1.1, 0.08); }
  46%, 50% { transform: translate(4px, 0) scale(1, 1); }
  55%, 70% { transform: translate(-4px, 0) scale(1, 1); }
  72% { transform: translate(-4px, 0) scale(1.1, 0.08); }
  74%, 82% { transform: translate(0, -2.5px) scale(1, 1); }
  84% { transform: translate(0, 0) scale(1.1, 0.08); }
  86% { transform: translate(0, 0) scale(1, 1); }
  88% { transform: translate(0, 0) scale(1.1, 0.08); }
  90%, 100% { transform: translate(0, 0) scale(1, 1); }
}

/* ========================================================
   Unity Editor: Build Settings Window Container
   ======================================================== */
.unity-build-window {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: min(650px, calc(100vh - 120px));
  background: #2a2a2a;
  border: 1px solid #1c1c1c;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 
              0 0 0 1px rgba(255, 255, 255, 0.08),
              0 0 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #c4c4c4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 11.5px;
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.97);
  transform-origin: bottom right;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.unity-build-window.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Unity Titlebar */
.unity-build-titlebar {
  background: #1e1e1e;
  border-bottom: 1px solid #141414;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.unity-titlebar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #dfdfdf;
  font-size: 12px;
}

.unity-icon {
  width: 15px;
  height: 15px;
  color: #ffffff;
}

.unity-titlebar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.unity-btn-icon {
  background: transparent;
  border: none;
  color: #8c8c8c;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.unity-btn-icon:hover {
  background: #383838;
  color: #ffffff;
}

.unity-btn-close:hover {
  background: #e81123 !important;
  color: #ffffff !important;
}

/* Body Content */
.unity-build-body {
  padding: 12px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(min(650px, calc(100vh - 120px)) - 82px);
}

/* 1. Scenes In Build Section */
.unity-section-title {
  font-size: 11.5px;
  font-weight: 600;
  color: #c4c4c4;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.unity-scenes-container {
  background: #202020;
  border: 1px solid #181818;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.unity-scenes-list {
  display: flex;
  flex-direction: column;
}

.unity-scene-row {
  display: flex;
  align-items: center;
  padding: 5px 10px;
  border-bottom: 1px solid #282828;
  cursor: pointer;
  transition: background 0.1s;
}

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

.unity-scene-row:hover {
  background: #2b2b2b;
}

.unity-scene-row.selected {
  background: #2c5d88;
  color: #ffffff;
}

.unity-scene-row.selected .unity-scene-name {
  color: #ffffff;
  font-weight: 600;
}

.unity-scene-row.selected .unity-scene-idx {
  color: #ffffff;
}

.unity-scene-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid #4a4a4a;
  border-radius: 2px;
  background: #1a1a1a;
  margin-right: 10px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.unity-scene-checkbox:checked {
  background: #2c5d88;
  border-color: #38bdf8;
}

.unity-scene-checkbox:checked::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.unity-scene-icon {
  margin-right: 8px;
  font-size: 13px;
}

.unity-scene-name {
  font-size: 11.5px;
  color: #b5b5b5;
  flex-grow: 1;
  font-family: inherit;
}

.unity-scene-badge {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 3px;
  color: #88c0d0;
  margin-right: 10px;
}

.unity-scene-idx {
  font-size: 11px;
  color: #808080;
  font-weight: 600;
  min-width: 16px;
  text-align: right;
  font-family: monospace;
}

/* Scenes Toolbar */
.unity-scenes-toolbar {
  background: #272727;
  border-top: 1px solid #1c1c1c;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 6px;
}

.unity-btn-text-small {
  background: #333333;
  border: 1px solid #222222;
  border-radius: 2px;
  color: #cccccc;
  font-size: 10.5px;
  padding: 2px 8px;
  cursor: pointer;
  transition: background 0.1s;
}

.unity-btn-text-small:hover {
  background: #444444;
  color: #ffffff;
}

/* 2. Platform & Device Inspector (Split View) */
.unity-split-view {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px;
  background: #222222;
  border: 1px solid #181818;
  border-radius: 4px;
  padding: 10px;
}

/* Left: Platforms list */
.unity-platform-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid #2d2d2d;
  padding-right: 8px;
}

.unity-platform-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 3px;
  cursor: pointer;
  color: #a8a8a8;
  transition: all 0.1s;
  font-size: 11px;
}

.unity-platform-item:hover {
  background: #2c2c2c;
  color: #e0e0e0;
}

.unity-platform-item.active {
  background: #2c5d88;
  color: #ffffff;
  font-weight: 600;
}

.unity-platform-icon {
  font-size: 14px;
}

/* Right: Device Specs & Projects */
.unity-device-details-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.unity-device-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #2e2e2e;
  padding-bottom: 6px;
}

.unity-device-title {
  color: #38bdf8;
  font-weight: 600;
  font-size: 12px;
}

.unity-device-specs-grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 5px 8px;
  font-size: 11px;
}

.unity-spec-label {
  color: #888888;
}

.unity-spec-val {
  color: #e2e8f0;
  font-family: inherit;
}

.unity-tested-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #14532d;
  color: #4ade80;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
}

/* 3. Footer Actions (Unity Build Buttons) */
.unity-build-footer {
  background: #202020;
  border-top: 1px solid #181818;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.unity-footer-left {
  display: flex;
  gap: 6px;
}

.unity-footer-right {
  display: flex;
  gap: 6px;
}

.unity-footer-btn {
  background: #333333;
  border: 1px solid #444444;
  border-radius: 3px;
  color: #d1d5db;
  font-size: 11px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.12s;
}

.unity-footer-btn:hover {
  background: #444444;
  color: #ffffff;
}

.unity-footer-btn.primary {
  background: #1e3a5f;
  border-color: #2c5d88;
  color: #60a5fa;
  font-weight: 600;
}

.unity-footer-btn.primary:hover {
  background: #2c5d88;
  color: #ffffff;
}

/* Build progress animation overlay */
.unity-build-progress-bar {
  display: none;
  height: 4px;
  background: #1e3a5f;
  position: relative;
  overflow: hidden;
}

.unity-build-progress-bar.active {
  display: block;
}

.unity-build-progress-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  animation: unity-build-anim 1.2s infinite ease-in-out;
}

@keyframes unity-build-anim {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Mobile responsive optimizations */
@media (max-width: 640px) {
  .pico-bot-float-container {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
  .pico-bot-float-btn {
    width: 52px;
    height: 52px;
  }
  .pico-visor-wrapper {
    width: 42px;
    height: 42px;
  }
  .pico-visor-base-img {
    width: 40px;
    height: 40px;
  }
  .pico-eye {
    width: 6px;
    height: 9px;
  }
  .pico-visor-eyes {
    gap: 8px;
  }

  /* Unity window on mobile */
  .unity-build-window {
    right: 8px;
    left: 8px;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
    max-height: calc(100vh - 96px);
    border-radius: 8px;
  }

  .unity-build-body {
    padding: 10px;
    max-height: calc(100vh - 180px);
    gap: 10px;
  }

  .unity-scene-path-text {
    display: none;
  }

  .unity-scene-row {
    padding: 6px 8px;
  }

  .unity-split-view {
    grid-template-columns: 1fr;
    padding: 8px;
    gap: 8px;
  }

  .unity-platform-col {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 6px;
    border-right: none;
    border-bottom: 1px solid #2d2d2d;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .unity-platform-item {
    white-space: nowrap;
    padding: 4px 8px;
    font-size: 10.5px;
  }

  .unity-device-specs-grid {
    grid-template-columns: 90px 1fr;
    font-size: 10.5px;
    gap: 4px 6px;
  }

  .unity-build-footer {
    padding: 8px 10px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .unity-footer-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
}

@media (hover: none) and (pointer: coarse) {
  /* On touchscreens, don't show sticking hover tooltip */
  .pico-bot-tooltip {
    display: none;
  }
}
