/* ==========================================================================
   CSS DESIGN SYSTEM - THE CRASH CHATS (WHATSAPP-THEMED ARCHIVE VIEWER)
   ========================================================================== */

:root {
  /* HSL Color Tokens */
  --bg-app: hsl(210, 15%, 7%);
  --bg-sidebar: hsl(210, 16%, 9%);
  --bg-panel: hsl(210, 15%, 13%);
  --bg-panel-hover: hsl(210, 15%, 18%);
  --border-color: hsl(210, 14%, 20%);
  
  --text-main: hsl(210, 15%, 90%);
  --text-muted: hsl(210, 10%, 65%);
  --text-dim: hsl(210, 10%, 45%);
  
  --whatsapp-green: hsl(142, 60%, 45%);
  --whatsapp-green-dim: hsl(142, 35%, 25%);
  
  /* Chat Bubble Colors */
  --bubble-outgoing: hsl(142, 36%, 16%); /* Mackenzie - Forest green */
  --bubble-incoming: hsl(210, 12%, 18%); /* Dom - Slate blue-gray */
  --bubble-text: hsl(0, 0%, 96%);
  
  --avatar-bg: hsl(190, 35%, 25%);
  --accent-color: hsl(142, 70%, 45%);
  
  /* Layout Dimensions */
  --sidebar-width: 380px;
  --header-height: 70px;
}

/* Base Styles & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
}

h1, h2, h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
}

/* App Container */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ==========================================================================
   SIDEBAR LAYOUT
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease;
}

.sidebar.sidebar-hidden {
  margin-left: calc(-1 * var(--sidebar-width));
  opacity: 0;
  pointer-events: none;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(180deg, hsl(210, 16%, 11%) 0%, var(--bg-sidebar) 100%);
}

.sidebar-header h1 {
  font-size: 22px;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.sidebar-subtitle {
  font-size: 13px;
  color: var(--accent-color);
  font-weight: 500;
  text-transform: uppercase;
  margin-top: 2px;
  letter-spacing: 0.5px;
}

/* Scrollable Panels Area */
.panel {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.panel h2 {
  font-size: 14px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

/* Stats Panel */
.stats-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 24px;
}

.stat-item {
  background-color: var(--bg-panel);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-value {
  font-size: 14px;
  font-weight: 700;
  margin-top: 4px;
  color: var(--accent-color);
}

#stat-timespan {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Controls & Date Inputs */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-group label {
  font-size: 12px;
  color: var(--text-muted);
}

.input-with-button {
  display: flex;
  gap: 8px;
}

input[type="date"], input[type="text"] {
  flex-grow: 1;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.9);
  cursor: pointer;
}

input[type="date"]:focus, input[type="text"]:focus {
  border-color: var(--accent-color);
}

button {
  background-color: var(--whatsapp-green-dim);
  color: var(--text-main);
  border: 1px solid var(--whatsapp-green);
  padding: 10px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

button:hover {
  background-color: var(--whatsapp-green);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

/* Search Panel */
.search-panel {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-bottom: none;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  width: 100%;
  margin-bottom: 12px;
}

#search-input {
  padding-right: 36px;
  width: 100%;
}

#btn-clear-search {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
}

#btn-clear-search:hover {
  color: var(--text-main);
  transform: translateY(-50%);
}

.search-results-container {
  flex-grow: 1;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: hsl(210, 15%, 8%);
  padding: 4px;
}

.search-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

/* Search Result Item Card */
.search-result-card {
  padding: 12px;
  border-radius: 6px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-result-card:last-child {
  border-bottom: none;
}

.search-result-card:hover {
  background-color: var(--bg-panel-hover);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-sender {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-color);
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-time {
  font-size: 10px;
  color: var(--text-dim);
}

.result-body {
  font-size: 12px;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  word-break: break-word;
}

.result-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Participants Legend */
.participants-panel {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

.participant-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.participant-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.participant-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.participant-name {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

/* ==========================================================================
   MAIN CHAT WINDOW
   ========================================================================== */
.chat-window {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: hsl(200, 10%, 6%); /* WhatsApp dark background */
  position: relative;
}

/* Chat Wallpaper Overlay */
.chat-window::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  opacity: 0.04; /* Subtly overlays WhatsApp wallpaper pattern */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23ffffff' fill-opacity='0.4'%3E%3Cpath fill-rule='evenodd' d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm1-61c3.16 0 6-2.84 6-6s-2.84-6-6-6-6 2.84-6 6 2.84 6 6 6zm-.667 30C29.04 59 25 54.96 25 50s4.04-9 9.333-9 9.333 4.04 9.333 9-4.04 9-9.333 9zM10 60c2.2 0 4-1.8 4-4s-1.8-4-4-4-4 1.8-4 4 1.8 4 4 4zm65-35c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* Chat Header */
.chat-header {
  height: var(--header-height);
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  gap: 12px;
}

.chat-contact-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--avatar-bg);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  border: 1px solid var(--border-color);
}

.chat-contact-info h2 {
  font-size: 16px;
  color: var(--text-main);
}

.status-indicator {
  font-size: 12px;
  color: var(--whatsapp-green);
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-indicator {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.current-date-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

/* Conversation Scroll Container */
.chat-body-wrapper {
  flex-grow: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-conversation {
  flex-grow: 1;
  overflow-y: auto;
  padding: 24px 8% 24px 8%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 5;
  scroll-behavior: auto; /* Required for programmatic non-smooth adjustments */
}

/* Loader Spinners */
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  color: var(--text-muted);
  font-size: 12px;
}

.loader-container.hidden {
  display: none !important;
}

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

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

/* ==========================================================================
   CHAT BUBBLES
   ========================================================================== */
.messages-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message-bubble-wrapper {
  display: flex;
  width: 100%;
}

.message-bubble-wrapper.outgoing {
  justify-content: flex-end;
}

.message-bubble-wrapper.incoming {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 65%;
  padding: 8px 14px 6px 14px;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  gap: 2px;
  word-break: break-word;
}

/* Speeches tail styling */
.message-bubble::after {
  content: "";
  position: absolute;
  top: 0;
  width: 0;
  height: 0;
  border: 8px solid transparent;
}

.outgoing .message-bubble {
  background-color: var(--bubble-outgoing);
  color: var(--bubble-text);
  border-top-right-radius: 0px;
}

.outgoing .message-bubble::after {
  right: -8px;
  border-left-color: var(--bubble-outgoing);
  border-top-color: var(--bubble-outgoing);
}

.incoming .message-bubble {
  background-color: var(--bubble-incoming);
  color: var(--bubble-text);
  border-top-left-radius: 0px;
}

.incoming .message-bubble::after {
  left: -8px;
  border-right-color: var(--bubble-incoming);
  border-top-color: var(--bubble-incoming);
}

/* Bubble Internal Elements */
.msg-sender {
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 2px;
}

/* WhatsApp Sender Color Differentiation */
.incoming .msg-sender {
  color: hsl(190, 80%, 65%);
}

.msg-body {
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap; /* Preserves newlines in text messages */
}

.msg-meta-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  align-self: flex-end;
}

.msg-time {
  font-size: 10px;
  color: var(--text-muted);
}

.msg-status-tick {
  font-size: 11px;
  font-weight: bold;
  user-select: none;
}

/* Checkmarks color */
.outgoing .msg-status-tick.read {
  color: hsl(195, 100%, 65%); /* Double blue tick */
}

.outgoing .msg-status-tick.sent {
  color: var(--text-dim); /* Single gray tick */
}

/* Target highlight styling for Anchors */
.message-bubble-wrapper.target-anchor .message-bubble {
  animation: flash-highlight 2s ease-out;
  outline: 2px solid var(--accent-color);
}

@keyframes flash-highlight {
  0% {
    background-color: hsl(200, 100%, 30%);
    box-shadow: 0 0 20px var(--accent-color);
  }
  100% {
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  }
}

/* Date Bubble Separator */
.system-date-bubble {
  display: flex;
  justify-content: center;
  margin: 16px 0;
  user-select: none;
}

.system-date-bubble span {
  background-color: hsl(210, 12%, 14%);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  border: 1px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Floating Date Bubble */
.floating-date-bubble {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background-color: hsl(210, 15%, 15%, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: opacity 0.3s;
  pointer-events: none;
}

/* ==========================================================================
   FLOATING ACTION BUTTONS
   ========================================================================== */
.floating-action-btn {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: var(--bg-panel);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 99;
  transition: all 0.2s;
}

.floating-action-btn:hover {
  background-color: var(--bg-panel-hover);
  border-color: var(--accent-color);
  transform: scale(1.08);
}

.floating-action-btn:active {
  transform: scale(0.95);
}

.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--accent-color);
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 3px 6px;
  border-radius: 50%;
  border: 1px solid var(--bg-app);
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */
.hidden {
  display: none !important;
}

.initial-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 300px;
}

.placeholder-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  padding: 30px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  max-width: 400px;
}

.placeholder-card h3 {
  font-size: 18px;
}

.placeholder-card p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ==========================================================================
   HOMEPAGE STYLES
   ========================================================================== */
.home-body {
  background-color: hsl(210, 15%, 5%);
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  height: 100vh;
  width: 100vw;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.home-container {
  width: 100%;
  max-width: 900px;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.home-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-header .brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.home-header .icon {
  font-size: 32px;
}

.home-header h1 {
  font-size: 36px;
  background: linear-gradient(135deg, #fff 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}

.home-header .subtitle {
  font-size: 16px;
  color: var(--accent-color);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.home-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.intro-card {
  background: linear-gradient(145deg, var(--bg-sidebar) 0%, var(--bg-panel) 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.intro-card h2 {
  font-size: 20px;
  margin-bottom: 16px;
  color: #fff;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 8px;
  display: inline-block;
}

.intro-card p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.intro-card p strong {
  color: #fff;
}

.cta-wrapper {
  margin-top: 24px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background-color: var(--whatsapp-green);
  color: #fff;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(20, 198, 86, 0.3);
}

.btn-primary:hover {
  background-color: hsl(142, 60%, 50%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(20, 198, 86, 0.4);
}

.resources-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 600px) {
  .resources-grid {
    grid-template-columns: 1fr;
  }
}

.resource-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s, border-color 0.2s;
}

.resource-card:hover {
  transform: translateY(-2px);
  border-color: var(--text-dim);
}

.resource-card .card-icon {
  font-size: 24px;
}

.resource-card h3 {
  font-size: 18px;
  color: #fff;
}

.resource-card p {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
  flex-grow: 1;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  width: fit-content;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background-color: var(--bg-panel-hover);
  border-color: var(--text-muted);
}

.home-footer {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.home-footer p {
  font-size: 12px;
  color: var(--text-dim);
}

/* ==========================================================================
   HEADER ACTION BUTTONS
   ========================================================================== */
.header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}

.header-action-btn:hover {
  background-color: var(--bg-panel-hover);
  color: var(--text-main);
  border-color: var(--text-muted);
  transform: none; /* Override standard button hover transform */
}

.header-action-btn svg {
  flex-shrink: 0;
}

/* Sidebar close button — always visible */
.sidebar-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  flex-shrink: 0;
}

.sidebar-close-btn:hover {
  background-color: var(--bg-panel-hover);
  color: var(--text-main);
  transform: none;
}

/* Sidebar header layout */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-title-container {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background-color: hsl(142, 60%, 15%);
  color: hsl(142, 70%, 85%);
  border: 1px solid var(--whatsapp-green);
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE / TABLET)
   ========================================================================== */
@media (max-width: 768px) {
  /* Overlay Backdrop */
  .sidebar-overlay {
    display: block;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  
  .sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* Sidebar drawer - override desktop margin behavior */
  .sidebar,
  .sidebar.sidebar-hidden {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85%;
    max-width: 320px;
    z-index: 1000;
    margin-left: 0;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 8px 0 25px rgba(0,0,0,0.5);
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  .sidebar-header {
    padding: 16px 20px;
  }

  /* Button text hidden on mobile */
  .header-action-btn span {
    display: none;
  }

  .header-action-btn {
    padding: 8px;
    border-radius: 50%;
  }

  .page-indicator {
    padding: 4px 8px;
    font-size: 10px;
  }

  .current-date-header {
    font-size: 11.5px;
  }

  /* Chat window adjustments */
  .chat-conversation {
    padding: 16px 12px;
  }

  .message-bubble {
    max-width: 85%;
  }
}
