/* --- XP / BOND SYSTEM STYLES --- */
.user-info-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-left: 10px;
  flex-grow: 1;
}

/* Sidebar header spacing adjust */
.sidebar-header {
  align-items: flex-start;
  padding-top: 14px;
}

/* --- UPDATED: New Sidebar Minimal Level --- */
.sidebar-level-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
  background: var(--hover-bg);
  padding: 2px 8px;
  border-radius: 12px;
  align-self: flex-start;
}

/* --- UPDATED: New Profile Panel Bond Section --- */
.bond-level-wrapper {
  margin-top: 24px;
  width: 100%;
  background: var(--hover-bg);
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
}

.bond-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.bond-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.bond-level-num {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-1);
  background: rgba(0, 191, 166, 0.1);
  padding: 2px 8px;
  border-radius: 8px;
}

.bond-xp-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: right;
  margin: 6px 0 0 0;
  font-weight: 500;
}

.xp-progress-bg {
  width: 100%;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.xp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-1), var(--primary-2));
  border-radius: 4px;
  transition: width 0.5s ease-out;
}

/* ... (Rest of the CSS remains unchanged) ... */

/* =================================
   Friendix.ai — THEME REFACTOR
   Full style.css replacement
   ================================= */

/* --- 1. THEME VARIABLES --- */
:root {
  /* Accent Colors */
  --primary-1: #00BFA6;
  --primary-2: #69F0AE;
  --neon-glow: rgba(0, 191, 166, 0.28);
  --user-bubble-grad: linear-gradient(135deg, #00BFA6 0%, #69F0AE 100%);
  --user-bubble-shadow: 0 4px 12px rgba(0, 191, 166, 0.2);
  --user-bubble-glow: radial-gradient(circle at 30% 30%, var(--neon-glow), transparent 30%);

  /* Light Theme Palette */
  --app-bg: #F8F9FA;
  --sidebar-bg: #FFFFFF;
  --header-bg: #FFFFFF;
  --dropdown-bg: #FFFFFF;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-icon: #5f6368;
  --text-placeholder: #999;
  --border-color: #E0E0E0;
  --border-color-input: #DADCE0;
  --hover-bg: #F1F3F5;
  --active-bg: #E9ECEF;
  --ai-bubble-bg: #E9ECEF;
  --ai-bubble-text: #212529;
  --ai-bubble-time: #555;
  --input-bg: #FFFFFF;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --placeholder-logo-opacity: 0.3;
  --scrollbar-thumb-bg: linear-gradient(180deg, #D3D3D3, #C0C0C0);
  --scrollbar-thumb-hover: #B0B0B0;
  --overlay-bg: rgba(0, 0, 0, 0.15);
  --danger-text: #dc3545;
  --danger-bg: rgba(0, 0, 0, 0.04);
  --danger-hover: rgba(220, 53, 69, 0.1);
  --logo-image: url('/logo2.png');
  --chat-background-image: url('backgrounds/light1.jpg');
  /* Light theme BG */

  /* Other vars */
  --sidebar-width: 300px;
  --profile-panel-width: 300px;
  --rail-width: 55px;
  /* NEW STATIC RAIL WIDTH */
  --header-height: 64px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --transition-fast: 180ms;
  --transition-med: 280ms;
}

html[data-theme="dark"] {
  /* Dark Theme Palette */
  --app-bg: linear-gradient(180deg, #0b0716 0%, #0f1630 100%);
  --sidebar-bg: linear-gradient(180deg, rgba(12, 12, 28, 0.85), rgba(16, 14, 34, 0.68));
  --header-bg: linear-gradient(135deg, rgba(24, 20, 55, 0.55), rgba(12, 14, 30, 0.35));
  --dropdown-bg: #1A1C2C;
  /* Solid dark for dropdown */
  --text-primary: rgba(255, 255, 255, 0.85);
  --text-secondary: rgba(255, 255, 255, 0.45);
  --text-icon: rgba(255, 255, 255, 0.85);
  --text-placeholder: rgba(255, 255, 255, 0.5);
  --border-color: rgba(255, 255, 255, 0.04);
  --border-color-input: rgba(130, 110, 255, 0.12);
  --hover-bg: rgba(255, 255, 255, 0.05);
  --active-bg: rgba(255, 255, 255, 0.08);
  --ai-bubble-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(242, 242, 247, 0.9));
  --ai-bubble-text: #0c0c12;
  --ai-bubble-time: #555;
  --input-bg: linear-gradient(180deg, rgba(8, 10, 30, 0.6), rgba(8, 10, 30, 0.45));
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
  --placeholder-logo-opacity: 0.5;
  --scrollbar-thumb-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  --scrollbar-thumb-hover: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
  --overlay-bg: rgba(0, 0, 0, 0.25);
  --danger-text: #ff7b7b;
  --danger-bg: rgba(255, 255, 255, 0.06);
  --danger-hover: rgba(255, 123, 123, 0.18);
  --logo-image: url('/logo.png');
  --chat-background-image: url('backgrounds/black.jpg');
  /* Dark theme BG */
}

/* System Preference */
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    /* Dark Theme Palette */
    --app-bg: linear-gradient(180deg, #0b0716 0%, #0f1630 100%);
    --sidebar-bg: linear-gradient(180deg, rgba(12, 12, 28, 0.85), rgba(16, 14, 34, 0.68));
    --header-bg: linear-gradient(135deg, rgba(24, 20, 55, 0.55), rgba(12, 14, 30, 0.35));
    --dropdown-bg: #1A1C2C;
    --text-primary: rgba(255, 255, 255, 0.85);
    --text-secondary: rgba(255, 255, 255, 0.45);
    --text-icon: rgba(255, 255, 255, 0.85);
    --text-placeholder: rgba(255, 255, 255, 0.5);
    --border-color: rgba(255, 255, 255, 0.04);
    --border-color-input: rgba(130, 110, 255, 0.12);
    --hover-bg: rgba(255, 255, 255, 0.05);
    --active-bg: rgba(255, 255, 255, 0.08);
    --ai-bubble-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(242, 242, 247, 0.9));
    --ai-bubble-text: #0c0c12;
    --ai-bubble-time: #555;
    --input-bg: linear-gradient(180deg, rgba(8, 10, 30, 0.6), rgba(8, 10, 30, 0.45));
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
    --placeholder-logo-opacity: 0.5;
    --scrollbar-thumb-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    --scrollbar-thumb-hover: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
    --overlay-bg: rgba(0, 0, 0, 0.25);
    --danger-text: #ff7b7b;
    --danger-bg: rgba(255, 255, 255, 0.06);
    --danger-hover: rgba(255, 123, 123, 0.18);
    --logo-image: url('/logo.png');
    --chat-background-image: url('backgrounds/black.jpg');
    /* Dark theme BG */
  }
}

/* --- 2. BASE STYLES --- */
* {
  box-sizing: border-box
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: 'Inter', Helvetica, Arial, sans-serif;
  background: var(--app-bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden
}

/* =================================
   NEW: STATIC LEFT RAIL STYLES
   ================================= */
.static-rail {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--rail-width);
  height: 100%;
  background: var(--header-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1100;
  padding: 16px 0;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
}

.rail-logo-area {
  margin-bottom: 32px;
  display: flex;
  justify-content: center;
}

.rail-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.rail-menu {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  align-items: center;
  flex: 1;
}

.rail-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  align-items: center;
  margin-bottom: 16px;
}

.rail-item {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1.4rem;
  position: relative;
}

.rail-item:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.rail-item.active {
  background: rgba(0, 191, 166, 0.12);
  color: var(--primary-1);
}

.rail-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  height: 20px;
  width: 4px;
  background: var(--primary-1);
  border-radius: 0 4px 4px 0;
}

.rail-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
}

.rail-item:hover .rail-avatar {
  border-color: var(--primary-1);
}

/* =================================
   UPDATED: APP CONTAINER POSITION
   ================================= */

/* App container - Now starts after the rail */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: calc(100vw - var(--rail-width));
  /* Adjust width */
  margin-left: var(--rail-width);
  /* Adjust margin */
  position: relative;
  transition: margin-left var(--transition-med) ease, margin-right var(--transition-med) ease, width var(--transition-med) ease, filter 350ms ease;
  background: var(--app-bg);
}

/* Header */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  gap: 12px;
  height: var(--header-height);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  z-index: 90;
  position: sticky;
  top: 0;
}

/* header items */
.left-header {
  display: flex;
  align-items: center;
  gap: 12px
}

.menu-icon {
  font-size: 26px;
  color: var(--text-icon);
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  transition: all var(--transition-fast) ease;
  display: none;
  /* Hidden by default (Desktop) */
}

.menu-icon:hover {
  background: var(--hover-bg);
  transform: translateY(-2px)
}

.profile-pic {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  cursor: pointer
}

.chat-title span {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text-primary);
}

.chat-title small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.right-header {
  display: flex;
  align-items: center
}

/* Chatbox area (center panel) */
.chatbox {
  flex: 1;
  overflow-y: auto;
  padding: 22px 26px 120px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  background-image: var(--chat-background-image);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  transition: background-image 900ms ease, filter 400ms ease;
  position: relative;
}

/* message wrapper */
.message {
  max-width: 72%;
  display: flex;
  flex-direction: column;
  animation: msgFade .26s ease both;
}

.luvisa-message {
  align-self: flex-start;
  align-items: flex-start;
}

.user-message {
  align-self: flex-end;
  align-items: flex-end;
}

/* message bubble */
.message-bubble {
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  line-height: 1.5;
  word-break: break-word;
  position: relative;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform var(--transition-med) ease, box-shadow var(--transition-med) ease, opacity var(--transition-fast) ease;
}

/* ai bubble */
.luvisa-message .message-bubble {
  background: var(--ai-bubble-bg);
  color: var(--ai-bubble-text);
  border: 1px solid var(--border-color);
  border-radius: 18px 18px 18px 8px;
  box-shadow: var(--shadow-md);
}

/* user bubble */
.user-message .message-bubble {
  background: var(--user-bubble-grad);
  color: #fff;
  border-radius: 18px 18px 8px 18px;
  border: 1px solid rgba(0, 191, 166, 0.1);
  box-shadow: var(--user-bubble-shadow);
  transform-origin: right center;
}

/* hover lift */
.message-bubble:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.1)
}

html[data-theme="dark"] .message-bubble:hover {
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3);
}

/* message text & time */
.message-text {
  font-size: 1rem;
  color: inherit
}

.message-time {
  display: block;
  font-size: 0.72rem;
  opacity: 0.85;
  color: var(--text-secondary);
  margin-top: 6px;
  padding: 0 12px;
}

.message-bubble .message-time {
  display: none;
}

.luvisa-message>.message-time {
  text-align: left;
}

.user-message>.message-time {
  text-align: right;
}

/* typing indicator */
.typing-message .message-bubble {
  background: var(--ai-bubble-bg);
  color: var(--ai-bubble-text)
}

.typing-dots {
  display: flex;
  gap: 8px;
  align-items: center
}

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-primary);
  opacity: .6;
  animation: dot 1.2s infinite
}

.typing-dots span:nth-child(2) {
  animation-delay: .09s
}

.typing-dots span:nth-child(3) {
  animation-delay: .18s
}

@keyframes dot {
  0% {
    opacity: .25;
    transform: scale(.85)
  }

  40% {
    opacity: 1;
    transform: scale(1.1)
  }

  100% {
    opacity: .25;
    transform: scale(.85)
  }
}

/* animations */
@keyframes msgFade {
  from {
    opacity: 0;
    transform: translateY(8px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

/* Input area - floating */
.input-area {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  width: min(94%, 1100px);
  z-index: 120;
  pointer-events: auto;
  transition: width var(--transition-med) ease, left var(--transition-med) ease, transform var(--transition-med) ease;
  flex-direction: column;
  /* Allow preview stacking */
}

/* --- UPDATED FILE PREVIEW --- */
.file-preview {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  max-width: 820px;
  width: 100%;
  overflow-x: auto;
  margin-bottom: 6px;
  /* Space above the input bar */
  /* Removed background/border to look cleaner like Gemini */
  background: transparent;
  border: none;
  backdrop-filter: none;
  scrollbar-width: none;
  /* Hide scrollbar */
}

.file-preview:empty {
  display: none;
}

/* The Chip (Card) */
.file-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: #1e1e1e;
  /* Dark card background */
  border: 1px solid #333;
  border-radius: 8px;
  /* Slightly rectangular with rounded corners */
  color: #e0e0e0;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: default;
  transition: background 0.2s, border-color 0.2s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.file-chip:hover {
  background: #2a2a2a;
  border-color: #555;
}

/* Icons inside the chip */
.file-chip i {
  font-size: 1.1rem;
  color: var(--primary-1);
  /* Use your theme color */
}

/* Close 'X' button */
.file-chip-remove {
  cursor: pointer;
  color: #888;
  margin-left: 4px;
  padding: 2px;
  border-radius: 50%;
  transition: all 0.2s;
}

.file-chip-remove:hover {
  color: #ff6b6b;
  /* Red on hover */
  background: rgba(255, 255, 255, 0.1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}


.input-bar-container {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 820px;
  padding: 4px 6px 4px 14px;
  background: var(--input-bg);
  border-radius: 60px;
  border: 1px solid var(--border-color-input);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
}

.input-bar-container:focus-within {
  box-shadow: 0 2px 8px var(--neon-glow);
  transform: translateY(-1px);
  border-color: var(--primary-1);
}

/* input */
.input-area input[type="text"] {
  flex: 1;
  padding: 8px;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  outline: none;
}

.input-area input[type="text"]::placeholder {
  color: var(--text-placeholder);
}

/* send button */
#sendBtn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-1), var(--primary-2));
  box-shadow: 0 6px 18px var(--neon-glow);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  flex-shrink: 0;
}

#sendBtn:hover {
  transform: scale(1.06);
  box-shadow: 0 10px 25px rgba(0, 191, 166, 0.36)
}

#sendBtn:active {
  transform: scale(.98)
}

/* Sidebar overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: var(--rail-width);
  /* Adjusted for rail */
  width: calc(100% - var(--rail-width));
  height: 100%;
  background: var(--overlay-bg);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.sidebar-open .sidebar-overlay {
  opacity: 1;
}

/* Sidebar and profile panel */
.sidebar-menu,
.profile-panel {
  position: fixed;
  top: 0;
  height: 100%;
  z-index: 1000;
  transition: transform var(--transition-med) cubic-bezier(.2, .9, .2, 1), box-shadow var(--transition-fast);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* =================================
   UPDATED: LEFT SIDEBAR POSITION
   ================================= */
.sidebar-menu {
  left: var(--rail-width);
  /* Moves sidebar to right of rail */
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
  transform: translateX(-110%);
  /* Keep original hide logic */
  color: var(--text-primary);
  backdrop-filter: blur(14px);
}

.sidebar-menu.show {
  transform: translateX(0)
}

/* right profile panel */
.profile-panel {
  right: 0;
  width: var(--profile-panel-width);
  background: var(--sidebar-bg);
  color: var(--text-primary);
  transform: translateX(110%);
  box-shadow: -2px 10px 36px rgba(0, 0, 0, 0.1);
}

.profile-panel.show {
  transform: translateX(0)
}

/* sidebar header */
.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
}

.sidebar-user-name {
  font-weight: 700;
  margin-left: 12px;
  color: var(--text-primary);
}

.close-sidebar-icon {
  font-size: 26px;
  color: var(--text-icon);
  padding: 8px;
  border-radius: 10px;
  cursor: pointer
}

.close-sidebar-icon:hover {
  background: var(--hover-bg);
}

.sidebar-header-icons {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar-header-icon {
  font-size: 22px;
  color: var(--text-icon);
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--transition-fast) ease;
}

#mobileSettingsBtn {
  display: none;
}


.sidebar-header-icon:hover {
  background: var(--hover-bg);
}

/* === UPDATED BADGE STYLE === */
.early-user-badge {
  display: none;
  /* Hidden by default */
  width: 26px;
  height: 26px;
  margin-left: 6px;
  vertical-align: middle;
  /* Removed font styles, added size */
}

/* === END UPDATE === */

/* chat list */
.sidebar-content {
  flex: 1;
  padding: 0 8px 0;
  overflow-y: auto
}

.sidebar-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 12px
}

.chat-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background var(--transition-fast)
}

.chat-list-item:hover {
  background: var(--hover-bg);
}

.chat-list-item.active {
  background: var(--active-bg);
}

.chat-list-item.active .chat-list-name {
  color: var(--primary-1);
}

.chat-list-preview small {
  color: var(--text-secondary);
}

.chat-list-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover
}

.placeholder-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hover-bg);
  color: var(--text-secondary);
}

/* footer
.sidebar-footer{
  padding: 0 18px 18px;
  border-top:1px solid var(--border-color);
} */
.feedback-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--hover-bg);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.feedback-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1)
}

/* profile card in right panel */
.profile-panel .luvisa-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden
}

.profile-panel .card-top {
  height: 34%;
  background: linear-gradient(135deg, var(--primary-1), var(--primary-2));
  position: relative
}

.profile-panel .card-avatar-wrapper {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 5px solid var(--sidebar-bg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(16, 16, 40, 0.28);
  cursor: pointer;
}

.profile-panel .card-avatar-preview {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.profile-panel .card-bottom {
  padding: 92px 26px 26px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center
}

.profile-panel .luvisa-card-name {
  font-size: 1.6rem;
  margin: 0;
  color: var(--text-primary)
}

.profile-panel .luvisa-card-title {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-top: 6px
}

/* settings & submenu styles */
.sidebar-separator {
  height: 1px;
  background: var(--border-color);
  margin: 14px 10px
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-primary);
  transition: background var(--transition-fast)
}

/* submenu */
.submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-med) ease;
  padding-left: 18px
}

.submenu.show {
  max-height: 260px
}

/* dropdown */
.dropdown-menu {
  position: absolute;
  top: 66px;
  left: 10px;
  width: 280px;
  background: var(--dropdown-bg);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(.98);
  transition: all var(--transition-fast)
}

.dropdown-menu.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1)
}

.dropdown-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  object-fit: cover
}

/* custom scrollbars */
#chatbox::-webkit-scrollbar,
.sidebar-content::-webkit-scrollbar,
.profile-panel .about-section::-webkit-scrollbar {
  width: 10px
}

#chatbox::-webkit-scrollbar-track,
.sidebar-content::-webkit-scrollbar-track {
  background: transparent
}

#chatbox::-webkit-scrollbar-thumb,
.sidebar-content::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb-bg);
  border-radius: 10px
}

#chatbox::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

#chatbox,
.sidebar-content {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb-bg) transparent;
}

/* =================================
   UPDATED: DESKTOP PUSH LOGIC
   ================================= */

/* When sidebar is open, push content by sidebar width + rail width */
body.sidebar-open .app-container {
  margin-left: calc(var(--sidebar-width) + var(--rail-width));
  filter: none;
  width: calc(100vw - var(--sidebar-width) - var(--rail-width));
}

body.profile-panel-open .app-container {
  margin-right: var(--profile-panel-width);
  filter: none;
  width: calc(100vw - var(--rail-width) - var(--profile-panel-width))
}

body.sidebar-open.profile-panel-open .app-container {
  margin-left: calc(var(--sidebar-width) + var(--rail-width));
  margin-right: var(--profile-panel-width);
  width: calc(100vw - var(--sidebar-width) - var(--rail-width) - var(--profile-panel-width));
}

/* responsive: mobile/tablet */
@media (max-width:900px) {

  /* HIDE RAIL ON MOBILE */
  .static-rail {
    display: none;
  }

  /* Show Menu Icon on Mobile */
  .menu-icon {
    display: block;
  }

  /* RESET APP CONTAINER */
  .app-container {
    width: 100vw;
    margin-left: 0;
  }

  /* RESET SIDEBAR TO EDGE */
  .sidebar-menu {
    left: 0;
    width: 260px;
  }

  .sidebar-overlay {
    left: 0;
    width: 100vw;
  }

  .input-area {
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 28px);
    bottom: 16px
  }

  .input-bar-container {
    max-width: 100%;
  }

  .chatbox {
    padding: 18px 16px 120px
  }

  .profile-panel {
    width: 260px
  }

  body.sidebar-open .app-container,
  body.profile-panel-open .app-container,
  body.sidebar-open.profile-panel-open .app-container {
    margin-left: 0;
    margin-right: 0;
    width: 100vw;
    filter: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.sidebar-open .chatbox {
    filter: none !important;
    -webkit-filter: none !important;
  }

  .sidebar-overlay {
    width: 100vw;
  }
}

/* responsive: tiny screens */
@media (max-width:520px) {
  .menu-icon {
    font-size: 22px;
    padding: 6px
  }

  #mobileSettingsBtn {
    display: block;
  }

  /* Show on mobile */

  .profile-pic {
    width: 40px;
    height: 40px
  }

  .chat-title span {
    font-size: 0.96rem
  }

  .message {
    max-width: 85%;
  }

  .input-area input[type="text"] {
    padding: 8px 10px;
    font-size: 0.9rem
  }

  #sendBtn {
    width: 40px;
    height: 40px
  }

  #emojiBtn,
  #attachBtn {
    padding: 0 8px;
    font-size: 1.4rem;
  }

  .input-bar-container {
    padding: 4px 6px 4px 8px;
  }
}

/* accessibility */
:focus {
  outline: 2px solid var(--primary-1);
  outline-offset: 2px
}

button,
input,
textarea {
  font-family: inherit
}

/* user bubble glow */
.user-message .message-bubble::after {
  content: "";
  position: absolute;
  inset: auto -8px -8px auto;
  width: 70%;
  height: 70%;
  opacity: 0;
  pointer-events: none;
  filter: blur(18px);
  background: var(--user-bubble-glow);
  transition: opacity 200ms ease;
}

.user-message .message-bubble:hover::after {
  opacity: 1
}

/* modal fallback (hidden) */
.settings-modal,
.settings-modal.show,
.settings-modal-content {
  display: none !important;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-title {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 18px;
}

.modal-item {
  width: 100%;
  padding: 12px;
  margin: 6px 0;
  background: var(--hover-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: 0.25s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.modal-item:hover {
  background: var(--active-bg);
}

.modal-item.red {
  color: var(--danger-text);
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* desktop push logic */
@media (min-width: 901px) {

  /* RECALCULATE CENTER FOR FLOATING INPUT */
  body.sidebar-open .input-area {
    left: calc((100vw + var(--sidebar-width) + var(--rail-width)) / 2);
    width: calc(100% - var(--sidebar-width) - var(--rail-width));
  }

  body.profile-panel-open .input-area {
    left: calc((100vw - var(--profile-panel-width) + var(--rail-width)) / 2);
    width: calc(100% - var(--profile-panel-width) - var(--rail-width));
  }

  body.sidebar-open.profile-panel-open .input-area {
    left: calc((100vw + var(--sidebar-width) + var(--rail-width) - var(--profile-panel-width)) / 2);
    width: calc(100% - var(--sidebar-width) - var(--rail-width) - var(--profile-panel-width));
  }

  /* Adjust Placeholder center */
  body.sidebar-open #chatPlaceholder {
    width: calc(100% - var(--sidebar-width));
    margin-left: 0;
  }
}

body.sidebar-open .chatbox {
  filter: none;
}

/* sidebar profile click */
.sidebar-header-avatar-wrapper {
  cursor: pointer;
  transition: transform 200ms ease, opacity 200ms ease;
  border-radius: 50%;
}

.sidebar-header-avatar-wrapper:hover {
  transform: scale(1.08);
  opacity: 0.9;
  box-shadow: 0 0 15px var(--neon-glow);
}

/* header forget button */
.header-forget-btn {
  background: var(--danger-bg);
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--danger-text);
  transition: 0.25s ease;
}

.header-forget-btn:hover {
  transform: scale(1.12);
  background: var(--danger-hover);
  color: var(--danger-text);
}

.right-header .modal-item {
  display: none;
}

/* footer */
.sidebar-item.logout-item {
  display: none;
}

/* HIDE old logout */
.sidebar-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.sidebar-footer .copyright-text {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* icons */
#sendBtn i {
  font-size: 1.4rem;
  transform: translateX(1px);
}

#emojiBtn,
#attachBtn {
  width: auto;
  height: auto;
  border-radius: 0;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--text-icon);
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast);
  flex-shrink: 0;
  padding: 6px;
}

#emojiBtn:hover,
#attachBtn:hover {
  background: transparent;
  transform: scale(1.06);
  color: var(--text-primary);
}

/* emoji picker */
emoji-picker {
  position: absolute;
  bottom: 70px;
  left: 0;
  z-index: 1000;
  display: none;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

emoji-picker.show {
  display: block;
}

/* Emoji picker dark theme is handled by JS */

/* placeholder */
.chat-header,
#chatbox,
.input-area {
  display: none;
}

#chatContainer.show .chat-header,
#chatContainer.show #chatbox,
#chatContainer.show .input-area {
  display: flex;
}

#chatPlaceholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--text-placeholder);
  padding: 20px;
  text-align: center;
  transition: all var(--transition-med) ease;
}

/* === UPDATED LOGO STYLES === */
.placeholder-logo {
  width: 90px;
  height: 90px;
  opacity: var(--placeholder-logo-opacity);
  margin-bottom: 20px;
  background-image: var(--logo-image);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* === END UPDATE === */

.placeholder-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.placeholder-text {
  font-size: 1.1rem;
  margin: 10px 0 0 0;
}

.placeholder-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  position: absolute;
  bottom: 30px;
}

#chatContainer.show #chatPlaceholder {
  display: none;
}

#closeSidebarIcon {
  display: none;
}

/* footer links */
.footer-links-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0 10px;
}

.footer-links-row .sidebar-item {
  padding: 6px 10px;
  font-size: 0.8rem;
  gap: 6px;
}

.footer-links-row .sidebar-item i {
  font-size: 1rem;
}

/* typography refinement */
.chat-list-name,
.header-user-name,
.placeholder-title {
  font-weight: 600;
}

.chat-list-item {
  padding: 10px 12px;
  gap: 14px;
}

.sidebar-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  padding-left: 14px;
}

.chat-list-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-list-item.disabled:hover {
  background: none;
}


/* =================================
   UPDATED SETTINGS DROPDOWN (FLOATING)
   ================================= */
.settings-dropdown {
  position: fixed;
  /* FIXED relative to screen */
  left: 65px;
  /* Just to the right of the Rail (55px + gap) */
  bottom: 20px;
  /* Aligned with bottom elements */
  top: auto;
  /* Reset Top */
  right: auto;
  /* Reset Right */
  width: 260px;
  background: var(--dropdown-bg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  padding: 8px;
  z-index: 1200;
  /* Above sidebar (1000) and rail (1100) */
  opacity: 0;
  transform: scale(0.95) translateX(-10px);
  transform-origin: bottom left;
  pointer-events: none;
  transition: all var(--transition-fast) ease;
}

.settings-dropdown.show {
  opacity: 1;
  transform: scale(1) translateX(0);
  pointer-events: auto;
}

.settings-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition-fast);
  font-size: 0.9rem;
  color: var(--text-primary);
}

.settings-menu-item:hover {
  background: var(--hover-bg);
}

.settings-menu-item i {
  font-size: 1.2rem;
  color: var(--text-icon);
  width: 20px;
  text-align: center;
}

.settings-menu-item .menu-arrow {
  margin-left: auto;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.settings-menu-separator {
  height: 1px;
  background: var(--border-color);
  margin: 6px 0;
}

/* Submenus follow the same fixed logic but swap content via JS toggling classes */
.theme-dropdown,
.personalization-dropdown,
.notification-dropdown {
  transform: scale(1.05) translateX(-10px);
}

/* --- UPDATED: Makes room for the notification dot --- */
.settings-menu-item .menu-arrow {
  margin-left: auto;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.settings-menu-separator {
  height: 1px;
  background: var(--border-color);
  margin: 6px 0;
}

/* --- Theme Submenu Styles --- */
.theme-dropdown {
  transform: scale(1.05) translateY(-10px);
  /* Start from a different spot */
}

.theme-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.theme-menu-header i {
  font-size: 1.2rem;
  color: var(--text-icon);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background var(--transition-fast);
}

.theme-menu-header i:hover {
  background: var(--hover-bg);
}

.theme-menu-item .bx-check {
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--primary-1);
  display: none;
  /* Hide by default */
}

.theme-menu-item.active .bx-check {
  display: block;
  /* Show on active */
}

/* =================================
   NEW: PERSONALIZATION STYLES
   ================================= */

.personalization-dropdown {
  transform: scale(1.05) translateY(-10px);
}

/* Style the reset button like a theme button */
#personalizationResetBtn .bx-check {
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--primary-1);
  display: none;
}

#personalizationResetBtn.active .bx-check {
  display: block;
}

.bg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px 12px;
  max-height: 240px;
  overflow-y: auto;
}

.bg-thumbnail {
  position: relative;
  width: 100%;
  padding-top: 70%;
  /* Aspect ratio for thumbnail */
  background-size: cover;
  background-position: center;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
}

.bg-thumbnail:hover {
  transform: scale(1.05);
  border-color: rgba(120, 120, 120, 0.5);
}

.bg-thumbnail .bx-check {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: white;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
}

.bg-thumbnail.active {
  border-color: var(--primary-1);
  box-shadow: 0 0 10px var(--neon-glow);
}

.bg-thumbnail.active .bx-check {
  display: block;
}


/* =================================
   FIX: Anchor Sidebar Footer
   ================================= */

#defaultSidebarView {
  display: flex;
  flex-direction: column;
  height: 100%;
  /* Make this view fill the sidebar */
}

/* =================================
   UPDATED: NOTIFICATION PANEL STYLES
   ================================= */

.notification-dropdown {
  transform: scale(1.05) translateY(-10px);
  /* Start from a different spot */
}

.notification-dot {
  display: none;
  /* Hidden by default */
  width: 9px;
  height: 9px;
  background-color: #e53935;
  /* Red */
  border-radius: 50%;
  border: 1px solid var(--dropdown-bg);
  margin-left: auto;
  /* Pushes it right before the arrow */
  margin-right: 8px;
}

#notificationListContainer {
  display: flex;
  flex-direction: column;
  max-height: 300px;
  overflow-y: auto;
  padding: 0;
  /* Remove padding from the list itself */
}

/* --- NEW STYLE BLOCK FOR NOTIFICATION ITEMS --- */

.notification-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  line-height: 1.4;
  transition: background-color var(--transition-fast);
}

.notification-item:hover {
  background-color: var(--hover-bg);
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  /* Rounded icon like the image */
  background-color: var(--active-bg);
}

.notification-item-icon i {
  font-size: 1.3rem;
  color: var(--primary-1);
}

.notification-item-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.notification-item-message {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.notification-item-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.notification-item-kebab {
  flex-shrink: 0;
  font-size: 1.2rem;
  color: var(--text-secondary);
  padding: 4px;
  border-radius: 50%;
  cursor: pointer;
}

.notification-item-kebab:hover {
  background-color: var(--active-bg);
  color: var(--text-primary);
}

/* --- END NEW STYLE BLOCK --- */


.notification-list-empty {
  display: flex;
  /* Changed from 'none' to 'flex' by default */
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

/* We now hide this with JS if there are items */


.notification-list-empty i {
  font-size: 3rem;
  color: var(--primary-1);
  margin-bottom: 12px;
}

.notification-list-empty span {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.notification-list-empty small {
  font-size: 0.85rem;
  margin-top: 4px;
}

/* ... (Existing styles) ... */

/* =================================
   NEW: SECRET JOURNAL STYLES
   ================================= */

.journal-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.journal-modal-overlay.show {
  display: flex;
  opacity: 1;
}

.journal-modal-content {
  width: 90%;
  max-width: 700px;
  /* Responsive width */
  height: auto;
  min-height: 90vh;
  max-height: 90vh;
  /* Fit within viewport */
  overflow-y: auto;
  /* Allow scrolling */
  background: #fffdf0;
  background-image: url('/backgrounds/Secret.jpg');
  background-size: cover;
  background-position: left center;
  /* Anchor flowers to left */
  background-repeat: no-repeat;
  border-radius: 4px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  padding: 60px 40px 60px 220px;
  /* Push text right to avoid flowers */
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid #e0e0e0;
  font-family: 'Caveat', cursive;
  /* Handwritten font */
}

@media (max-width: 600px) {
  .journal-modal-content {
    padding: 30px;
    background-position: center;
    /* Center bg on mobile */
    min-height: 80vh;
  }
}

.journal-modal-overlay.show .journal-modal-content {
  transform: scale(1);
}

.journal-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: #888;
  cursor: pointer;
}

.journal-header {
  text-align: center;
  margin-bottom: 30px;
  border-bottom: none;
  /* Removed dashed line for realism */
  padding-bottom: 20px;
}

.journal-text {
  font-size: 1.6rem;
  line-height: 1.8;
  color: #2c1a0b;
  white-space: pre-wrap;
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
  text-align: left;
  /* Ensure natural reading flow */
  padding: 0 10px;
}

.journal-text.blurred {
  filter: blur(6px);
  user-select: none;
  opacity: 0.6;
}

/* Lock Overlay */
.journal-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
  font-family: 'Inter', sans-serif;
  /* Reset font for UI elements */
}

.journal-lock-icon {
  font-size: 3rem;
  color: #d63384;
  margin-bottom: 10px;
  background: #fff;
  border-radius: 50%;
  padding: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.journal-lock-icon.unlocking {
  animation: unlockShake 0.5s ease-in-out forwards;
}

@keyframes unlockShake {
  0% {
    transform: scale(1) rotate(0deg);
  }

  25% {
    transform: scale(1.1) rotate(-15deg);
  }

  50% {
    transform: scale(1.1) rotate(15deg);
  }

  75% {
    transform: scale(1.1) rotate(-5deg);
  }

  100% {
    transform: scale(1.2) rotate(0deg);
    opacity: 0;
  }
}

.journal-lock-overlay p {
  margin: 5px 0;
  color: #555;
  font-weight: 500;
  text-align: center;
  text-shadow: 0 0 10px #fffdf0;
}

.unlock-journal-btn {
  margin-top: 15px;
  background: linear-gradient(135deg, #d63384, #ff6b6b);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(214, 51, 132, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.unlock-journal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(214, 51, 132, 0.4);
}

.journal-error {
  color: #dc3545;
  font-size: 0.9rem;
  margin-top: 10px;
  display: none;
}

/* Dark Mode Adjustments for Journal */
html[data-theme="dark"] .journal-modal-content {
  background-image: url('/backgrounds/Secret.jpg');
  border-color: #555;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

/* Force dark text on the parchment background even in dark mode */
html[data-theme="dark"] .journal-text {
  color: #2c1a0b;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  font-weight: 600;
}

html[data-theme="dark"] .journal-header h3 {
  color: #8b3a3a !important;
  /* Vintage Red */
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

html[data-theme="dark"] .journal-header p {
  color: #5d4037 !important;
  /* Dark Brown */
}

html[data-theme="dark"] .journal-lock-overlay p {
  color: #3e2723;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  font-weight: 700;
}

html[data-theme="dark"] .journal-lock-icon {
  background: #333;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* --- MARKDOWN & CODE STYLING FIX --- */
.message-text pre {
  position: relative;
  background: #1e1e1e;
  /* Dark background for code */
  color: #f8f8f2;
  /* Light text for code */
  padding: 14px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
  /* Robust font stack */
  margin: 10px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: pre-wrap;
  /* Wraps long lines so they don't break layout */
}

.message-text code {
  font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
  background: rgba(100, 100, 100, 0.2);
  padding: 2px 5px;
  border-radius: 4px;
  color: #e0e0e0;
}

.message-text pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  border-radius: 0;
}

.message-text p {
  margin: 0 0 8px 0;
}

.message-text p:last-child {
  margin-bottom: 0;
}

/* Copy Code Button Style */
.copy-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #d4d4d4;
  padding: 4px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.copy-btn i {
  font-size: 1rem;
}

/* --- Files inside Chat Bubble --- */
.message-file-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.chat-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.2);
  /* Slightly dark overlay */
  border-radius: 6px;
  font-size: 0.85rem;
  color: inherit;
  /* Inherit text color from bubble */
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Specific styling for User bubble files */
.user-message .chat-file-chip {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

/* Specific styling for AI bubble files (if AI sends files later) */
.luvisa-message .chat-file-chip {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.chat-file-chip i {
  font-size: 1.1rem;
}

/* --- UPDATED RAIL & CLEANUP --- */

/* Ensure the link in the rail doesn't have an underline */
a.rail-item {
  text-decoration: none;
  color: var(--text-secondary);
}

a.rail-item:hover {
  color: var(--text-primary);
}

/* (Optional) If you want to keep the copyright text, 
   you can add it to the bottom of sidebar-content instead 
   using a simple class like this: */
.sidebar-copyright-small {
  font-size: 0.7rem;
  color: var(--text-secondary);
  opacity: 0.6;
  text-align: center;
  padding: 20px 0;
  margin-top: auto;
}

/* REMOVE these classes if they still exist in your CSS to keep it clean:
   .sidebar-footer
   .footer-action
   .copyright-text 
*/

/* Video Overlay */
.video-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20000;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

.video-overlay video {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(109, 93, 252, 0.5);
}

.close-video-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.2s;
}

.close-video-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}
