/* ══════════════════════════════════════════════════════
   Smart AI Library — Kiosk CSS
   Premium dark glassmorphism theme
   FEB Undip • Asisten Virtual Sari
   ══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Design Tokens ──────────────────────────────────── */
:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #12122a;
  --bg-glass: rgba(20, 20, 50, 0.65);
  --bg-glass-light: rgba(40, 40, 80, 0.45);

  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-glow: rgba(108, 92, 231, 0.4);

  --teal: #1dd1a1;
  --teal-glow: rgba(29, 209, 161, 0.3);

  --text-primary: #f0f0ff;
  --text-secondary: rgba(240, 240, 255, 0.6);
  --text-muted: rgba(240, 240, 255, 0.35);

  --border: rgba(108, 92, 231, 0.2);
  --border-active: rgba(108, 92, 231, 0.5);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-full: 9999px;

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ───────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* ── Background Gradient ────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(108, 92, 231, 0.15), transparent),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(29, 209, 161, 0.08), transparent),
    radial-gradient(ellipse 40% 40% at 10% 60%, rgba(108, 92, 231, 0.06), transparent);
  pointer-events: none;
  z-index: 0;
}

/* ── Screen Container ───────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
  z-index: 1;
}

.screen.active {
  opacity: 1;
  visibility: visible;
}

/* ══════════════════════════════════════════════════════
   IDLE SCREEN
   ══════════════════════════════════════════════════════ */

.idle-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.orb-bg {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(0px);
}

.idle-branding {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: -20px;
}

.idle-branding img {
  width: 40px;
  height: 40px;
}

.idle-branding span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.idle-text h1 {
  font-size: 2.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  line-height: 1.15;
}

.idle-text p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Visit Button */
.btn-visit {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 48px;
  font-size: 1.2rem;
  font-weight: 600;
  font-family: inherit;
  color: white;
  background: linear-gradient(135deg, var(--accent), #5a4bd1);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow:
    0 4px 24px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  animation: pulse-glow 2.5s ease-in-out infinite;
}

.btn-visit:hover {
  transform: scale(1.05);
  box-shadow:
    0 8px 40px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-visit:active {
  transform: scale(0.97);
}

.btn-visit .btn-icon {
  font-size: 1.5rem;
}

/* Shimmer effect on button */
.btn-visit::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 60%
  );
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 4px 24px var(--accent-glow); }
  50% { box-shadow: 0 8px 48px rgba(108, 92, 231, 0.5); }
}

/* ══════════════════════════════════════════════════════
   SCANNING SCREEN
   ══════════════════════════════════════════════════════ */

.scan-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.video-frame {
  position: relative;
  width: 400px;
  height: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border-active);
  box-shadow: 0 0 40px var(--accent-glow);
  background: var(--bg-secondary);
}

.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.scan-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Animated scan line */
.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-light),
    var(--accent),
    var(--accent-light),
    transparent
  );
  box-shadow: 0 0 20px var(--accent-glow), 0 0 60px var(--accent-glow);
  animation: scan-move 2s ease-in-out infinite;
}

@keyframes scan-move {
  0%, 100% { top: 0; }
  50% { top: calc(100% - 3px); }
}

/* Corner brackets */
.video-frame::before,
.video-frame::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  border: 3px solid var(--accent-light);
  z-index: 5;
}

.video-frame::before {
  top: 12px;
  left: 12px;
  border-right: none;
  border-bottom: none;
}

.video-frame::after {
  bottom: 12px;
  right: 12px;
  border-left: none;
  border-top: none;
}

.scan-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 500;
  animation: fade-pulse 1.5s ease-in-out infinite;
}

@keyframes fade-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ══════════════════════════════════════════════════════
   CHAT SCREEN (Registration + Conversation)
   ══════════════════════════════════════════════════════ */

.chat-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  height: 100%;
  gap: 0;
}

/* Left panel: Orb */
.chat-orb {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
}

.orb-main {
  width: 100%;
  height: 100%;
}

.status-text {
  position: absolute;
  bottom: 40px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 8px 20px;
  background: var(--bg-glass);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

/* Listening indicator */
.listening-indicator {
  position: absolute;
  bottom: 90px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--teal);
  font-weight: 500;
}

.listening-dot {
  width: 8px;
  height: 8px;
  background: var(--teal);
  border-radius: 50%;
  animation: listening-blink 1s ease-in-out infinite;
}

@keyframes listening-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Right panel: Transcript + controls */
.chat-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-secondary);
}

/* Chat header */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
}

.chat-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.chat-header-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-header-info span {
  font-size: 0.75rem;
  color: var(--teal);
  font-weight: 500;
}

/* Transcript area */
.transcript {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

/* Custom scrollbar */
.transcript::-webkit-scrollbar {
  width: 4px;
}

.transcript::-webkit-scrollbar-track {
  background: transparent;
}

.transcript::-webkit-scrollbar-thumb {
  background: var(--border-active);
  border-radius: var(--radius-full);
}

/* Message bubbles */
.message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  line-height: 1.55;
  word-wrap: break-word;
  animation: msg-in 0.3s ease-out;
}

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

.message-assistant {
  align-self: flex-start;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.message-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), #5a4bd1);
  color: white;
  border-bottom-right-radius: 4px;
}

.message-system {
  align-self: center;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
  padding: 6px 0;
}

/* Chat controls */
.chat-controls {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 12px;
}

.voice-status {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.voice-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 18px;
}

.voice-bar {
  width: 3px;
  height: 4px;
  background: var(--teal);
  border-radius: 1px;
  animation: voice-bar-anim 0.8s ease-in-out infinite;
}

.voice-bar:nth-child(1) { animation-delay: 0s; }
.voice-bar:nth-child(2) { animation-delay: 0.1s; }
.voice-bar:nth-child(3) { animation-delay: 0.2s; }
.voice-bar:nth-child(4) { animation-delay: 0.3s; }

@keyframes voice-bar-anim {
  0%, 100% { height: 4px; }
  50% { height: 16px; }
}

.btn-checkout {
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-secondary);
  background: var(--bg-glass-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-checkout:hover {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.3);
  background: rgba(255, 107, 107, 0.08);
}

/* ══════════════════════════════════════════════════════
   CHECKOUT SCREEN
   ══════════════════════════════════════════════════════ */

.checkout-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  animation: checkout-in 0.6s ease-out;
}

@keyframes checkout-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.checkout-icon {
  font-size: 5rem;
  animation: checkout-bounce 0.6s ease-out;
}

@keyframes checkout-bounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.checkout-content h2 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--teal), #10ac84);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.checkout-content p {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* ══════════════════════════════════════════════════════
   UTILITIES & RESPONSIVE
   ══════════════════════════════════════════════════════ */

/* Glass card utility */
.glass-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Loading spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive for smaller screens */
@media (max-width: 900px) {
  .chat-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 35% 65%;
  }

  .chat-orb {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .idle-text h1 {
    font-size: 2rem;
  }

  .orb-bg {
    width: 220px;
    height: 220px;
  }
}

/* ── Idle subtitle ─────────────────────────────────── */
.idle-subtitle {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-light);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.idle-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* ══════════════════════════════════════════════════════
   DASHBOARD SCREEN (Smart Library)
   ══════════════════════════════════════════════════════ */

.dashboard-layout {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

/* Top bar */
.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  flex-shrink: 0;
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-logo {
  font-size: 1.8rem;
}

.dash-brand h2 {
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dash-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.dash-user-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dash-user-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.dash-user-nim {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--bg-glass-light);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

/* Dashboard full content (no sidebar) */
.dash-full-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.dash-full-content::-webkit-scrollbar {
  width: 4px;
}

.dash-full-content::-webkit-scrollbar-thumb {
  background: var(--border-active);
  border-radius: var(--radius-full);
}

/* ══════════════════════════════════════════════════════
   FLOATING CHATBOX
   ══════════════════════════════════════════════════════ */

.floating-chat {
  position: fixed;
  bottom: 24px;
  right: 28px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* ── FAB (Floating Action Button) ──────────────────── */
.chat-fab {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.25), rgba(29, 209, 161, 0.15));
  backdrop-filter: blur(16px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  box-shadow:
    0 4px 24px var(--accent-glow),
    0 0 40px rgba(108, 92, 231, 0.15);
  overflow: visible;
  animation: fab-float 3s ease-in-out infinite;
}

@keyframes fab-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.chat-fab:hover {
  animation-play-state: paused;
  transform: scale(1.1);
  box-shadow:
    0 8px 40px var(--accent-glow),
    0 0 60px rgba(108, 92, 231, 0.3);
}

/* ── CSS Orb (FAB version) ─────────────────────────── */
.css-orb-fab {
  position: relative;
  width: 36px;
  height: 36px;
}

.css-orb-fab .orb-core {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #a29bfe, #6c5ce7 50%, #5a4bd1);
  box-shadow:
    0 0 12px rgba(108, 92, 231, 0.8),
    0 0 24px rgba(108, 92, 231, 0.4),
    inset 0 -2px 6px rgba(0,0,0,0.3),
    inset 0 2px 4px rgba(255,255,255,0.2);
  animation: orb-shimmer 2s ease-in-out infinite;
}

.css-orb-fab .orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(162, 155, 254, 0.35);
  animation: orb-spin 4s linear infinite;
}

.css-orb-fab .orb-ring-2 {
  inset: -3px;
  border-color: rgba(29, 209, 161, 0.2);
  animation-direction: reverse;
  animation-duration: 6s;
}

.css-orb-fab .orb-glow {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108, 92, 231, 0.3) 0%, transparent 70%);
  animation: orb-pulse-glow 2.5s ease-in-out infinite;
}

/* ── CSS Orb (Chatbox header mini) ─────────────────── */
.css-orb-mini {
  position: relative;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  animation: mini-orb-float 4s ease-in-out infinite;
}

@keyframes mini-orb-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.css-orb-mini .orb-core {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #a29bfe, #6c5ce7 50%, #5a4bd1);
  box-shadow:
    0 0 8px rgba(108, 92, 231, 0.8),
    0 0 16px rgba(108, 92, 231, 0.4),
    inset 0 -2px 4px rgba(0,0,0,0.3),
    inset 0 1px 3px rgba(255,255,255,0.2);
  animation: orb-shimmer 2s ease-in-out infinite;
}

.css-orb-mini .orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(162, 155, 254, 0.3);
  animation: orb-spin 3s linear infinite;
}

.css-orb-mini .orb-glow {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108, 92, 231, 0.25) 0%, transparent 70%);
  animation: orb-pulse-glow 2s ease-in-out infinite;
}

/* ── Orb keyframes ─────────────────────────────────── */
@keyframes orb-shimmer {
  0%, 100% {
    box-shadow:
      0 0 12px rgba(108, 92, 231, 0.8),
      0 0 24px rgba(108, 92, 231, 0.4),
      inset 0 -2px 6px rgba(0,0,0,0.3),
      inset 0 2px 4px rgba(255,255,255,0.2);
  }
  50% {
    box-shadow:
      0 0 18px rgba(29, 209, 161, 0.7),
      0 0 36px rgba(108, 92, 231, 0.5),
      inset 0 -2px 6px rgba(0,0,0,0.3),
      inset 0 2px 4px rgba(255,255,255,0.3);
  }
}

@keyframes orb-spin {
  to { transform: rotate(360deg); }
}

@keyframes orb-pulse-glow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

.fab-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent-light);
  opacity: 0;
  animation: fab-pulse-anim 2.5s ease-out infinite;
}

@keyframes fab-pulse-anim {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.fab-label {
  position: absolute;
  right: calc(100% + 12px);
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(12px);
  pointer-events: none;
  opacity: 0;
  transform: translateX(8px);
  transition: all var(--transition);
}

.chat-fab:hover .fab-label {
  opacity: 1;
  transform: translateX(0);
}

/* ── Chatbox Window ────────────────────────────────── */
.chatbox {
  width: 420px;
  height: 520px;
  border-radius: 20px;
  border: 1px solid var(--border-active);
  background: rgba(12, 12, 35, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.4),
    0 0 60px rgba(108, 92, 231, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  animation: chatbox-open 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chatbox-open {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Top glow line */
.chatbox::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-light), var(--teal), var(--accent-light), transparent);
}

/* Header */
.chatbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(20, 20, 50, 0.6);
  flex-shrink: 0;
}

.chatbox-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.orb-chatbox {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.chatbox-header h4 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chatbox-status {
  font-size: 0.7rem;
  color: var(--teal);
  font-weight: 500;
}

.chatbox-minimize {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-glass-light);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-family: inherit;
}

.chatbox-minimize:hover {
  color: var(--accent-light);
  border-color: var(--accent);
}

/* Body */
.chatbox-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.chatbox-body::-webkit-scrollbar {
  width: 3px;
}

.chatbox-body::-webkit-scrollbar-thumb {
  background: var(--border-active);
  border-radius: var(--radius-full);
}

/* Footer */
.chatbox-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: rgba(20, 20, 50, 0.5);
  flex-shrink: 0;
}

.chatbox-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Collapsed/Expanded states ─────────────────────── */
.floating-chat.collapsed .chatbox {
  display: none;
}

.floating-chat.collapsed .chat-fab {
  display: flex;
}

.floating-chat.expanded .chatbox {
  display: flex;
}

.floating-chat.expanded .chat-fab {
  display: none;
}

/* Stats cards */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-active);
  box-shadow: 0 4px 20px rgba(108, 92, 231, 0.1);
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--bg-glass-light);
}

.stat-number {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Section title */
.section-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* Book grid */
.book-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.book-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
}

.book-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.1);
}

.book-cover {
  width: 48px;
  height: 60px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.bc-1 { background: linear-gradient(135deg, #0984e3, #6c5ce7); }
.bc-2 { background: linear-gradient(135deg, #00b894, #1dd1a1); }
.bc-3 { background: linear-gradient(135deg, #d63031, #e17055); }
.bc-4 { background: linear-gradient(135deg, #e17055, #fdcb6e); }
.bc-5 { background: linear-gradient(135deg, #6c5ce7, #a29bfe); }
.bc-6 { background: linear-gradient(135deg, #fdcb6e, #e17055); }

.book-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
  line-height: 1.3;
}

.book-info p {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.book-status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.book-status.available {
  color: var(--teal);
  background: rgba(29, 209, 161, 0.1);
  border: 1px solid rgba(29, 209, 161, 0.2);
}

.book-status.borrowed {
  color: #fdcb6e;
  background: rgba(253, 203, 110, 0.1);
  border: 1px solid rgba(253, 203, 110, 0.2);
}

/* Quick actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
}

.action-card span:first-child {
  font-size: 1.8rem;
}

.action-card:hover {
  border-color: var(--accent);
  background: rgba(108, 92, 231, 0.1);
  box-shadow: 0 4px 20px var(--accent-glow);
  transform: translateY(-3px);
}
