/* Index Page Specific Styles */

body {
  background: linear-gradient(135deg, #0a1628 0%, #0f2140 50%, #152d4f 100%);
  min-height: 100vh;
}

.glass-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.gold-glow {
  box-shadow: 0 0 40px rgba(212, 168, 85, 0.15);
}

.teal-glow {
  box-shadow: 0 0 40px rgba(45, 212, 191, 0.15);
}

.input-glow:focus {
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2);
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.animate-slide-up {
  animation: slideUp 0.6s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    opacity: 0; 
    transform: translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

.shimmer {
  background: linear-gradient(90deg, 
    rgba(255,255,255,0.03) 25%, 
    rgba(255,255,255,0.08) 50%, 
    rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.priority-high { border-left-color: #ef4444; }
.priority-medium { border-left-color: #f59e0b; }
.priority-low { border-left-color: #22c55e; }

.impact-high { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.impact-medium { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.impact-low { background: rgba(34, 197, 94, 0.15); color: #86efac; }

/* Section metadata badges */
.section-header-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meta-badge-new {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.meta-badge-updated {
  background: rgba(168, 85, 247, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(168, 85, 247, 0.3);
  animation: pulse-updated 2s ease-in-out infinite;
}

@keyframes pulse-updated {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Impersonation widget pulse */
@keyframes pulse-impersonation {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }
  50% { 
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
  }
}

#impersonationStatus > div {
  animation: pulse-impersonation 2s ease-in-out infinite;
}

.meta-timestamp {
  font-size: 0.625rem;
  color: #6b7280;
  white-space: nowrap;
}

.tab-active {
  background: rgba(45, 212, 191, 0.1);
  border-color: rgba(45, 212, 191, 0.5);
  color: #2dd4bf;
}

.prospect-card {
  transition: all 0.3s ease;
}

.prospect-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(45, 212, 191, 0.1);
  border-color: rgba(45, 212, 191, 0.3);
}

.tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem;
  min-height: 48px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  background: rgba(45, 212, 191, 0.15);
  border: 1px solid rgba(45, 212, 191, 0.3);
  border-radius: 9999px;
  font-size: 0.875rem;
  color: #2dd4bf;
}

.tag button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-left: 0.25rem;
  border-radius: 50%;
  color: rgba(45, 212, 191, 0.7);
}

.tag button:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.5);
}

/* Autocomplete styles */
.autocomplete-container {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  background: rgba(15, 33, 64, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  margin-top: 0.25rem;
  z-index: 50;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.autocomplete-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease;
}

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

.autocomplete-item:hover,
.autocomplete-item.active {
  background: rgba(45, 212, 191, 0.1);
}

.autocomplete-item .industry-name {
  color: #fff;
  font-weight: 500;
}

.autocomplete-item .industry-code {
  color: #6b7280;
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.autocomplete-item .industry-sector {
  color: #9ca3af;
  font-size: 0.75rem;
  display: block;
  margin-top: 0.125rem;
}

.autocomplete-item mark {
  background: rgba(45, 212, 191, 0.3);
  color: #2dd4bf;
  border-radius: 2px;
  padding: 0 2px;
}

.autocomplete-hint {
  padding: 0.5rem 1rem;
  color: #6b7280;
  font-size: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Filter Sidebar Styles */
.filter-sidebar {
  width: 280px;
  flex-shrink: 0;
}

.filter-type-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #9ca3af;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  text-align: left;
}

.filter-type-btn:hover {
  background: rgba(45, 212, 191, 0.08);
  border-color: rgba(45, 212, 191, 0.2);
  color: #e5e7eb;
}

.filter-type-btn:hover .filter-icon {
  color: #2dd4bf;
}

.filter-type-btn .filter-icon {
  color: #6b7280;
  transition: color 0.2s ease;
}

.filter-card {
  background: rgba(45, 212, 191, 0.05);
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: 1rem;
  padding: 1rem;
  animation: slideIn 0.25s ease-out;
}

.filter-card.required-filter {
  border-left: 3px solid #2dd4bf;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.filter-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #2dd4bf;
  font-size: 0.875rem;
}

.filter-remove-btn {
  padding: 0.25rem;
  border-radius: 0.375rem;
  color: #6b7280;
  transition: all 0.15s ease;
}

.filter-remove-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.filter-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: rgba(10, 22, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.625rem;
  color: #fff;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.filter-input:focus {
  outline: none;
  border-color: rgba(45, 212, 191, 0.4);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.1);
}

.filter-input::placeholder {
  color: #6b7280;
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.range-inputs .filter-input {
  width: 80px;
  text-align: center;
  padding: 0.5rem 0.5rem;
}

.range-separator {
  color: #6b7280;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: rgba(10, 22, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.15s ease;
}

.checkbox-label:hover {
  border-color: rgba(45, 212, 191, 0.3);
  color: #e5e7eb;
}

.checkbox-label:has(input:checked) {
  background: rgba(45, 212, 191, 0.15);
  border-color: rgba(45, 212, 191, 0.4);
  color: #2dd4bf;
}

.checkbox-label input {
  display: none;
}

.empty-filters {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  color: #6b7280;
}

.empty-filters-icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  color: #4b5563;
}

.required-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  background: rgba(45, 212, 191, 0.15);
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 600;
  color: #2dd4bf;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 1024px) {
  .filter-sidebar {
    width: 100%;
  }
  
  .advanced-search-layout {
    flex-direction: column !important;
  }
}

/* Comparison View Styles */
.comparison-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #0a1628;
  box-shadow: 0 2px 8px rgba(45, 212, 191, 0.4);
  animation: badgePop 0.3s ease-out;
}

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

/* Section metadata badges */
.section-badge-new {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border-radius: 9999px;
  animation: badgePop 0.4s ease-out;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.section-badge-updated {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 500;
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
  border-radius: 9999px;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.section-timestamp {
  font-size: 11px;
  color: #6b7280;
  font-weight: 400;
}

.section-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.compare-btn {
  transition: all 0.2s ease;
}

.compare-btn:hover {
  transform: translateY(-1px);
}

.compare-btn.selected {
  background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
  color: #0a1628;
  border-color: transparent;
}

.comparison-section {
  animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.comparison-card {
  position: relative;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.05) 0%, rgba(45, 212, 191, 0.02) 100%);
  border: 1px solid rgba(45, 212, 191, 0.2);
  transition: all 0.3s ease;
}

.comparison-card:hover {
  border-color: rgba(45, 212, 191, 0.4);
  box-shadow: 0 8px 30px rgba(45, 212, 191, 0.1);
}

.comparison-card .remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s ease;
}

.comparison-card:hover .remove-btn {
  opacity: 1;
}

.comparison-card .remove-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

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

.vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0;
}

.vs-badge {
  background: linear-gradient(135deg, #d4a855 0%, #c9973f 100%);
  color: #0a1628;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(212, 168, 85, 0.3);
}

.comparison-floating-bar {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  animation: floatUp 0.3s ease-out;
}

@keyframes floatUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Export Button Styles */
.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.3);
  border-radius: 0.5rem;
  color: #2dd4bf;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.export-btn:hover {
  background: rgba(45, 212, 191, 0.2);
  border-color: rgba(45, 212, 191, 0.5);
  transform: translateY(-1px);
}

.export-btn:active {
  transform: translateY(0);
}

.export-btn svg {
  width: 1rem;
  height: 1rem;
}

.export-btn.exporting {
  opacity: 0.7;
  pointer-events: none;
}

.export-dropdown {
  position: relative;
  display: inline-block;
}

.export-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  min-width: 200px;
  background: rgba(15, 33, 64, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.5rem;
  z-index: 50;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.export-dropdown.open .export-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.export-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: #e5e7eb;
  font-size: 0.875rem;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
}

.export-dropdown-item:hover {
  background: rgba(45, 212, 191, 0.1);
  color: #2dd4bf;
}

.export-dropdown-item svg {
  width: 1rem;
  height: 1rem;
  color: #6b7280;
}

.export-dropdown-item:hover svg {
  color: #2dd4bf;
}

/* Navigation item active state */
.nav-item.active {
  background: rgba(45, 212, 191, 0.1);
  color: #2dd4bf;
}

.nav-item.active svg {
  color: #2dd4bf;
}

/* ===== MOBILE OPTIMIZATIONS ===== */

/* Mobile sidebar backdrop overlay - only visible on mobile */
.sidebar-backdrop {
  display: none !important;
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.8);
  backdrop-filter: blur(4px);
  z-index: 19;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

/* Only show backdrop on mobile/tablet screens */
@media (max-width: 1024px) {
  .sidebar-backdrop {
    display: none !important;
  }
  .sidebar-backdrop.active {
    display: block !important;
    opacity: 1;
    pointer-events: auto;
  }
}

/* Ensure backdrop is ALWAYS hidden on desktop */
@media (min-width: 1025px) {
  .sidebar-backdrop,
  .sidebar-backdrop.active {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }
}

/* Chat bar collapse toggle */
.chat-collapse-toggle {
  display: none;
}

.chat-content.collapsed {
  display: none;
}

.chat-collapsed-bar {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  cursor: pointer;
}

.chat-collapsed-bar.active {
  display: flex;
}

@media (max-width: 640px) {
  /* === PREVENT HORIZONTAL OVERFLOW === */
  body {
    overflow-x: hidden;
  }
  
  main {
    overflow-x: hidden;
    max-width: 100vw;
  }
  
  /* === LARGER TOUCH TARGETS === */
  button, a.btn, .clickable, 
  .filter-type-btn, .checkbox-label {
    min-height: 44px;
  }
  
  /* === SIDEBAR AS FULL-SCREEN OVERLAY === */
  #historySidebar {
    width: 100%;
    max-width: 100%;
  }
  
  #historySidebar .p-4 {
    padding: 1rem;
  }
  
  /* === CHAT BAR OPTIMIZATIONS === */
  #chatSection {
    padding-top: 0;
    padding-bottom: 0;
  }
  
  #chatContainer {
    padding: 0.75rem 1rem;
  }
  
  /* Show chat collapse toggle on mobile */
  .chat-collapse-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.5rem;
    color: #9ca3af;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 0.5rem;
  }
  
  .chat-collapse-toggle:hover {
    color: #fff;
  }
  
  /* Refinement suggestions - compact on mobile */
  #refinementSuggestions {
    margin-bottom: 0.5rem;
  }
  
  #refinementSuggestions .text-xs {
    font-size: 0.625rem;
  }
  
  #suggestionPills {
    gap: 0.5rem;
    padding-bottom: 0.5rem;
  }
  
  /* Override suggestion pill styles on mobile */
  #suggestionPills .suggestion-pill {
    min-width: 140px !important;
    max-width: 180px !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.75rem !important;
  }
  
  #suggestionPills .suggestion-pill .w-8 {
    width: 1.5rem !important;
    height: 1.5rem !important;
  }
  
  #suggestionPills .suggestion-pill .w-8 svg {
    width: 0.75rem !important;
    height: 0.75rem !important;
  }
  
  #suggestionPills .suggestion-pill .truncate {
    font-size: 0.7rem !important;
    max-width: 100px !important;
  }
  
  /* Move impersonation widget above chat bar on mobile */
  #impersonationWidget {
    bottom: auto !important;
    top: 70px !important;
    right: 0.5rem !important;
    left: auto !important;
  }
  
  #impersonationWidget .glass-card {
    padding: 0.5rem !important;
  }
  
  #impersonationWidget button {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
  }
  
  /* Make dropdown open downward on mobile */
  #impersonationDropdown {
    bottom: auto !important;
    top: 100% !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0 !important;
    max-height: 60vh !important;
    width: calc(100vw - 1rem) !important;
    max-width: 320px !important;
    right: 0 !important;
  }
  
  /* Smaller chat input and button */
  #chatInput {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
  }
  
  #chatSendBtn {
    padding: 0.625rem 1rem;
  }
  
  /* Hide button text, keep icon */
  #chatSendBtn span.btn-text {
    display: none;
  }
  
  /* Hide descriptive text on mobile */
  #chatSection .text-gray-400.text-sm {
    display: none;
  }
  
  /* === URL INPUT SECTION === */
  #urlSection .glass-card {
    padding: 1.25rem;
  }
  
  /* Stack input and button vertically */
  #urlSection .flex.gap-4 {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  #urlSection .flex.gap-4 .relative.flex-1 {
    width: 100%;
  }
  
  #analyzeBtn {
    width: 100%;
    justify-content: center;
    padding: 1rem;
  }
  
  #urlInput {
    padding: 1rem 1rem 1rem 2.75rem;
  }
  
  /* === FORM ELEMENTS === */
  .filter-input {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
  
  /* Stack range inputs vertically */
  .range-inputs {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .range-inputs .filter-input {
    width: 100%;
    text-align: left;
  }
  
  .range-separator {
    text-align: center;
    padding: 0.25rem 0;
  }
  
  /* === SHOW HOVER-DEPENDENT ELEMENTS === */
  .comparison-card .remove-btn {
    opacity: 1;
  }
  
  /* === PROSPECT CARDS === */
  .prospect-card {
    padding: 1rem;
  }
  
  .prospect-card button {
    width: 100%;
    margin-top: 0.5rem;
  }
  
  /* === GENERAL SPACING === */
  .max-w-6xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Reduce header title size */
  #homeHeader h1 {
    font-size: 2.5rem;
  }
  
  /* Reduce vertical padding */
  .py-12 {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
  
  /* Chat spacer adjustment */
  #chatSpacer {
    height: 100px;
  }
  
  /* User menu adjustments */
  #userDropdown {
    right: -0.5rem;
    width: calc(100vw - 2rem);
    max-width: 280px;
  }
  
  #userDropdown a, #userDropdown button {
    padding: 0.875rem 1rem;
  }
  
  /* === ANALYSIS PAGE MOBILE FIXES === */
  
  /* Analysis header breadcrumb - stack vertically */
  #analysisHeader {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  #analysisHeader > div:first-child {
    flex-wrap: wrap;
    width: 100%;
  }
  
  #analysisHeader > div:last-child {
    width: 100%;
    justify-content: flex-start;
  }
  
  /* Make analysis prospect name smaller */
  #analysisProspectName {
    font-size: 1.125rem;
    word-break: break-word;
  }
  
  #analysisProspectUrl {
    word-break: break-all;
    font-size: 0.75rem;
  }
  
  /* === RESULTS SECTION CARDS === */
  #resultsSection .glass-card {
    padding: 1rem;
    border-radius: 1rem;
  }
  
  /* Reduce p-8 to p-4 on results cards */
  #resultsSection .glass-card.p-8,
  #resultsSection .p-8 {
    padding: 1rem;
  }
  
  /* Company overview card - stack header elements */
  #resultsSection > div:first-child .flex.items-start.justify-between {
    flex-direction: column;
    gap: 1rem;
  }
  
  #resultsSection > div:first-child .flex.items-start.justify-between > div:last-child {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  /* Company name and score section */
  #companyName {
    font-size: 1.25rem;
    word-break: break-word;
  }
  
  #opportunityScore {
    font-size: 2rem;
  }
  
  /* Export dropdown - make it full width */
  .export-dropdown {
    width: auto;
  }
  
  .export-dropdown-menu {
    right: 0;
    left: auto;
    min-width: 180px;
  }
  
  /* Section headers - allow wrapping */
  #resultsSection .flex.items-center.justify-between {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  #resultsSection .flex.items-center.justify-between h3 {
    font-size: 1rem;
  }
  
  /* Section header meta badges */
  .section-header-meta {
    flex-wrap: wrap;
  }
  
  /* Grid stats - 2 columns on mobile */
  #resultsSection .grid.grid-cols-2.md\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  /* Two column layout becomes single column */
  #resultsSection .grid.grid-cols-1.lg\:grid-cols-2 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Gaps grid - single column */
  #gapsList {
    grid-template-columns: 1fr;
  }
  
  /* Comparison section */
  #comparisonSection .glass-card {
    padding: 1rem;
  }
  
  #comparisonSection .flex.items-center.justify-between {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  
  .comparison-grid {
    grid-template-columns: 1fr;
  }
  
  /* Comparison floating bar - full width */
  .comparison-floating-bar {
    left: 1rem;
    right: 1rem;
    transform: none;
    bottom: 100px;
  }
  
  .comparison-floating-bar > div {
    width: 100%;
    justify-content: center;
  }
  
  /* Competitor list items */
  #competitorsList > div {
    padding: 0.75rem;
  }
  
  /* Dynamic/Custom sections */
  #customSectionsContainer .glass-card,
  #dynamicSectionsContainer .glass-card {
    padding: 1rem;
  }
  
  /* List items in results */
  #resultsSection ul li {
    padding: 0.625rem;
    font-size: 0.875rem;
  }
  
  /* Recommendation cards */
  #recommendationsList > div {
    padding: 0.75rem;
  }
  
  /* Word break for long URLs and text */
  #resultsSection a,
  #resultsSection p {
    word-break: break-word;
    overflow-wrap: break-word;
  }
  
  /* VS divider */
  .vs-divider {
    padding: 0.25rem 0;
  }
  
  .vs-badge {
    font-size: 0.625rem;
    padding: 0.125rem 0.5rem;
  }
}

/* Tablet-specific adjustments */
@media (min-width: 641px) and (max-width: 1024px) {
  #chatSection {
    padding: 0.5rem 0;
  }
  
  #chatContainer {
    padding: 0.75rem 1.5rem;
  }
}

/* Hover-only styles for devices that support it */
@media (hover: hover) and (pointer: fine) {
  .comparison-card .remove-btn {
    opacity: 0;
  }
  
  .comparison-card:hover .remove-btn {
    opacity: 1;
  }
}

/* ===== PERSONA TOGGLE STYLES ===== */
.persona-toggle-container {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.persona-banker,
.persona-investor {
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}

.persona-banker:hover:not(.persona-active),
.persona-investor:hover:not(.persona-active) {
  background: rgba(255, 255, 255, 0.05);
  color: #e5e7eb;
}

/* Banker persona active state - teal theme */
.persona-banker.persona-active {
  background: rgba(45, 212, 191, 0.15);
  border-color: rgba(45, 212, 191, 0.5);
  color: #2dd4bf;
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.2);
}

/* Investor persona active state - gold/amber theme */
.persona-investor.persona-active {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.5);
  color: #fbbf24;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}

.persona-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #6b7280;
}

.persona-btn:hover:not(.persona-active) {
  background: rgba(255, 255, 255, 0.05);
  color: #e5e7eb;
}

.persona-active {
  background: rgba(45, 212, 191, 0.1);
  border-color: rgba(45, 212, 191, 0.5);
  color: #2dd4bf;
}

/* Investor persona active state - purple theme */
.persona-active.investor-persona {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.5);
  color: #a78bfa;
}

/* Investor-specific filter buttons */
.filter-type-btn.investor-filter:hover {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.2);
}

.filter-type-btn.investor-filter:hover .filter-icon {
  color: #a78bfa;
}

/* Investor filter card variant */
.filter-card.investor-filter-card {
  background: rgba(139, 92, 246, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.filter-card.investor-filter-card.required-filter {
  border-left: 3px solid #a78bfa;
}

.filter-card.investor-filter-card .filter-card-title {
  color: #a78bfa;
}

/* Investor-themed search button */
.investor-search-btn {
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
}

.investor-search-btn:hover {
  background: linear-gradient(135deg, #c4b5fd 0%, #a78bfa 100%);
}

/* Persona badge for leads */
.persona-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.persona-badge-banker {
  background: rgba(45, 212, 191, 0.15);
  color: #2dd4bf;
  border: 1px solid rgba(45, 212, 191, 0.3);
}

.persona-badge-investor {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Purple glow for investor mode */
.purple-glow {
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.15);
}

/* Investor mode styling for search section */
.investor-mode .teal-glow {
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.15);
}

.investor-mode .glass-card.teal-glow {
  border-color: rgba(139, 92, 246, 0.2);
}

/* Tab active for investor mode */
.investor-mode .tab-active {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.5);
  color: #a78bfa;
}

/* Investor mode transitions */
.persona-transition {
  transition: all 0.3s ease;
}

@media (max-width: 640px) {
  .persona-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  .persona-btn svg {
    width: 1rem;
    height: 1rem;
  }
}
