@font-face {
  font-family: 'Raleway';
  src: url('../fonts/Raleway-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #ffffff;
  font-family: 'Raleway', sans-serif;
}

.container-fluid, .row {
  height: 100vh;
}

.sidebar {
  background: #f4f6fb;
  overflow-y: hidden;
  height: 100%;
  border-right: 1px solid #d0d7e3;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: #f4f6fb;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #b0b8cc;
  border-radius: 3px;
}

.parts-list {
  font-size: 0.8rem;
  margin-top: 4px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.parts-list::-webkit-scrollbar {
  width: 4px;
}

.parts-list::-webkit-scrollbar-track {
  background: transparent;
}

.parts-list::-webkit-scrollbar-thumb {
  background: #b0b8cc;
  border-radius: 3px;
}

.part-item {
  padding: 6px 10px;
  cursor: pointer;
  color: #2c3e50;
  border-radius: 6px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  margin: 2px 0;
  background: transparent;
  letter-spacing: 0.01em;
}

.part-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: #2c5f8a;
  transform: scaleY(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 3px 3px 0;
}

.part-item:hover {
  background: #e8ecf5;
  color: #1a3a5c;
  padding-left: 14px;
}

.part-item:hover::before {
  transform: scaleY(1);
}

.part-item.active {
  background: #2c5f8a;
  color: #ffffff;
  padding-left: 14px;
}

.part-item.active::before {
  transform: scaleY(1);
  background: #1a3a5c;
}

.part-item.active:hover {
  background: #1e4a6e;
}

#threeContainer {
  width: 100%;
  height: 100%;
  background: #ffffff;
}

.part-info {
  position: absolute;
  top: 60px;
  left: 10px;
  z-index: 5;
  border: 1px solid #d0d7e3;
  opacity: 0.9;
  max-width: 300px;
  background: rgba(255,255,255,0.92) !important;
  color: #2c3e50 !important;
  backdrop-filter: blur(8px);
  border-radius: 10px;
  font-family: 'Raleway', sans-serif;
  animation: fadeSlideIn 0.4s ease-out;
}

.controls-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: rgba(255,255,255,0.85);
  padding: 6px 16px;
  border-radius: 20px;
  white-space: nowrap;
  color: #5a6a7a !important;
  border: 1px solid #d0d7e3;
  backdrop-filter: blur(8px);
  font-family: 'Raleway', sans-serif;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-icon {
  height: 16px;
  width: auto;
  vertical-align: middle;
  margin-right: 4px;
  opacity: 0.7;
}

.control-icon[src*="RightToPan"] {
  filter: saturate(0.25);
  opacity: 0.8;
}

/* ─── Startup Screen ─── */
.startup-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #ffffff;
  font-family: 'Raleway', sans-serif;
  overflow: hidden;
}

.startup-screen.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

#startupCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: default;
}

/* ─── Overlay (pct + status) ─── */
.startup-overlay {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 2;
  pointer-events: none;
}

/* ─── Percentage Text ─── */
.startup-pct {
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 2px;
  display: block;
  margin-bottom: 6px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* ─── Status Text ─── */
.startup-status {
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  letter-spacing: 1px;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}





.site-sign {
  position: absolute;
  bottom: 12px;
  right: 16px;
  z-index: 10;
  opacity: 0.4;
  height: 32px;
  pointer-events: none;
}

#viewerCol {
  position: relative;
  height: 100%;
}

.brand-top-right {
  position: absolute;
  top: 14px;
  right: 24px;
  z-index: 20;
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: #2c5f8a;
  letter-spacing: 2px;
  text-transform: uppercase;
  user-select: none;
  pointer-events: none;
  opacity: 0.85;
}

.brand-top-right span {
  font-weight: 300;
  color: #8a9bb5;
}

/* ─── Sidebar Tabs ─── */
.sidebar-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  padding: 7px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #5a6a7a;
  font-family: 'Raleway', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.3px;
}

.tab-btn:hover {
  background: #e8ecf5;
  color: #2c3e50;
}

.tab-btn.active {
  background: #2c5f8a;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(44,95,138,0.2);
}

/* ─── Parts View ─── */
#partsView {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#partsView.hidden {
  display: none;
}

/* ─── AI View ─── */
#aiView {
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
}

#aiView.active {
  display: flex;
}

#partsView, #aiView {
  animation: tabFadeIn 0.3s ease;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

#aiMessages {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#aiMessages::-webkit-scrollbar {
  width: 4px;
}

#aiMessages::-webkit-scrollbar-track {
  background: transparent;
}

#aiMessages::-webkit-scrollbar-thumb {
  background: #b0b8cc;
  border-radius: 3px;
}

/* ─── AI Welcome Screen ─── */
.ai-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  animation: welcomeFadeIn 0.5s ease;
}

@keyframes welcomeFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-welcome-text {
  font-family: 'Raleway', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #2c5f8a;
  line-height: 1.5;
  margin-bottom: 20px;
}

.ai-welcome-icon {
  width: 72px;
  height: 72px;
  opacity: 0.55;
  transition: opacity 0.3s ease;
}

/* ─── Tutorial Icon ─── */
.tut-icon {
  width: 24px;
  height: 24px;
  display: block;
}

.tut-icon-lg {
  width: 32px;
  height: 32px;
}

/* ─── Chat Messages ─── */
.ai-message {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  animation: fadeSlideIn 0.3s ease-out both;
}

.ai-message.user {
  flex-direction: row;
  justify-content: flex-end;
}

.ai-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.ai-message.bot .ai-avatar {
  background: #e8ecf5;
}

.ai-message.user .ai-avatar {
  background: transparent;
  overflow: hidden;
}

.ai-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.ai-bubble {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.78rem;
  line-height: 1.5;
  max-width: 85%;
  word-wrap: break-word;
}

.ai-message.bot .ai-bubble {
  background: #ffffff;
  color: #2c3e50;
  border: 1px solid #e0e4ed;
  border-bottom-left-radius: 4px;
}

.ai-message.user .ai-bubble {
  background: #2c5f8a;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

/* ─── AI Result Card ─── */
.ai-result-card {
  background: #ffffff;
  border: 1px solid #d0d7e3;
  border-radius: 10px;
  padding: 12px;
  margin-top: 4px;
  animation: fadeSlideIn 0.4s ease-out both;
}

.ai-result-card .result-match {
  font-size: 0.75rem;
  color: #8a9bb5;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.ai-result-card .result-part {
  font-weight: 700;
  color: #2c5f8a;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.ai-result-card .result-label {
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
  margin-bottom: 3px;
}

.ai-result-card .result-text {
  font-size: 0.78rem;
  color: #3d4f60;
  line-height: 1.55;
  margin: 0;
}

/* ─── AI Typing Indicator ─── */
.ai-typing {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  align-items: center;
}

.typing-msg {
  font-size: 0.85rem;
  color: #8892b0;
  white-space: nowrap;
}

.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b0b8cc;
  animation: aiTyping 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes aiTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ─── AI Input Bar ─── */
#aiInputBar {
  display: flex;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid #e0e4ed;
  margin-top: 6px;
  flex-shrink: 0;
}

#aiInput {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d0d7e3;
  border-radius: 8px;
  font-family: 'Raleway', sans-serif;
  font-size: 0.78rem;
  color: #2c3e50;
  outline: none;
  transition: border-color 0.2s ease;
  background: #ffffff;
}

#aiInput:focus {
  border-color: #2c5f8a;
  box-shadow: 0 0 0 3px rgba(44,95,138,0.12);
}

#aiInput:disabled {
  background: #f0f2f6;
  color: #a0aab8;
  cursor: not-allowed;
}

#aiSend {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: #2c5f8a;
  color: #ffffff;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#aiSend:hover:not(:disabled) {
  background: #1e4a6e;
}

#aiSend:disabled {
  background: #c8ceda;
  cursor: not-allowed;
}

.search-box {
  position: relative;
}

.search-box input {
  background: #ffffff;
  border: 1px solid #d0d7e3;
  border-radius: 8px;
  color: #2c3e50;
  font-family: 'Raleway', sans-serif;
  padding-left: 30px;
  transition: all 0.3s ease;
}

.search-box input:focus {
  border-color: #2c5f8a;
  box-shadow: 0 0 0 3px rgba(44, 95, 138, 0.15);
  outline: none;
}

.search-icon-img {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  opacity: 0.45;
  pointer-events: none;
}

.tab-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 4px;
  opacity: 0.7;
}

#showAllBtn {
  color: #2c5f8a !important;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.25s ease;
  margin-bottom: 4px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  background: #f4f6fb;
}

#showAllBtn:hover {
  background: #e8ecf5;
  padding-left: 14px;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.part-item {
  animation: fadeSlideIn 0.3s ease-out both;
}

.education-card {
  max-height: 320px;
  overflow-y: auto;
  padding: 2px;
}

.education-card::-webkit-scrollbar {
  width: 4px;
}

.education-card::-webkit-scrollbar-track {
  background: transparent;
}

.education-card::-webkit-scrollbar-thumb {
  background: #b0b8cc;
  border-radius: 3px;
}

.education-card h5 {
  font-weight: 700;
  color: #2c5f8a;
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.education-card .section {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f2f6;
}

.education-card .section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.education-card .section-label {
  font-weight: 600;
  color: #2c3e50;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.education-card .section-text {
  font-size: 0.78rem;
  color: #3d4f60;
  line-height: 1.55;
}

.ai-examples {
  margin: 6px 0 0;
  padding-left: 18px;
  list-style: none;
}

.ai-examples li {
  font-size: 0.78rem;
  color: #5a6a7a;
  line-height: 1.6;
  font-style: italic;
  position: relative;
}

.ai-examples li::before {
  content: '>';
  position: absolute;
  left: -14px;
  color: #2c5f8a;
  font-weight: 700;
  font-style: normal;
}

/* ─── Tutorial Overlay ─── */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 10005;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.tutorial-overlay.active {
  opacity: 1;
}

.tutorial-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.tutorial-card {
  position: fixed;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  z-index: 10007;
  min-width: 200px;
  max-width: 300px;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: auto;
}

.tutorial-card.animate-in {
  opacity: 1;
}

.tutorial-card.pos-right { transform: translateY(-50%) translateX(-8px); }
.tutorial-card.pos-right.animate-in { transform: translateY(-50%) translateX(0); }

.tutorial-card.pos-left { transform: translateY(-50%) translateX(8px); }
.tutorial-card.pos-left.animate-in { transform: translateY(-50%) translateX(0); }

.tutorial-card.pos-bottom { transform: translateX(-50%) translateY(-8px); }
.tutorial-card.pos-bottom.animate-in { transform: translateX(-50%) translateY(0); }

.tutorial-card.pos-top { transform: translateX(-50%) translateY(8px); }
.tutorial-card.pos-top.animate-in { transform: translateX(-50%) translateY(0); }

.tutorial-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.tutorial-body { flex: 1; }

.tutorial-title {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1a2a3a;
  margin-bottom: 3px;
}

.tutorial-desc {
  font-family: 'Raleway', sans-serif;
  font-weight: 400;
  font-size: 0.78rem;
  color: #5a6a7a;
  line-height: 1.4;
}

.tutorial-footer {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 10008;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  padding: 8px 20px;
  border-radius: 30px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.1);
  opacity: 0;
  transition: opacity 0.5s ease 0.3s;
  pointer-events: auto;
}

.tutorial-overlay.active .tutorial-footer { opacity: 1; }

.tutorial-btn {
  font-family: 'Raleway', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  border-radius: 20px;
  padding: 6px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tutorial-skip {
  background: transparent;
  color: #7a8a9a;
}

.tutorial-skip:hover { color: #1a2a3a; }

.tutorial-next {
  background: #2196d4;
  color: #fff;
}

.tutorial-next:hover { background: #1976b2; }

.tutorial-dots {
  display: flex;
  gap: 6px;
}

.tutorial-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c0c8d4;
  transition: all 0.3s ease;
}

.tutorial-dot.active { background: #2196d4; transform: scale(1.3); }

/* ─── Tutorial Highlight ─── */
.tutorial-highlight {
  position: relative;
  z-index: 10001 !important;
  box-shadow: 0 0 0 4px #2196d4, 0 0 24px rgba(33, 150, 212, 0.35);
  border-radius: 4px;
  animation: tutPulse 2s ease-in-out infinite;
}

@keyframes tutPulse {
  0%, 100% { box-shadow: 0 0 0 4px #2196d4, 0 0 24px rgba(33, 150, 212, 0.35); }
  50% { box-shadow: 0 0 0 7px #2196d4, 0 0 36px rgba(33, 150, 212, 0.5); }
}
