/* LegaHistory — Light theme with Cambria typography */

/* ── Font faces ── */
@font-face {
  font-family: 'Cambria';
  src: url('../fonts/cambria.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Cambria';
  src: url('../fonts/cambriai.woff2') format('woff2');
  font-weight: normal;
  font-style: italic;
}

/* ── CSS Variables ── */
:root {
  --lh-bg: #fafafa;
  --lh-sidebar-bg: #f5f5f5;
  --lh-text-primary: #333333;
  --lh-text-secondary: #777777;
  --lh-text-muted: #999999;
  --lh-accent: #FF6B6B;
  --lh-accent-hover: #E55A5A;
  --lh-border: #E0E0E0;
  --lh-surface: #F5F5F5;
  --lh-surface-2: #EEEEEE;
  --lh-success: #66bb6a;
  --lh-time: #4fc3f7;
}

/* ── Reset & Full-height ── */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--lh-bg);
  color: var(--lh-text-primary);
  font-family: 'Cambria', Georgia, serif;
  overflow: hidden;
}

/* ── App Container ── */
.lh-app {
  display: flex;
  height: 100vh;
  width: 100%;
}

/* ── Sidebar ── */
.lh-sidebar {
  width: 280px;
  min-width: 280px;
  height: 100vh;
  background-color: var(--lh-sidebar-bg);
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease, min-width 0.3s ease;
  overflow: hidden;
}

.lh-sidebar.collapsed {
  width: 60px;
  min-width: 60px;
}

.lh-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px;
}

.lh-sidebar-brand {
  font-family: 'Cambria', Georgia, serif;
  font-size: 18px;
  font-weight: normal;
  color: var(--lh-text-primary);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s;
}

.lh-sidebar.collapsed .lh-sidebar-brand {
  opacity: 0;
  width: 0;
}

.lh-sidebar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lh-sidebar-toggle:hover {
  opacity: 0.7;
}

.lh-sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  gap: 4px;
}

.lh-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px;
  text-decoration: none;
  color: var(--lh-text-primary);
  font-family: 'Cambria', Georgia, serif;
  font-size: 16px;
  transition: background-color 0.2s;
  white-space: nowrap;
  overflow: hidden;
}

.lh-sidebar-link:hover {
  color: var(--lh-accent);
}

.lh-sidebar-link:hover .lh-sidebar-icon {
  filter: invert(34%) sepia(95%) saturate(2000%) hue-rotate(30deg) brightness(95%) contrast(90%);
}

.lh-sidebar-link.active {
  color: var(--lh-accent);
}

.lh-sidebar-link.active .lh-sidebar-icon {
  filter: invert(34%) sepia(95%) saturate(2000%) hue-rotate(30deg) brightness(95%) contrast(90%);
}

.lh-sidebar-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: block;
}

.lh-sidebar.collapsed .lh-sidebar-link span {
  display: none;
}

.lh-sidebar.collapsed .lh-sidebar-link {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

/* ── Main Content ── */
.lh-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background-color: var(--lh-bg);
}

/* ── Sticky Header (Welcome) ── */
.lh-header {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 130px 80px 40px;
}

.lh-header.hidden {
  display: none !important;
}

.lh-header--compact {
  padding: 20px 80px 10px !important;
}

.lh-header--compact .lh-welcome-text {
  display: none;
}

.lh-header--compact .lh-jeff-logo {
  width: 120px;
  margin-bottom: 20px;
  margin-top: 20px;
}

.lh-header--compact .lh-suggestions {
  display: none;
}

.lh-welcome-text {
  font-family: 'Cambria', Georgia, serif;
  font-style: italic;
  font-size: 14px;
  color: var(--lh-text-secondary);
  margin-bottom: 40px;
}

.lh-jeff-logo {
  width: 150px;
  height: auto;
  margin-bottom: 40px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
}

.lh-prompt-text {
  font-family: 'Cambria', Georgia, serif;
  font-style: italic;
  font-size: 16px;
  color: var(--lh-text-secondary);
  margin-bottom: 30px;
}

.lh-suggestions {
  margin-top: 20px;
  margin-bottom: 20px;
}

/* ── Scrollable Body ── */
.lh-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.lh-suggestion-btn {
  background: #ffffff;
  border: 1px solid var(--lh-border);
  color: var(--lh-text-secondary);
  border-radius: 20px;
  padding: 6px 10px;
  font-family: 'Cambria', Georgia, serif;
  font-size: 14px;
  transition: all 0.2s;
  cursor: pointer;
}

.lh-suggestion-btn:hover {
  border-color: var(--lh-accent);
  color: var(--lh-accent);
}

/* ── Chat Messages ── */
.lh-messages {
  overflow-y: auto;
  flex: 1;
  padding: 0 80px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.chat-message {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-bubble-user {
  background: var(--lh-accent);
  color: #fff;
  border-radius: 12px 12px 4px 12px;
}

.message-bubble-assistant {
  background: var(--lh-surface);
  border: 1px solid var(--lh-border);
  color: var(--lh-text-primary);
  border-radius: 12px 12px 12px 4px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--lh-text-muted);
  border-radius: 50%;
  display: inline-block;
  animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ── Input Area ── */
.lh-input-area {
  flex-shrink: 0;
  padding: 40px 80px;
  background-color: var(--lh-bg);
  border-top: 0px solid var(--lh-border);
}

.lh-input-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 700px;
  margin: 0 auto;
}

.lh-input {
  flex: 1;
  padding: 7px 24px 7px 54px;
  border: 1px solid var(--lh-border);
  border-radius: 50px;
  font-family: 'Cambria', Georgia, serif;
  font-size: 14px;
  background-color: #fff;
  background-image: url('../images/icon_searchback.svg');
  background-repeat: no-repeat;
  background-position: 18px center;
  background-size: 20px;
  color: var(--lh-text-primary);
  outline: none;
  transition: border-color 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.lh-input:focus {
  border-color: var(--lh-accent);
}

.lh-input::placeholder {
  color: var(--lh-text-muted);
  font-style: italic;
}

.lh-send-btn {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: var(--lh-accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, transform 0.1s;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.lh-send-btn:hover {
  background: var(--lh-accent-hover);
}

.lh-send-btn:active {
  transform: scale(0.95);
}

.lh-send-btn:disabled {
  background: var(--lh-border);
  cursor: not-allowed;
}

.lh-send-btn img {
  filter: brightness(0) invert(1);
}

/* ── Scrollbar (subtle) ── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .lh-sidebar {
    position: fixed;
    z-index: 1000;
  }
  
  .lh-sidebar.collapsed {
    width: 0;
    min-width: 0;
    border: none;
  }
  
  .lh-welcome {
    padding: 20px 30px;
  }
  
  .lh-messages {
    padding: 20px 30px;
  }
  
  .lh-input-area {
    padding: 20px 30px;
  }
  
  .lh-jeff-logo {
    width: 150px;
  }
}