/* ══════════════════════════════════════
   DEMOS PAGE — Linux Monitor + Glass Backdrop
   ══════════════════════════════════════ */

/* ── Full-page glass backdrop ── */
.demos-glass-backdrop {
  display: none;
}

/* Panel itself acts as the container now */
.panel--active[data-panel="demos"] {
  position: relative;
  height: calc(100% + 20px);
  overflow: hidden;
  margin-top: -15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The glow now sits directly in the panel */
.panel--active[data-panel="demos"] > .demos-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  z-index: 0;
}

/* ── Gradient glow behind the monitor ── */
.demos-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    from 180deg,
    #ffd24d 0deg,
    #ff5b5b 90deg,
    #c45bff 200deg,
    #6b5bff 280deg,
    #ffd24d 360deg
  );
  filter: blur(180px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
  animation: glow-rotate 20s linear infinite;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 30%, transparent 70%);
}

@keyframes glow-rotate {
  to { rotate: 360deg; }
}

/* ── Monitor shell ── */
.monitor-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.monitor {
  width: min(92%, 1050px);
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.08);
  background: #171717;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* ══════════════════════════════════════
   BEZEL — Linux / Cinnamon style
   ══════════════════════════════════════ */
.monitor-bezel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: linear-gradient(180deg, #222 0%, #1a1a1a 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.bezel-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bezel-icon {
  font-size: 14px;
  line-height: 1;
}

.bezel-title {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.04em;
}

/* ── Window control buttons (right side, Linux style) ── */
.bezel-controls {
  display: flex;
  gap: 2px;
}

.wc-btn {
  width: 28px;
  height: 24px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  font-family: system-ui, sans-serif;
}

.wc-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}

.wc-close:hover {
  background: rgba(255, 70, 70, 0.7);
  color: #fff;
}

/* ══════════════════════════════════════
   SCREEN — gray background
   ══════════════════════════════════════ */
.monitor-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #2c2c2c;
  overflow: hidden;
}

/* ══════════════════════════════════════
   BOOT SEQUENCE
   ══════════════════════════════════════ */
.boot-sequence {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #2c2c2c;
  z-index: 10;
  transition: opacity 0.8s ease;
}

.boot-sequence.boot-done {
  opacity: 0;
  pointer-events: none;
}

.boot-logo {
  font-size: 52px;
  margin-bottom: 24px;
  animation: boot-pulse 1.5s ease-in-out infinite alternate;
}

.boot-text {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.82rem;
  color: var(--ll-amber);
  letter-spacing: 0.06em;
  min-height: 1.2em;
  margin-bottom: 20px;
}

.boot-bar {
  width: 220px;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.boot-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--ll-amber), var(--ll-gold));
  border-radius: 2px;
  transition: width 0.3s ease;
}

@keyframes boot-pulse {
  0%   { transform: scale(1);    filter: drop-shadow(0 0 12px rgba(255,180,0,0.3)); }
  100% { transform: scale(1.06); filter: drop-shadow(0 0 24px rgba(255,180,0,0.5)); }
}

/* ══════════════════════════════════════
   DESKTOP
   ══════════════════════════════════════ */
.desktop {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.desktop.desktop--active {
  opacity: 1;
}

/* ── Desktop content — 2x2 grid (left) + chat (right) ── */
.desktop-area {
  flex: 1;
  display: flex;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
}

.demo-card-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 32px;
  padding: 20px;
  min-width: 0;
}

/* ══════════════════════════════════════
   BOTTOM TASKBAR
   ══════════════════════════════════════ */
.taskbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  height: 44px;
  background: linear-gradient(180deg, #1a1a1a, #111);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.taskbar-apps {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
}

.taskbar-icon {
  font-size: 20px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  line-height: 1;
}

.taskbar-icon:hover {
  background: rgba(255, 255, 255, 0.08);
}

.taskbar-tray {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-left: auto;
}

.tray-item {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
}

.tray-clock {
  min-width: 52px;
  text-align: right;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

/* ══════════════════════════════════════
   CODE TYPING OVERLAY (centered, plays after boot)
   ══════════════════════════════════════ */
.code-typing-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2c2c2c;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.code-typing-overlay.typing--active {
  opacity: 1;
  pointer-events: auto;
}

.code-typing-overlay.typing--done {
  opacity: 0;
  pointer-events: none;
}

.code-typing-box {
  width: 80%;
  max-width: 600px;
  max-height: 70%;
  overflow: hidden;
}

.code-typing-box pre {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  white-space: pre;
}

/* Syntax colors */
.code-typing-box .kw  { color: #c792ea; }
.code-typing-box .fn  { color: #82aaff; }
.code-typing-box .str { color: #c3e88d; }
.code-typing-box .cm  { color: #546e7a; }
.code-typing-box .tp  { color: #ffcb6b; }
.code-typing-box .num { color: #f78c6c; }

/* ══════════════════════════════════════
   DEMO CARDS — glass style (matches services)
   ══════════════════════════════════════ */
.demo-card {
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.06) 50%, rgba(255, 255, 255, 0.10) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(16px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.demo-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ll-amber), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.demo-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.3),
    0 0 24px rgba(255, 180, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.demo-card:hover::before {
  opacity: 1;
}

.demo-card-icon {
  font-size: 28px;
}

.demo-card-title {
  font-family: "Exo 2", sans-serif;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.03em;
}

/* ══════════════════════════════════════
   IN-MONITOR CHAT — right side
   ══════════════════════════════════════ */
.monitor-chat {
  width: 42%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  min-height: 0;
  margin: 10px 10px 10px 0;
}

.monitor-chat .chat-header {
  padding: 10px 14px;
  font-size: 0.88rem;
  gap: 8px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.monitor-chat .chat-header .material-symbols-outlined {
  font-size: 20px;
}

.monitor-chat .chat-messages {
  padding: 10px 14px;
  min-height: 0;
  max-height: none;
  flex: 1;
  overflow-y: auto;
  gap: 10px;
  display: flex;
  flex-direction: column;
}

.monitor-chat .chat-bubble {
  padding: 10px 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  border-radius: 10px;
  max-width: 88%;
}

.monitor-chat .chat-input-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-shrink: 0;
}

.monitor-chat .chat-input {
  padding: 12px 14px;
  font-size: 0.88rem;
  flex: 1;
  background: transparent;
  border: none;
  color: var(--ll-white);
  outline: none;
}

.monitor-chat .chat-send {
  padding: 12px 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ll-amber);
}

.monitor-chat .chat-send .material-symbols-outlined {
  font-size: 20px;
}

.monitor-chat .chat-typing {
  padding: 10px 14px;
  display: flex;
  gap: 4px;
}

.monitor-chat .chat-typing-dot {
  width: 6px;
  height: 6px;
}

/* Typing cursor */
.editor-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--ll-gold);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 1px;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ══════════════════════════════════════
   DEMO VIEW OVERLAY — zoom from card
   ══════════════════════════════════════ */
.demo-view {
  position: absolute;
  inset: 0;
  z-index: 15;
  background: #1a1a2e;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.3);
  transform-origin: center;
  transition:
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.demo-view.demo-view--active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* Close button */
.demo-view-close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 20;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  font-family: system-ui, sans-serif;
  backdrop-filter: blur(8px);
}

.demo-view-close:hover {
  background: rgba(255, 70, 70, 0.7);
  color: #fff;
}

/* Individual demo pages - hidden by default */
.demo-page {
  display: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.demo-page.demo-page--active {
  display: flex;
  flex-direction: column;
}


/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 700px) {
  .demos-glass-backdrop {
    margin: 3px;
    padding: 12px 6px 6px;
    border-radius: 12px;
  }

  .monitor {
    width: 100%;
  }

  .monitor-screen {
    aspect-ratio: 4 / 3;
  }

  .desktop-area {
    flex-direction: column;
  }

  .demo-card-grid {
    grid-template-columns: 1fr 1fr;
  }

  .monitor-chat {
    width: 100%;
  }

  .code-typing-box pre {
    font-size: 0.6rem;
  }

  .bezel-title {
    display: none;
  }
}
