/* System font stack - works offline without Google Fonts */

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}

/* ===== GLOBAL CUSTOM SCROLLBAR ===== */
/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #818cf8, #6366f1);
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #6366f1, #4f46e5);
}

::-webkit-scrollbar-corner {
  background: #f1f5f9;
}

/* Dark mode scrollbar */








/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #6366f1 #f1f5f9;
}



/* Thin scrollbar variant for nested containers */
.scrollbar-thin::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.5);
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.8);
}

/* ===== CUSTOM RADIO BUTTONS ===== */
.custom-radio {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.custom-radio:hover {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.custom-radio:checked {
  border-color: #6366f1;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.custom-radio:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
}

.custom-radio:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* Dark mode radio */






/* ===== CUSTOM CHECKBOXES ===== */
.custom-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.custom-checkbox:hover {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.custom-checkbox:checked {
  border-color: #6366f1;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.custom-checkbox:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.custom-checkbox:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* Dark mode checkbox */






/* Tab Button Animations */
.tab-link {
  position: relative;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.tab-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: transparent;
  transition: background-color 0.3s ease, transform 0.3s ease;
  transform: scaleX(0);
  transform-origin: center;
}

.tab-link.active-tab::after {
  background-color: #4f46e5;
  transform: scaleX(1);
}

/* Tab Content Transitions */
.tab-content {
  transition: opacity 0.3s ease-in-out;
}

/* Stats Card Animations */
.stat-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border-color: #6366f1;
}

.stat-card:hover .stat-number {
  transform: scale(1.05);
  color: #4f46e5;
}

.stat-number {
  transition: all 0.3s ease;
}

/* Sidebar Filters - Fixed Full Height */
.filter-sidebar {
  position: fixed;
  top: 80px;
  left: 16px;
  width: 280px;
  height: calc(100vh - 96px);
  overflow-y: auto;
  scrollbar-width: thin;
  z-index: 40;
}

.filter-sidebar::-webkit-scrollbar {
  width: 4px;
}

.filter-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.filter-sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(99, 102, 241, 0.3);
  border-radius: 4px;
}

.filter-sidebar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(99, 102, 241, 0.5);
}

/* Tab content layout with sidebar */
.tab-layout-with-sidebar {
  display: flex;
  gap: 1.5rem;
}

/* Placeholder for fixed sidebar space */
.tab-layout-with-sidebar>aside {
  width: 280px;
  flex-shrink: 0;
}

/* Main content area */
.tab-layout-with-sidebar>.flex-1 {
  flex: 1;
  min-width: 0;
}

/* Chat Widget Animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  animation: slideUp 0.3s ease-out forwards;
}

@keyframes slideDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

.animate-slide-down {
  animation: slideDown 0.2s ease-in forwards;
}

/* Modal Styles */
.modal {
  display: none;
  /* Hidden by default */
  background: transparent;
  position: fixed;
  inset: 0;
  z-index: 50;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
  /* Show when .show is added */
}

.modal-content-fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  border-radius: 0;
}

/* Modal Tabs */
.modal-tab-content {
  display: none;
}

.modal-tab-content.active {
  display: block;
}

.modal-tab-link.active {
  color: #4f46e5;
  /* indigo-600 */
  border-bottom-color: #4f46e5;
  /* indigo-600 */
  font-weight: 600;
}

/* Heatmap Styles */
.region-map {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .region-map {
    grid-template-columns: repeat(2, 1fr);
  }
}

.region-cell {
  padding: 1.5rem 1rem;
  border-radius: 0.75rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.region-cell:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.region-green {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.region-yellow {
  background-color: #fefce8;
  border: 1px solid #fef08a;
  color: #854d0e;
}

.region-orange {
  background-color: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.region-red {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Source Tags */
.source-tag {
  transition: all 0.2s ease;
}

.source-tag-active {
  background-color: #4f46e5 !important;
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.chart-container-modal {
  position: relative;
  height: 250px;
  width: 100%;
  margin: 1rem auto;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: #a0aec0;
  border-radius: 20px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.chat-chart-container {
  position: relative;
  height: 250px;
  width: 100%;
  max-width: 600px;
  margin: 1rem auto;
  padding: 1rem;
  background-color: #f7fafc;
  border-radius: 0.5rem;
}

/* Report Cards */
.report-card {
  transition: all 0.2s ease-in-out;
}

.report-card:hover {
  transform: translateY(-2px);
}

/* Line Clamp for text overflow */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Notification Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Full screen tab content (breaking out of parent padding) */
.tab-full-screen {
  margin: -1.5rem;
  /* p-6 compensation */
  width: calc(100% + 3rem);
  height: calc(100vh - 64px);
  /* Approximate header height compensation */
}

@media (min-width: 768px) {
  .tab-full-screen {
    margin: -2.5rem;
    /* md:p-10 compensation */
    width: calc(100% + 5rem);
  }
}

/* Text Regeneration Animation */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.text-regenerating {
  background: linear-gradient(90deg,
      rgba(99, 102, 241, 0.1) 0%,
      rgba(99, 102, 241, 0.3) 25%,
      rgba(139, 92, 246, 0.4) 50%,
      rgba(99, 102, 241, 0.3) 75%,
      rgba(99, 102, 241, 0.1) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 4px;
  padding: 2px 4px;
  display: inline;
}

@keyframes pulse-text {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.text-pulse {
  animation: pulse-text 1s infinite;
}