:root {
  /* 2025 Modern Glass Palette */
  --primary: #FF512F;
  /* Electric Orange */
  --primary-dark: #DD2476;
  /* Hot Pink/Red shift */
  --primary-gradient: linear-gradient(135deg, #FF512F 0%, #DD2476 100%);

  --secondary: #2C3E50;
  /* Deep Blue/Grey */
  --accent: #F09819;
  /* Sunshine Yellow/Orange */
  --accent-gradient: linear-gradient(135deg, #F09819 0%, #EDDE5D 100%);

  --bg-color: #FDFBF7;
  --surface-glass: rgba(255, 255, 255, 0.75);
  --surface-border: rgba(255, 255, 255, 0.4);

  --text-main: #1A1A1A;
  --text-muted: #555555;

  --nav-bg: rgba(255, 255, 255, 0.85);
  /* Glass Nav */

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-neon: 0 0 15px rgba(255, 81, 47, 0.3);

  --radius-lg: 1.5rem;
  --radius-xl: 2rem;

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  /* Subtle Mesh Gradient Background */
  background-image:
    radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 0.05) 0, transparent 50%),
    radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 0.05) 0, transparent 50%),
    radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 0.05) 0, transparent 50%);
  background-attachment: fixed;
  background-size: cover;
  color: var(--text-main);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  /* Sidebar Layout */
  overflow-x: hidden;
}

/* Sidebar Navigation */
.sidebar {
  width: 280px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--surface-border);
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  flex-shrink: 0;
}

.sidebar.collapsed {
  width: 88px;
  padding: 1.5rem 0.75rem;
}

.sidebar-header {
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  /* Hide text when collapsed */
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--secondary);
  font-size: 1.1rem;
  line-height: 1.2;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.sidebar.collapsed .sidebar-logo span {
  opacity: 0;
  width: 0;
  display: none;
}

.sidebar.collapsed .sidebar-logo {
  display: none;
}

.sidebar-logo img {
  height: 48px;
  width: auto;
  min-width: 48px;
  /* Prevent shrinking */
}

/* Toggle Button */
.toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.25rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Make sure mobile toggle is hidden on desktop by default */
.mobile-toggle-btn {
  display: none;
}

.toggle-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--primary);
}

.sidebar.collapsed .toggle-btn {
  /* Keep centered when collapsed */
  position: absolute;
  top: 1.5rem;
  right: 50%;
  transform: translateX(50%);
  display: flex;
}

/* Nav Links */
.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item a i {
  font-size: 1.5rem;
  min-width: 1.5rem;
  text-align: center;
}

.nav-item a:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--primary);
  transform: translateX(4px);
}

.nav-item a.active {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 81, 47, 0.25);
}

.nav-item a.active:hover {
  transform: none;
  /* remove hover move for active */
}

.sidebar.collapsed .nav-item a {
  justify-content: center;
  padding: 0.85rem 0;
}

.sidebar.collapsed .nav-item a span {
  display: none;
}

/* Submenu / Dropdown Handling in Sidebar */
/* For now, we will flatten resources or use an accordion. Flattening for specific request "collapsible with icons" usually refers to the sidebar itself. I will add Resources as a main link, maybe indent sublinks if needed, but for simplicity I'll keep the main links. */

/* Main Content Wrapper */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* Prevent flex overflow */
  height: 100vh;
  overflow-y: auto;
  /* Main scrolling area */
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  /* Bolder for 2025 look */
  line-height: 1.1;
  margin-bottom: 1rem;
  color: var(--secondary);
  letter-spacing: -0.03em;
}

h1 {
  font-size: 3.5rem;
}

h2 {
  font-size: 2.5rem;
}

h3 {
  font-size: 1.75rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
}

a:hover {
  text-decoration: none;
  filter: brightness(1.2);
}

/* Glassmorphism Navigation */
header {
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--surface-border);
  position: sticky;
  top: 0;
  z-index: 2000;
  padding: 0.5rem 0;
  /* Reduced padding to balance height */
  min-height: 150px;
  /* Force taller header */
  display: flex;
  align-items: center;
}

.container {
  max-width: 1400px;
  /* Wider container for larger nav */
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

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

.logo {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 900;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* Allow logo to overlap if needed or just be large */
}

.logo img {
  height: 120px;
  /* Massive Logo as requested */
  width: auto;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.logo:hover img {
  transform: scale(1.05);
}

nav ul {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  align-items: center;
  /* Ensure alignment */
}

nav a {
  color: var(--secondary);
  font-weight: 600;
  font-size: 1rem;
  position: relative;
}

/* Nav Link Underline Effect */
nav a:not(.btn)::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background: var(--primary-gradient);
  transition: width 0.3s ease;
}

nav a:not(.btn):hover::after,
nav a:not(.btn).active::after {
  width: 100%;
}

main {
  flex: 1;
  padding: 2rem 0;
}

footer {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 2rem 0;
  text-align: center;
  margin-top: auto;
  border-top: 1px solid var(--surface-border);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: 2rem;
  /* Pill shape */
  font-weight: 600;
  font-family: var(--font-heading);
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-decoration: none !important;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white !important;
  /* Force white text */
  box-shadow: 0 4px 15px rgba(255, 81, 47, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 81, 47, 0.6);
  filter: brightness(1.1);
  color: white;
}

.btn-accent {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-accent:hover {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
}

.btn-nav {
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
}


/* Glass Cards */
.glass-card {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.glass-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
  border-color: rgba(255, 81, 47, 0.4);
  background: rgba(255, 255, 255, 0.85);
}

.card {
  /* Inherit glass properties if using generic card class */
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.4s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}


/* Slider Styles */
.hero-slider-container {
  position: relative;
  width: 100%;
  height: 500px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 3rem;
  background: #333;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  background-size: cover;
  background-position: center;
}

.slide.active {
  opacity: 1;
}


.slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.1) 100%);
  z-index: 1;
}

.slide-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 4rem 3rem;
  color: white;
  z-index: 2;
  text-align: left;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: 0.3s;
}

.slide.active .slide-content {
  transform: translateY(0);
  opacity: 1;
}

.slide-content h1 {
  color: white;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  margin-bottom: 0.75rem;
  font-size: 3.5rem;
  letter-spacing: -0.02em;
  opacity: 0.95;
}

.slide-content p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.35rem;
  max-width: 700px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  font-weight: 400;
  line-height: 1.6;
}

/* Main Header */
.main-header {
  padding: 1rem 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--surface-border);
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 2000;
  /* Ensure header is above main content */
  width: 100%;
}

/* Regulation Content Scrollable Container */
.reg-content {
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: auto;
  padding: 2rem;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  margin-top: 1rem;
}

/* Custom Scrollbar for reg-content */
.reg-content::-webkit-scrollbar {
  width: 8px;
}

.reg-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.reg-content::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.reg-content::-webkit-scrollbar-thumb:hover {
  background: #bbb;
}

/* Search UI */
.search-container {
  position: relative;
  /* Removed margin-left to allow centering */
  display: flex;
  align-items: center;
}

.search-input {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  color: var(--text-main);
  font-family: var(--font-body);
  width: 200px;
  transition: all 0.3s ease;
}

.search-input:focus {
  width: 300px;
  background: rgba(255, 255, 255, 0.8);
  outline: none;
  box-shadow: 0 0 10px rgba(255, 81, 47, 0.2);
}

.search-results {
  position: absolute;
  top: 100%;
  right: 0;
  width: 350px;
  max-width: 90vw;
  max-height: 400px !important;
  overflow-y: auto !important;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  box-shadow: var(--shadow-lg);
  padding: 1rem;
  margin-top: 0.5rem;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 3000;
  /* Ensure it's above everything else */
  border: 1px solid rgba(255, 255, 255, 0.5);
}



.search-results.active {
  display: flex;
}

.search-result-item {
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.5);
  transition: background 0.2s;
  text-decoration: none;
  color: var(--text-main);
}

.search-result-item:hover {
  background: white;
}

.search-result-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
  display: block;
  margin-bottom: 0.25rem;
}

.search-result-snippet {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: block;
}

/* Chat Widget */
.chat-widget {
  position: fixed;
  /* Default positioning - will be overridden by JS inline styles for drag */
  bottom: 2rem;
  right: 2rem;
  left: auto;
  /* Explicitly unset left so right takes precedence initially */
  width: 350px;
  height: 500px;
  /* Fixed height for open state */
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 1rem;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--surface-border);
  z-index: 9999;
  /* Boost Z-Index significantly */
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  /* Ensure content is hit when minimized */
  resize: both;
  /* Allow resizing */
  min-width: 300px;
  min-height: 400px;
  max-width: 90vw;
  max-height: 90vh;
}

.chat-widget.minimized {
  height: 60px !important;
  /* Only header visible */
  resize: none !important;
  /* Disable resize when minimized */
  width: 350px !important;
  /* Reset width on minimize */
  min-width: 0 !important;
  min-height: 0 !important;
}

.chat-widget.minimized .chat-messages,
.chat-widget.minimized .chat-input {
  display: none !important;
}

/* Vertical Orientation for Side Snaps */
.chat-widget.minimized.snap-left,
.chat-widget.minimized.snap-right {
  width: 60px !important;
  height: 300px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  overflow: visible !important;
  /* Allow header rotation to render cleanly */
}

.chat-widget.minimized.snap-left .chat-header,
.chat-widget.minimized.snap-right .chat-header {
  position: absolute;
  width: 300px !important;
  /* Force width to match vertical height */
  height: 60px !important;
  /* Force height to match vertical width */
  margin: 0;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  /* Center before rotation */
  /* Remove writing-mode */
  writing-mode: horizontal-tb;
  /* Fix Borders: We want the side sticking out to be rounded */
  border-radius: 1rem 1rem 0 0;
  /* Standard top rounded */
}

.chat-widget.minimized.snap-left .chat-header {
  /* Rotate CCW (-90deg) */
  /* Top(Rounded) points Left (Wall). Bottom(Flat) points Right (Out). */
  /* We want Wall(Left) Flat, Out(Right) Rounded. */
  /* So we need Element Bottom to be Rounded. Override radius. */
  transform: rotate(-90deg);
  border-radius: 0 0 1rem 1rem;
  box-shadow: -2px 0 10px rgba(255, 81, 47, 0.2);
  /* Adjust shadow direction */
}

.chat-widget.minimized.snap-right .chat-header {
  /* Rotate CW (90deg) */
  /* Top(Rounded) points Right (Wall). Bottom(Flat) points Left (Out). */
  /* We want Wall(Right) Flat, Out(Left) Rounded. */
  /* So we need Element Bottom to be Rounded. */
  transform: rotate(90deg);
  border-radius: 0 0 1rem 1rem;
  box-shadow: 2px 0 10px rgba(255, 81, 47, 0.2);
}

.chat-header {
  background: var(--primary-gradient);
  color: white;
  padding: 1rem;
  cursor: grab;
  border-radius: 1rem 1rem 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(255, 81, 47, 0.2);
}

.chat-header:active {
  cursor: grabbing;
}

.chat-messages {
  flex: 1;
  height: auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1.25rem;
  padding-bottom: 0.5rem;
  background: white;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}


/* Multi-Agent Chat Styles */

/* Message Group Wrapper */
.message-group.ai {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  max-width: 85%;
}

/* Agent Name Header */
.agent-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
  margin-left: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* AI Message Bubble (override specificity if needed) */
.message-group.ai .message.ai {
  margin-bottom: 0;
  /* Reset margin inside group */
  border-top-left-radius: 4px;
  /* Slightly squared top-left for flow */
}

/* User Message styling remains standard */
.message.user {
  align-self: flex-end;
  background: var(--primary-gradient);
  color: white;
  border-radius: 1rem 1rem 0 1rem;
  padding: 0.75rem 1rem;
  max-width: 80%;
  box-shadow: 0 2px 5px rgba(255, 81, 47, 0.2);
}

.message.ai {
  align-self: flex-start;
  background: #f0f2f5;
  color: var(--text-main);
  border-radius: 1rem 1rem 1rem 0;
  padding: 0.75rem 1rem;
  max-width: 100%;
  /* Relative to group */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Thinking Indicator */
.thinking-indicator {
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-self: flex-start;
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

.thinking-label {
  font-weight: 500;
  font-style: italic;
}

.thinking-dots {
  display: flex;
  gap: 4px;
}

.thinking-dots span {
  width: 4px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: blink 1.4s infinite both;
}

.thinking-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0% {
    opacity: 0.2;
    transform: scale(0.8);
  }

  20% {
    opacity: 1;
    transform: scale(1.2);
  }

  100% {
    opacity: 0.2;
    transform: scale(0.8);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}



.message {
  max-width: 80%;
  padding: 0.85rem 1rem;
  border-radius: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
  position: relative;
  word-wrap: break-word;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.user {
  align-self: flex-end;
  background: var(--primary-gradient);
  color: white;
  border-bottom-right-radius: 0.25rem;
  box-shadow: 0 4px 10px rgba(255, 81, 47, 0.25);
  margin-left: 20%;
}

.message.ai {
  align-self: flex-start;
  background: #f1f5f9;
  color: var(--text-main);
  border-bottom-left-radius: 0.25rem;
  margin-right: 20%;
}

.chat-input {
  padding: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 0.75rem;
  background: white;
  align-items: center;
}

.chat-input input {
  flex: 1;
  border: 1px solid #e2e8f0;
  padding: 0.75rem 1rem;
  border-radius: 2rem;
  outline: none;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  background: #f8fafc;
}

.chat-input input:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(255, 81, 47, 0.1);
}

.chat-input button {
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 1rem;
  width: 140px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(255, 81, 47, 0.3);
  font-size: 1.1rem;
  /* Icon size */
  font-weight: 600;
  gap: 0.5rem;
}

.chat-input button::after {
  content: '';
  display: none;
}

.chat-input button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(255, 81, 47, 0.4);
}

.chat-input button:active {
  transform: scale(0.95);
}

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

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

/* Mobile Navigation */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 4px;
  z-index: 1100;
}

.hamburger-btn span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--secondary);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.mobile-menu {
  position: fixed;
  top: 70px;
  /* Below header */
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  padding: 2rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-150%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: center;
}

.mobile-menu.active {
  transform: translateY(0);
}

.mobile-menu a {
  font-size: 1.25rem;
  color: var(--secondary);
  font-weight: 600;
  padding: 0.5rem;
}

/* Desktop Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  min-width: 220px;
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 2001;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid var(--surface-border);
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-main);
  white-space: nowrap;
  text-align: left;
}

.dropdown-menu a:hover {
  background: rgba(255, 81, 47, 0.1);
  color: var(--primary);
}

.mb-2 {
  margin-bottom: 2rem;
}

.text-center {
  text-align: center;
}

/* Responsive */
/* Responsive Sidebar */
@media (max-width: 1024px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--surface-border);
    padding: 1rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .sidebar-header {
    width: 100%;
    margin-bottom: 0;
  }

  .sidebar.collapsed {
    width: 100%;
    padding: 1rem;
  }

  .nav-links {
    display: none;
    /* Hide desktop nav links on mobile, use hamburger */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    padding: 1rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    z-index: 1001;
  }

  .nav-links.active {
    display: flex;
  }

  .mobile-toggle-btn {
    display: block;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--secondary);
  }

  .toggle-btn {
    display: none;
    /* Hide collapse button on mobile */
  }

  .main-wrapper {
    height: auto;
    min-height: 100vh;
    overflow-y: visible;
  }
}

/* --- Search Results Panel --- */
#search-results-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  max-height: 300px;
  overflow-y: auto;
  z-index: 2000;
  display: none;
  /* Hidden by default */
  padding: 8px 0;
}

.search-result-item {
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s;
}

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

.search-result-item:hover {
  background: #f8fafc;
}

.search-result-item h5 {
  margin: 0 0 4px 0;
  font-size: 0.95rem;
  color: var(--text-main);
}

.search-result-item p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* --- Zoning Modal --- */
.zoning-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.zoning-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.zoning-modal {
  background: white;
  width: 90%;
  max-width: 600px;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  padding: 24px;
  position: relative;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.zoning-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 12px;
}

.zoning-modal-header h3 {
  margin: 0;
  color: var(--text-main);
  font-size: 1.5rem;
}

.zoning-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.2s;
}

.zoning-modal-close:hover {
  color: var(--secondary);
}

.zoning-modal-content {
  overflow-y: auto;
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-main);
}

.zoning-code-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.85rem;
  margin-left: 10px;
}

.view-zoning {
  color: var(--secondary);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed var(--secondary);
}

.view-zoning:hover {
  color: var(--primary);
  border-bottom-style: solid;
}

.thinking-indicator {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 1rem;
  width: fit-content;
  max-width: 80%;
  margin-bottom: 0.5rem;
  border: 1px dashed rgba(0, 0, 0, 0.1);
}

.thinking-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.thinking-dots span {
  width: 4px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 50%;
  display: inline-block;
  animation: thinking 1.4s infinite ease-in-out both;
}

.thinking-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.thinking-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes thinking {

  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.5;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.thinking-content {
  display: none;
  /* Hidden until content arrives */
  font-family: monospace;
  font-size: 0.8rem;
  white-space: pre-wrap;
  margin-top: 0.25rem;
  color: #666;
}

/* Streaming Content Fade-in */
.message.ai {
  transition: all 0.2s ease;
}