:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --color-bg: #ffffff;
  --color-text: #111111;
  --color-text-muted: #666666;
  --color-primary: #0052FF;
  /* Electric Blue */
  --color-primary-hover: #0040CC;
  --color-border: #eaeaea;
  --color-bg-subtle: #f9f9f9;

  --spacing-unit: 1rem;
  --container-width: 800px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--spacing-unit);
}

/* Admin container - wider for admin pages */
.container-admin {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-unit);
}


/* Typography */
h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  line-height: 1.1;
}

p {
  margin-bottom: 1rem;
  color: var(--color-text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.1);
}

/* Utilities */
.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 2rem;
}

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

.flex {
  display: flex;
}

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

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 0.5rem;
}

/* Header */
.site-header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: 3rem;
}

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

.header-left {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color 0.2s;
  padding: 0.5rem 0;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: 2px;
}

.header-right {
  display: flex;
  align-items: center;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.user-email {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-weight: 500;
  gap: 0.5rem;
  padding-left: 1rem;
}

.admin-actions {
  display: flex;
  gap: 0.5rem;
  margin-right: 0.5rem;
  padding-left: 1rem;
  border-left: 1px solid var(--color-border);
}

.btn-xs {
  padding: 0.4rem 0.8rem;
  font-size: 0.8125rem;
  height: 32px;
}

.btn-admin {
  background-color: #dc3545;
  color: white;
}

.btn-admin:hover {
  background-color: #bb2d3b;
}

.btn-admin-dark {
  background-color: #6610f2;
  color: white;
}

.btn-admin-dark:hover {
  background-color: #520dc2;
}

.btn-secondary {
  background-color: white;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-bg-subtle);
  border-color: #d0d0d0;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text);
  text-decoration: none;
}

/* Google Sign-In Button */
.btn-google {
  background: white;
  color: #444;
  border: 1px solid #ddd;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-google:hover {
  background: #f8f8f8;
  border-color: #ccc;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-google svg {
  flex-shrink: 0;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: auto;
  z-index: 101;
}

@media (min-width: 769px) {
  .mobile-menu-toggle {
    display: none;
  }
}

.mobile-menu-toggle svg {
  width: 24px;
  height: 24px;
  stroke: var(--color-text);
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 320px;
  height: 100vh;
  background: white;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

@media (min-width: 769px) {
  .mobile-nav-drawer {
    display: none;
  }
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

.mobile-nav-content {
  padding: 1.5rem;
  padding-top: 4rem;
}

.mobile-nav-drawer .nav-link {
  display: block;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 1rem;
}

.mobile-nav-drawer .nav-link.active::after {
  display: none;
}

.mobile-nav-drawer .user-email {
  display: block;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0.5rem;
}

.mobile-nav-drawer .btn {
  width: 100%;
  margin-top: 0.5rem;
}

.mobile-nav-drawer .admin-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 0;
  margin: 0;
  border: none;
  border-bottom: 1px solid var(--color-border);
}

.mobile-nav-drawer .admin-actions .btn {
  width: 100%;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

@media (min-width: 769px) {
  .mobile-menu-overlay {
    display: none;
  }
}

.mobile-menu-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .site-header {
    padding: 0.75rem 0;
    margin-bottom: 2rem;
  }

  .header-left {
    gap: 1rem;
    flex: 1;
  }

  .logo span {
    font-size: 1rem;
  }

  /* Hide desktop navigation on mobile for logged-in users */
  .main-nav {
    display: none;
  }

  /* Hide user email and profile link on mobile */
  .user-menu .user-email,
  .user-menu .nav-link {
    display: none;
  }

  /* Hide admin actions on mobile (they'll be in the drawer) */
  .user-menu .admin-actions {
    display: none;
  }

  /* Hide logout button on mobile (it'll be in the drawer) */
  .user-menu .btn-secondary {
    display: none;
  }

  /* Keep login button visible for unlogged users */
  .header-right .btn-primary {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
  .header-left {
    gap: 1.5rem;
  }

  .user-email {
    display: none;
  }

  .admin-actions {
    padding-left: 0.5rem;
  }
}


/* Cards */
.card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.card-meta {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  display: flex;
  gap: 1rem;
}

.tag {
  display: inline-block;
  padding: 0.25em 0.5em;
  font-size: 0.75em;
  font-weight: 600;
  border-radius: 4px;
  background-color: var(--color-bg-subtle);
  color: var(--color-text-muted);
  text-transform: uppercase;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.6;
  }
}

/* AI Summary Formatting */
.ai-summary p {
  margin-bottom: 0.5rem;
}

.ai-summary p:last-child {
  margin-bottom: 0;
}

/* Analysis Badges - Professional Palette */
.analysis-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
  margin-top: 0.5rem;
}

/* Base Badge Styles */
.badge {
  display: inline-block;
  padding: 0.4em 0.75em;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 6px;
  border: 1px solid;
  transition: all 0.2s ease;
  cursor: default;
  letter-spacing: 0.02em;
}

.badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Category Badge - Professional Blue-Gray */
.badge-category {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

.badge-category:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
}

/* Sentiment Badges - Subtle Professional Colors */
.badge-sentiment-positive {
  background-color: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.badge-sentiment-positive:hover {
  background-color: #dcfce7;
  border-color: #4ade80;
}

.badge-sentiment-negative {
  background-color: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.badge-sentiment-negative:hover {
  background-color: #fee2e2;
  border-color: #f87171;
}

.badge-sentiment-neutral {
  background-color: #f9fafb;
  border-color: #d1d5db;
  color: #4b5563;
}

.badge-sentiment-neutral:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

/* Shareholder Impact Badges - Warm Tones */
.badge-shareholder-high {
  background-color: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
  font-weight: 600;
}

.badge-shareholder-high:hover {
  background-color: #fde68a;
  border-color: #fbbf24;
}

.badge-shareholder-medium {
  background-color: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}

.badge-shareholder-medium:hover {
  background-color: #ffedd5;
  border-color: #fb923c;
}

.badge-shareholder-low {
  background-color: #f0f9ff;
  border-color: #7dd3fc;
  color: #075985;
}

.badge-shareholder-low:hover {
  background-color: #e0f2fe;
  border-color: #38bdf8;
}

/* Stock Price Impact Badges - Cool Tones */
.badge-stock-high {
  background-color: #fae8ff;
  border-color: #e9d5ff;
  color: #6b21a8;
  font-weight: 600;
}

.badge-stock-high:hover {
  background-color: #f3e8ff;
  border-color: #d8b4fe;
}

.badge-stock-medium {
  background-color: #f0fdfa;
  border-color: #5eead4;
  color: #115e59;
}

.badge-stock-medium:hover {
  background-color: #ccfbf1;
  border-color: #2dd4bf;
}

.badge-stock-low {
  background-color: #eff6ff;
  border-color: #93c5fd;
  color: #1e40af;
}

.badge-stock-low:hover {
  background-color: #dbeafe;
  border-color: #60a5fa;
}

/* Custom Tooltips */
.tooltip-content {
  position: absolute;
  z-index: 9999;
  background-color: #1e293b;
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 300px;
  word-wrap: break-word;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2),
    0 6px 10px rgba(0, 0, 0, 0.15);
}

/* Arrow pointing DOWN (tooltip is above the element) */
.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
}

.tooltip-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Tooltip positioning variants */
/* Arrow pointing UP (tooltip is below the element) */
.tooltip-content[data-position="bottom"]::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: #1e293b;
}

/* Arrow pointing RIGHT (tooltip is to the left) */
.tooltip-content[data-position="left"]::after {
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-left-color: #1e293b;
}

/* Arrow pointing LEFT (tooltip is to the right) */
.tooltip-content[data-position="right"]::after {
  top: 50%;
  left: auto;
  right: 100%;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-right-color: #1e293b;
}

/* Badge Base Styles */
.badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  text-transform: capitalize;
  white-space: nowrap;
}

/* Category Badge */
.badge-category {
  background-color: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
}

/* Sentiment Badges */
.badge-positive {
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #81c784;
}

.badge-negative {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

.badge-neutral {
  background-color: #f5f5f5;
  color: #616161;
  border: 1px solid #bdbdbd;
}

/* Impact Level Badges */
.badge-impact-high {
  background-color: #fff3e0;
  color: #e65100;
  border: 1px solid #ffb74d;
  font-weight: 700;
}

.badge-impact-medium {
  background-color: #fff9c4;
  color: #f57f17;
  border: 1px solid #fdd835;
}

.badge-impact-low {
  background-color: #f1f8e9;
  color: #558b2f;
  border: 1px solid #aed581;
}

/* AI Status Badges (existing, ensure consistency) */
.badge-pending {
  background-color: #fff9c4;
  color: #f57f17;
  border: 1px solid #fdd835;
}

.badge-processing {
  background-color: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
  animation: pulse 2s infinite;
}

.badge-failed {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

/* Landing Page Specific Styles */

/* Hero Section */
.hero-section {
  padding: 6rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #111111 0%, #444444 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 4rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
  border-radius: var(--radius-md);
}

/* Carousel Component */
.carousel-container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  background: #fff;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Firefox */
}

.carousel-track::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  position: relative;
}

.carousel-image {
  width: 100%;
  height: auto;
  display: block;
}

/* Carousel Indicators */
.carousel-indicators {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.5rem 0.75rem;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

.indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
}

.indicator.active {
  background: #fff;
  transform: scale(1.2);
}

/* Features Section */
.features-section {
  padding: 5rem 0;
  background-color: var(--color-bg-subtle);
  margin-top: 4rem;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 3rem;
  font-weight: 700;
}

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

.feature-card {
  background: white;
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.05);
  border-color: var(--color-primary);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background-color: #eff6ff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--color-primary);
  font-size: 1.5rem;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.feature-description {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}



/* Pagination Styles */
.pagination-container a:hover,
.per-page-btn:hover {
  background-color: var(--color-bg-subtle) !important;
  border-color: var(--color-primary) !important;
  color: var(--color-primary) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pagination-container a.active,
.per-page-btn.active:hover {
  background: var(--color-primary) !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 82, 255, 0.2);
}

/* Trust Section */
.trust-section {
  padding: 4rem 0;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.trust-text {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
}

/* Flash Messages */
.flash-messages {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1000;
  max-width: 500px;
  width: 100%;
}

.flash-message {
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.3s ease-out;
  overflow: hidden;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

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

.flash-content {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 12px;
  background: white;
}

.flash-notice .flash-content {
  border-left: 4px solid #10b981;
}

.flash-alert .flash-content,
.flash-error .flash-content {
  border-left: 4px solid #ef4444;
}

.flash-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
}

.flash-notice .flash-icon {
  color: #10b981;
}

.flash-alert .flash-icon,
.flash-error .flash-icon {
  color: #ef4444;
}

.flash-text {
  flex: 1;
  color: var(--color-text);
  font-size: 0.875rem;
  line-height: 1.4;
}

.flash-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.flash-close:hover {
  color: var(--color-text);
}

@media (max-width: 640px) {
  .flash-messages {
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(100%);
    opacity: 0;
  }
}
