:root {
  --bg-dark: #070913; /* Sleek dark blue-black */
  --bg-panel: rgba(16, 20, 32, 0.4);
  --bg-sidebar: rgba(16, 20, 32, 0.5);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #38bdf8; /* Light sky blue */
  --accent-2: #818cf8; /* Indigo */
  --accent-3: #2dd4bf; /* Teal */
  --accent-hover: #7dd3fc;
  --accent-glow: rgba(56, 189, 248, 0.5);
  --border: rgba(255, 255, 255, 0.08);
  --hover-item: rgba(255, 255, 255, 0.06);
  --selected-item: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.15),
    rgba(129, 140, 248, 0.15)
  );
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-code: "Fira Code", monospace;
}

[v-cloak] {
  display: none !important;
  opacity: 0;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  perspective: 1000px;
}

body.is-resizing {
  user-select: none;
  cursor: col-resize !important;
}

.container {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
}

/* ---------- HEADER ---------- */
.main-header {
  padding: 20px 40px;
  background: linear-gradient(
    180deg,
    rgba(16, 18, 27, 0.8),
    rgba(16, 18, 27, 0.3)
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 50;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  color: var(--accent);
  filter: drop-shadow(0 0 12px var(--accent-glow));
  animation: floatIcon 3s ease-in-out infinite alternate;
}

@keyframes floatIcon {
  0% {
    transform: translateY(0px) rotate(0deg) scale(1);
  }
  100% {
    transform: translateY(-4px) rotate(5deg) scale(1.05);
  }
}

.main-header h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* ---------- WORKSPACE ---------- */
.workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  background: var(--bg-dark);
}

/* Mesh Gradient Background */
.workspace::before {
  content: "";
  position: absolute;
  top: -20%;
  left: -20%;
  width: 140%;
  height: 140%;
  background:
    radial-gradient(
      circle at 20% 30%,
      rgba(56, 189, 248, 0.15) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(129, 140, 248, 0.12) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 50% 80%,
      rgba(45, 212, 191, 0.1) 0%,
      transparent 50%
    );
  animation: meshFlow 20s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
}

@keyframes meshFlow {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-2%, 3%) scale(1.05);
  }
  100% {
    transform: translate(3%, -2%) scale(1);
  }
}

/* ---------- WELCOME AREA ---------- */
.welcome-area {
  margin: auto;
  max-width: 700px;
  padding: 60px;
  z-index: 10;
  perspective: 1000px;
  animation: fadeIn3D 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn3D {
  from {
    opacity: 0;
    transform: translateY(30px) translateZ(-100px) rotateX(10deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateZ(0) rotateX(0deg);
  }
}

.welcome-card {
  position: relative;
  background: rgba(20, 22, 32, 0.4);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: 24px;
  padding: 64px 56px;
  text-align: center;
  box-shadow:
    0 30px 60px -15px rgba(0, 0, 0, 0.9),
    0 0 40px rgba(56, 189, 248, 0.1),
    inset 0 1px 2px rgba(255, 255, 255, 0.15);
  transform-style: preserve-3d;
  transition:
    transform 0.4s ease,
    box-shadow 0.4s ease;
}

.welcome-card:hover {
  transform: translateY(-5px) rotateX(2deg) rotateY(-2deg);
  box-shadow:
    0 40px 80px -20px rgba(0, 0, 0, 0.9),
    0 0 60px rgba(129, 140, 248, 0.2),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.welcome-icon {
  width: 100px;
  height: 100px;
  color: var(--accent);
  margin-bottom: 32px;
  filter: drop-shadow(0 0 25px var(--accent-glow));
  transform: translateZ(30px); /* 3D pop */
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-card:hover .welcome-icon {
  transform: translateZ(50px) scale(1.1) rotate(5deg);
}

.welcome-card h2 {
  margin-top: 0;
  font-weight: 800;
  font-size: 44px;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transform: translateZ(20px);
}

.welcome-card p {
  color: var(--text-muted);
  margin-bottom: 48px;
  font-size: 20px;
  line-height: 1.6;
  transform: translateZ(10px);
}

/* ---------- EDITOR LAYOUT ---------- */
.editor-layout {
  display: flex;
  flex: 1;
  width: 100%;
  overflow: hidden;
  padding: 24px 32px 32px 32px; /* Surrounding space to make panels float */
  gap: 16px;
  box-sizing: border-box;
  z-index: 10;
  perspective: 1500px;
  animation: slideUp3D 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp3D {
  from {
    opacity: 0;
    transform: translateY(40px) translateZ(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateZ(0);
  }
}

.sidebar {
  flex-shrink: 0;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  box-shadow:
    -10px 15px 30px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 1px rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
  align-self: flex-start;
  max-height: 100%;
}

.sidebar:hover {
  box-shadow:
    -12px 20px 40px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(129, 140, 248, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.resizer {
  width: 6px;
  background-color: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  cursor: col-resize;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 20;
  margin: auto 0;
  height: 40px; /* Pill shaped */
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.5);
}
.resizer::after {
  content: "";
  position: absolute;
  top: -100px;
  left: -8px;
  right: -8px;
  bottom: -100px;
}
.resizer:hover,
.is-resizing .resizer {
  background-color: var(--accent);
  box-shadow:
    0 0 15px var(--accent),
    0 0 30px var(--accent-2);
  transform: scaleY(1.5) scaleX(1.2);
  height: 60px;
}

.sidebar-header {
  padding: 20px 24px;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  flex-shrink: 0;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.sidebar > .tree-list {
  padding: 0 12px 20px 12px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}

.tree-list {
  list-style-type: none;
  padding-left: 12px;
  margin: 0;
}

.sidebar > .tree-list {
  padding-left: 0;
}

.tree-node {
  margin: 4px 0;
}

.node-content {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 15px;
  color: var(--text-muted);
  user-select: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  gap: 10px;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.node-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}

.node-content:hover {
  color: var(--text-main);
  transform: translateX(4px) scale(1.02);
  box-shadow:
    4px 4px 10px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.node-content:hover::before {
  opacity: 1;
}

.node-content.is-selected {
  background: var(--selected-item) !important;
  color: #fff !important;
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow:
    0 4px 15px rgba(56, 189, 248, 0.15),
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    inset 0 -2px 5px rgba(0, 0, 0, 0.3);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.icon-sm {
  width: 20px;
  height: 20px;
  stroke-width: 2.5px;
}

.node-content .icon-wrapper > svg {
  color: var(--text-muted);
}
.node-content:hover .icon-wrapper > svg {
  color: var(--accent);
  filter: drop-shadow(0 0 5px var(--accent-glow));
}
.node-content.is-selected .icon-wrapper > svg {
  color: #fff;
  filter: drop-shadow(0 0 8px #fff);
}

.icon-spacer {
  width: 20px;
  height: 20px;
  display: inline-block;
  flex-shrink: 0;
}

.icon-checked {
  color: #fff !important;
}

.node-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  padding-right: 6px;
  font-weight: 600;
}

.folder-action {
  margin-left: auto;
  display: flex;
  align-items: center;
  padding: 5px;
  border-radius: 6px;
  color: var(--text-muted);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  transform: scale(0.8);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.node-content:hover .folder-action {
  opacity: 1;
  transform: scale(1);
}

.folder-action:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #fff;
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* ---------- PREVIEW PANEL ---------- */
.preview-panel {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: rgba(13, 15, 22, 0.65);
  height: 100%;
  border-radius: 16px;
  box-shadow:
    15px 15px 40px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 1px rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  overflow: hidden;
}

.toolbar {
  padding: 20px 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.file-info .icon-sm {
  color: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

.file-name {
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.action-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.selection-count {
  font-size: 15px;
  color: #fff;
  font-weight: 700;
  padding: 8px 18px;
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.3),
    rgba(129, 140, 248, 0.3)
  );
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.3);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.code-viewer-container {
  flex: 1;
  padding: 32px 40px;
  overflow: auto;
  box-shadow: inset 0 20px 40px -20px rgba(0, 0, 0, 0.8);
  background: rgba(0, 0, 0, 0.2); /* Deeper inset background */
}

.code-viewer {
  margin: 0;
  font-family: var(--font-code);
  font-size: 16px;
  line-height: 1.7;
  color: #e4e4e7;
  tab-size: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* ---------- PRISM THEME OVERRIDES ---------- */
pre[class*="language-"] {
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  text-shadow: none !important;
}

code[class*="language-"],
pre[class*="language-"] {
  font-family: var(--font-code) !important;
  font-size: 16px !important;
  line-height: 1.7 !important;
  color: #e4e4e7 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8) !important;
}

/* ---------- BUTTONS (3D MAGIC) ---------- */
button {
  font-family: var(--font-ui);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  outline: none;
  transform-style: preserve-3d;
}
button:active {
  transform: scale(0.94) translateY(2px) !important;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.5) !important;
}

.btn-primary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  padding: 12px 24px;
  font-size: 15px;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}
.btn-primary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow:
    0 8px 15px rgba(0, 0, 0, 0.4),
    0 0 15px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-lg {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  padding: 20px 40px;
  font-size: 20px;
  box-shadow:
    0 10px 25px rgba(129, 140, 248, 0.4),
    0 0 20px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  transform: translateZ(20px);
}
.btn-lg:hover {
  background: linear-gradient(135deg, var(--accent-hover), #ba55d3);
  box-shadow:
    0 15px 35px rgba(129, 140, 248, 0.6),
    0 0 30px rgba(56, 189, 248, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: translateZ(30px) translateY(-3px) scale(1.02);
}

.btn-export {
  background: linear-gradient(135deg, var(--accent), #00b3a3);
  color: #000;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  padding: 12px 28px;
  font-size: 16px;
  box-shadow:
    0 6px 15px rgba(56, 189, 248, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.btn-export:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  box-shadow:
    0 10px 25px rgba(56, 189, 248, 0.5),
    0 0 15px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
}
.btn-export:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
  cursor: not-allowed;
  transform: none !important;
  text-shadow: none;
}

/* ---------- TOKEN ESTIMATOR ---------- */
.tree-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.token-estimator {
  margin-top: auto;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.estimator-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.estimator-row .label {
  color: var(--text-muted);
  font-weight: 500;
}

.estimator-row .value {
  color: var(--text-main);
  font-family: var(--font-code);
  font-weight: 600;
}

.estimator-row .value.highlight {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent-glow);
}

.estimator-row .value.money {
  color: var(--accent-3);
  text-shadow: 0 0 8px rgba(45, 212, 191, 0.4);
}
/* ---------- HEADER ACTIONS ---------- */
.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}


