/* ═══════════════════════════════════════
   VET Studio Components
   XP Window, Taskbar, Buttons
   ═══════════════════════════════════════ */

/* ── Page content layer (above all background/CRT) ── */
.desktop, .subpage-layout, main {
  position: relative;
  z-index: 10;
}

/* ── XP Window ── */
.xpw {
  border: 2px solid #A0A0A0;
  border-radius: var(--radius-win);
  background: var(--xp-yellow-light);
  overflow: hidden;
  cursor: default;
  position: relative;
  opacity: 0;
  transition:
    opacity 0.4s ease,
    border-color 0.3s ease,
    box-shadow 0.35s var(--ease-spring),
    transform 0.35s var(--ease-spring);
  box-shadow: var(--shadow-default);
}
.xpw.vis { opacity: 1 }

/* Holographic shimmer overlay */
.xpw::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
  border-radius: var(--radius-win);
  background: linear-gradient(135deg, transparent 20%, rgba(100,180,255,0.06) 40%, rgba(180,100,255,0.04) 60%, transparent 80%);
  background-size: 200% 200%;
  animation: holoShimmer 3s ease-in-out infinite;
}

/* Hover: blue highlight + elastic scale */
.xpw:hover {
  border-color: var(--ie-blue);
  box-shadow: var(--shadow-hover);
  transform: scale(1.03) !important;
}
.xpw:hover::before { opacity: 1 }

/* Click bounce-back */
.xpw:active {
  transform: scale(0.98) !important;
  transition-duration: 0.1s;
}

/* ── XP Title Bar ── */
.xpt {
  height: var(--titlebar-h);
  padding: 0 4px 0 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(90deg, #9BAEC4, #B4B4B4, #9BAEC4);
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  transition: background 0.3s ease;
}
.xpw:hover .xpt {
  background: var(--ie-titlebar);
}
.xpt::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05), rgba(255,255,255,0.15));
  transition: background 0.3s ease;
}
.xpw:hover .xpt::after {
  background: linear-gradient(90deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1), rgba(255,255,255,0.3));
}

/* Title bar icon */
.xpi {
  width: 14px; height: 14px;
  border-radius: var(--radius-icon);
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; color: #fff; font-weight: 700;
}
.xpw[data-a="api"] .xpi { background: var(--accent-api) }
.xpw[data-a="image"] .xpi { background: var(--accent-image) }
.xpw[data-a="fund"] .xpi { background: var(--accent-fund) }
.xpw[data-a="aipd"] .xpi { background: var(--accent-aipd) }

/* Title bar text */
.xpt-t {
  font-size: 0.75rem;
  font-weight: 400;
  color: #fff;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  padding-left: 2px;
}

/* Title bar buttons */
.xpt-b { display: flex; gap: 2px }
.xbtn {
  width: 19px; height: 19px;
  border: none;
  border-radius: var(--radius-btn);
  background: linear-gradient(180deg, var(--xp-yellow), var(--xp-yellow-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #444; line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 1px 0 rgba(0,0,0,0.15);
  pointer-events: none;
}

/* ── XP Window Body ── */
.xpb {
  padding: 14px 16px;
  background: var(--xp-yellow-light);
}
.xpb-t {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: #1a1a1a;
}
.xpb-d {
  color: #555;
  font-size: 0.82rem;
  line-height: 1.55;
}

/* ── XP Status Bar ── */
.xps {
  padding: 3px 8px;
  border-top: 1px solid var(--xp-yellow-dark);
  background: var(--xp-yellow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #666;
  font-family: var(--font-mono);
}
.xps .dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  margin-right: 3px;
}
.xpw[data-a="api"] .dot { background: var(--accent-api) }
.xpw[data-a="image"] .dot { background: var(--accent-image) }
.xpw[data-a="fund"] .dot { background: var(--accent-fund) }
.xpw[data-a="aipd"] .dot { background: var(--accent-aipd) }

/* ═══════════════════════════════════════
   XP TASKBAR
   ═══════════════════════════════════════ */
.taskbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--taskbar-h);
  background: linear-gradient(180deg, #316AC5 0%, #0054E3 3%, #003C99 100%);
  display: flex;
  align-items: center;
  padding: 0 6px;
  gap: 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 -1px 8px rgba(0,0,0,0.3);
}

/* Start button */
.start-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  height: 32px;
  border-radius: var(--radius-btn);
  border: none;
  background: linear-gradient(180deg, var(--xp-green), var(--xp-green-dark));
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none;
  text-shadow: 0 1px 1px rgba(0,0,0,0.3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 1px 0 rgba(0,0,0,0.3);
}
.start-btn:hover { background: linear-gradient(180deg, #4A9A4E, #3D8A41) }
.start-logo { width: 16px; height: 16px }

/* Taskbar divider */
.tb-div {
  width: 1px; height: 24px;
  background: rgba(255,255,255,0.15);
  margin: 0 3px;
}

/* Quick launch */
.tb-quick { display: flex; gap: 1px; margin-left: 2px }
.tb-quick a {
  width: 26px; height: 26px;
  border-radius: var(--radius-icon);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 11px;
}
.tb-quick a:hover { background: rgba(255,255,255,0.12) }

/* Task items */
.tb-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  height: 32px;
  border-radius: var(--radius-btn);
  border: none;
  color: rgba(255,255,255,0.85);
  font-size: 0.78rem;
  text-decoration: none;
  text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}
.tb-item:hover { background: rgba(255,255,255,0.15); color: #fff }
.tb-item.active { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2); color: #fff }
.tb-icon { width: 14px; height: 14px; border-radius: var(--radius-icon) }

/* Clock */
.tb-clock {
  margin-left: auto;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.9);
  padding: 0 10px;
  font-family: var(--font-mono);
  text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}

/* ── Logo SVG (shared) ── */
.logo-svg { display: block }

/* ── Responsive ── */
@media(max-width:768px) {
  .wgrid { grid-template-columns: 1fr !important; gap: 12px !important; }
  .desktop { padding: 20px 14px 56px !important; }
  .taskbar { padding: 0 4px; overflow-x: auto; }
  .tb-item span.tb-label { display: none; }
}
