/* ===================================================================
   LAMINAK — "WinXP" Theme
   Retro Windows XP. Luna blue taskbar, silver chrome, classic
   green/blue gradients. "Where do you want to go today?"
   =================================================================== */

/* ── Theme Variables ── */
body.theme-winxp {
  --bg:              #ece9d8;
  --bg-card:         #ffffff;
  --bg-input:        #ffffff;
  --bg-hover:        rgba(49, 106, 197, 0.08);
  --border:          #a0a0a0;
  --text:            #1a1a1a;
  --text-muted:      #5a5a5a;
  --accent:          #316ac5;
  --accent-hover:    #1e4fa0;
  --accent-dim:      rgba(49, 106, 197, 0.1);
  --user-bg:         rgba(49, 106, 197, 0.08);
  --assistant-bg:    #f5f4ee;
  --success:         #2d8c2d;
  --warning:         #c87000;
  --error:           #cc0000;
  --thinking-bg:     #f0efe8;
  --thinking-border: #b0b0b0;
  --tool-bg:         #f5f4ee;
  --tool-border:     #c0bfb8;
  --bg-secondary:    #f0efe8;
  --glass:           rgba(236, 233, 216, 0.97);
  --glass-border:    #a0a0a0;
  --orb-idle:       radial-gradient(circle, #5ca0e8 0%, #316ac5 40%, #1a3f80 100%);
  --orb-thinking:   radial-gradient(circle, #c09000 0%, #906000 40%, #604000 100%);
  --orb-speaking:   radial-gradient(circle, #50c050 0%, #2d8c2d 40%, #1a5a1a 100%);
  --orb-listening:  radial-gradient(circle, #e09050 0%, #c07030 40%, #905020 100%);
  --orb-error:      radial-gradient(circle, #ff6060 0%, #cc0000 40%, #880000 100%);
}

/* ── Background — papier peint XP ── */
body.theme-winxp {
  background: #ece9d8;
  font-family: 'Trebuchet MS', Tahoma, var(--font);
}

body.theme-winxp::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(49, 106, 197, 0.04) 0%, transparent 60%),
    #ece9d8;
}

/* ── Header — barre de titre XP ── */
body.theme-winxp header {
  background: linear-gradient(180deg,
    #2a5fcc 0%,
    #316ac5 8%,
    #245db8 45%,
    #1e50a8 50%,
    #2458ba 51%,
    #316ac5 100%
  );
  border-bottom: 1px solid #1a3f80;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.25) inset, 0 1px 4px rgba(0,0,0,0.3);
  color: #fff;
}

body.theme-winxp .logo-text { color: #ffffff !important; }
body.theme-winxp .logo-accent { color: #ffdd88 !important; }

/* ── Credits badge — pill chrome XP ── */
body.theme-winxp .credits-badge {
  background: linear-gradient(180deg, #f0f8ff 0%, #d8e8f8 100%) !important;
  border: 1px solid #7090c0 !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset !important;
}
body.theme-winxp .credits-badge,
body.theme-winxp .credits-badge span { color: #1a2a4a !important; }
body.theme-winxp .credits-badge.level-ok,
body.theme-winxp .credits-badge.level-ok span { color: #1a5a1a !important; }
body.theme-winxp .credits-badge.level-low,
body.theme-winxp .credits-badge.level-low span { color: #7a3800 !important; }
body.theme-winxp .credits-badge.level-critical,
body.theme-winxp .credits-badge.level-critical span { color: #aa0000 !important; }

/* ── User email ── */
body.theme-winxp .user-email-header { color: #4fc3f7 !important; }

/* ── Boutons icônes dans le header ── */
body.theme-winxp .btn-icon.rp-toggle-header-btn { color: #c8dcf8 !important; }
body.theme-winxp .btn-icon.rp-toggle-header-btn:hover { color: #ffffff !important; }
body.theme-winxp.right-panel-trace .btn-icon.rp-toggle-header-btn { color: #ffdd88 !important; }

/* ── End-node select — pill chrome XP dans le header ── */
body.theme-winxp #daemon-select {
  background: linear-gradient(180deg, #eaf2ff 0%, #c8ddf8 100%) !important;
  border: 1px solid #7090c0 !important;
  border-radius: 10px !important;
  color: #1a2a4a !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset !important;
}

/* ── Logo pill — style orbe/bouton Windows XP ── */
body.theme-winxp .header-logo {
  background: linear-gradient(180deg,
    #5a9eff 0%,
    #3a7fe8 18%,
    #1e5cc8 45%,
    #1650b0 50%,
    #1e5cc8 51%,
    #3070d8 80%,
    #4888f0 100%
  ) !important;
  border: 1px solid #0a3080 !important;
  border-radius: 20px !important;
  padding: 4px 14px !important;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.45) inset,
    0 -1px 0 rgba(0,0,0,0.2) inset,
    0 2px 5px rgba(0,0,60,0.35) !important;
  color: #fff !important;
}

body.theme-winxp .logo-icon {
  background: linear-gradient(135deg, #5ca0e8, #316ac5);
  border-radius: 4px;
  color: #fff;
  border: 1px solid #1a3f80;
  box-shadow: 1px 1px 0 rgba(255,255,255,0.3) inset;
}

/* ── Nav sidebar — panneau XP ── */
body.theme-winxp #app-nav {
  background: linear-gradient(180deg, #6699dd 0%, #316ac5 8%, #1e50a8 100%);
  border-right: 2px solid #1a3f80;
  color: #fff;
}

body.theme-winxp #app-nav * { color: #fff; }

body.theme-winxp .nav-item.active {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border-left: 3px solid #7fb8ff;
  font-weight: 700;
}

body.theme-winxp .nav-item:hover {
  background: rgba(255, 255, 255, 0.14);
}

body.theme-winxp .sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* ── Messages — bulles de chat ── */
body.theme-winxp .msg.user .msg-body {
  background: #dce8fb;
  border: 1px solid #a0b8e0;
  border-radius: 8px 8px 2px 8px;
}

body.theme-winxp .msg.assistant .msg-body {
  background: #ffffff;
  border: 1px solid #c0bfb8;
  border-radius: 8px 8px 8px 2px;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.06);
}

body.theme-winxp .msg.assistant .msg-avatar {
  background: linear-gradient(135deg, #5ca0e8, #316ac5);
  color: #fff;
}

/* ── Input area — barre d'outils XP ── */
body.theme-winxp .input-area {
  background: linear-gradient(180deg, #ece9d8 0%, #d4d0c8 100%);
  border-top: 2px solid #a0a0a0;
  box-shadow: 0 -1px 0 rgba(255,255,255,0.8);
}

body.theme-winxp #msg-input {
  background: #fff;
  border: 2px solid #316ac5;
  border-radius: 3px;
  color: #1a1a1a;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.15) inset;
}

body.theme-winxp #msg-input:focus {
  border-color: #1e50a8;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.15) inset, 0 0 0 2px rgba(49, 106, 197, 0.2);
}

/* ── Send button — bouton XP chrome ── */
body.theme-winxp .send-btn {
  background: linear-gradient(180deg, #f0f0f0 0%, #d4d0c8 40%, #c0bdb5 100%);
  color: #1a1a1a;
  border: 1px solid #808080;
  border-radius: 3px;
  box-shadow: 1px 1px 0 rgba(255,255,255,0.9) inset, -1px -1px 0 rgba(0,0,0,0.1) inset;
}

body.theme-winxp .send-btn:hover {
  background: linear-gradient(180deg, #dce8fb 0%, #b8ccf0 50%, #a0b8e0 100%);
  border-color: #316ac5;
}

/* ── Model picker ── */
body.theme-winxp .model-picker-btn {
  background: linear-gradient(180deg, #f0f0f0 0%, #d4d0c8 100%);
  border: 1px solid #808080;
  border-radius: 3px;
  color: #1a1a1a;
  box-shadow: 1px 1px 0 rgba(255,255,255,0.9) inset;
}

body.theme-winxp .model-picker-btn:hover {
  border-color: #316ac5;
  background: linear-gradient(180deg, #dce8fb 0%, #c0d4f0 100%);
}

body.theme-winxp .model-picker-bubble {
  background: #ffffff;
  border: 1px solid #808080;
  border-radius: 3px;
  box-shadow: 3px 3px 6px rgba(0,0,0,0.25);
}

body.theme-winxp .model-picker-bubble::after {
  background: #ffffff;
  border-color: #808080;
}

/* ── Suggestions ── */
body.theme-winxp .suggestion {
  background: linear-gradient(180deg, #f5f4ee 0%, #eae8e0 100%);
  border: 1px solid #a0a0a0;
  border-radius: 4px;
  box-shadow: 1px 1px 0 rgba(255,255,255,0.9) inset;
}

body.theme-winxp .suggestion:hover {
  background: linear-gradient(180deg, #dce8fb 0%, #c8d8f5 100%);
  border-color: #316ac5;
  color: #1a1a1a;
}

/* ── Thinking / tool blocks ── */
body.theme-winxp .thinking-block {
  background: #f0efe8;
  border-color: #b0b0a8;
  border-radius: 3px;
}

body.theme-winxp .tool-block {
  background: #f5f4ee;
  border-color: #c0bfb8;
  border-radius: 3px;
}

/* ── Code blocks ── */
body.theme-winxp pre,
body.theme-winxp code {
  background: #f8f8f8;
  border: 1px solid #c0bfb8;
  border-radius: 2px;
  font-family: 'Courier New', Courier, monospace;
  color: #1a1a1a;
}

/* ── Buttons ── */
body.theme-winxp .btn-primary {
  background: linear-gradient(180deg, #4a8aff 0%, #316ac5 40%, #1e50a8 100%);
  color: #fff;
  border: 1px solid #1a3f80;
  border-radius: 3px;
  font-weight: 700;
  box-shadow: 1px 1px 0 rgba(255,255,255,0.3) inset, 0 1px 3px rgba(0,0,0,0.2);
}

body.theme-winxp .btn-primary:hover {
  background: linear-gradient(180deg, #5a9aff 0%, #3d78d0 40%, #2860b8 100%);
}

body.theme-winxp .btn-icon { color: #5a5a5a; }
body.theme-winxp .btn-icon:hover { color: #1a1a1a; background: rgba(49,106,197,0.1); }
body.theme-winxp .btn-icon.active { color: #316ac5; }

/* ── Auth — dialog box XP ── */
body.theme-winxp .auth-card {
  background: #ece9d8;
  border: 1px solid #808080;
  border-radius: 6px;
  box-shadow: 4px 4px 10px rgba(0,0,0,0.3), 1px 1px 0 rgba(255,255,255,0.8) inset;
}

body.theme-winxp #connect-screen { background: #ece9d8; }
body.theme-winxp #connect-screen .big-spinner {
  border-color: rgba(49, 106, 197, 0.15);
  border-top-color: #316ac5;
}

/* ── Status dot — online vert XP ── */
body.theme-winxp .status-dot {
  background: #2d8c2d;
  box-shadow: 0 0 4px #2d8c2d;
}

/* ── Scrollbars — style XP ── */
body.theme-winxp ::-webkit-scrollbar { width: 16px; }
body.theme-winxp ::-webkit-scrollbar-track {
  background: #d4d0c8;
  border-left: 1px solid #a0a0a0;
}
body.theme-winxp ::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #e0ddd5 0%, #c0bdb5 50%, #a8a5a0 100%);
  border: 1px solid #808080;
  border-radius: 2px;
  box-shadow: 1px 0 0 rgba(255,255,255,0.5) inset;
}
body.theme-winxp ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #c8d8f5 0%, #a0b8e0 50%, #8098c8 100%);
}
body.theme-winxp ::-webkit-scrollbar-button {
  background: linear-gradient(180deg, #e0ddd5 0%, #c0bdb5 100%);
  border: 1px solid #808080;
  height: 16px;
}

/* ── Focus ── */
body.theme-winxp :focus-visible {
  outline: 2px dotted #316ac5;
  outline-offset: 1px;
}
