/* Oversearch AI MVP-1 Styles */

/* Import global style guide */
@import url("/assets/style_guide-b66d8dac.css");
/* CSS Custom Properties */
:root {
  --sidebar-width-expanded: 310px;
  --sidebar-width-collapsed: 72px;
  --sidebar-bg: #FFFFFF;
  --sidebar-border: #E5E7EB;
  --sidebar-hover-bg: #F3F4F6;
  --sidebar-active-bg: #EEF2FF;
  --sidebar-active-accent: #6366F1;
  --icon-inactive: #9CA3AF;
  --icon-active: #6366F1;
  --text-inactive: #4B5563;
  --text-active: #111827;
  --brand-purple: #667EEA;
  --brand-blue: #5F83FF;
  --focus-ring: #6366F1;
  --backdrop-overlay: rgba(0, 0, 0, 0.4);
  --transition-speed: 300ms;
  
  /* Button System Tokens */
  --btn-primary-bg: #6366F1;
  --btn-primary-bg-hover: #4F46E5;
  --btn-primary-bg-active: #4338CA;
  --btn-primary-text: #FFFFFF;
  --btn-secondary-border: #D1D5DB;
  --btn-secondary-border-hover: #9CA3AF;
  --btn-secondary-text: #374151;
  --btn-secondary-bg-hover: #F9FAFB;
  --btn-secondary-bg-active: #F3F4F6;
  --btn-tertiary-text: #6366F1;
  --btn-tertiary-text-hover: #4F46E5;
  --btn-tertiary-bg-hover: #EEF2FF;
  --btn-tertiary-bg-active: #E0E7FF;
  --btn-disabled-bg: #E5E7EB;
  --btn-disabled-text: #9CA3AF;
  --btn-disabled-border: #E5E7EB;
  --btn-danger-bg: #DC2626;
  --btn-danger-bg-hover: #B91C1C;
  --btn-success-bg: #10B981;
  --btn-success-bg-hover: #059669;
  --btn-warning-bg: #F59E0B;
  --btn-warning-bg-hover: #D97706;
  --btn-radius: 6px;
  --btn-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Breadcrumb Tokens */
  --breadcrumb-text: #6B7280;
  --breadcrumb-text-active: #111827;
  --breadcrumb-link-hover: #4F46E5;
  --breadcrumb-separator: #D1D5DB;
  
  /* Top Header Tokens */
  --header-height: 100px;
  --header-bg: #FFFFFF;
  --header-border: #E5E7EB;
  --header-shadow: 0 1px 3px rgba(0,0,0,0.08);
  --header-padding: 16px 24px;
  --header-logo-max-width: 180px;
  --header-title-size: 24px;
  --header-title-color: #111827;
}

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

html {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
  letter-spacing: -0.005em;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Safari-specific: Prevent rubber-band scroll */
@supports (-webkit-touch-callout: none) {
  body {
    overscroll-behavior-y: none;
  }
}

/* ===================================
   SIDEBAR NAVIGATION
   =================================== */

.sidebar {
  position: fixed !important;
  left: 0;
  top: 0;
  bottom: 0;
  width: 310px;
  height: 100vh;
  background-color: #FFFFFF;
  border-right: 1px solid #E5E7EB;
  display: flex;
  flex-direction: column;
  transition: width var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  will-change: width;
  overscroll-behavior: contain;
}

.sidebar[data-collapsed="true"] {
  width: var(--sidebar-width-collapsed);
  width: 72px;
}

/* Sidebar Header - Logo Area */
.sidebar-header {
  z-index: 1010;
  height: 80px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  flex-shrink: 0;
  background-color: var(--sidebar-bg);
  position: relative;
}

/* Sidebar logo: never show underline or any "divider-like" decoration */
.sidebar-logo,
.sidebar-logo:link,
.sidebar-logo:visited,
.sidebar-logo:hover,
.sidebar-logo:active,
.sidebar-logo:focus {
  text-decoration: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  background-image: none !important;
}

/* Make sure the logo behaves like a block element (prevents weird inline underline behavior) */
.sidebar-logo {
  z-index: 11;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s;
  width: 100%;
  height: 100%;
  line-height: 0;
}

.sidebar-logo svg {
  display: block;
}

/* Keep link styling for nav items, but exclude the logo */
.sidebar a:not(.sidebar-logo):not(.sidebar-logo-icon) {
  /* whatever link styling you want */
}

.sidebar-logo:hover {
  opacity: 0.8;
}

/* Base: expanded (default) shows full logo, hides icon */
.sidebar .sidebar-logo-full { 
  display: block; 
  width: 100%;
  max-width: 220px;
  height: auto;
  transition: opacity var(--transition-speed) ease-in-out;
  vertical-align: middle;
  overflow: visible;
  /* Safari-specific rendering fixes */
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  will-change: opacity;
}
.sidebar .sidebar-logo-icon { 
  display: none; 
  width: 44px;
  height: 44px;
  overflow: visible;
  /* Safari-specific rendering fixes */
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Collapsed: show icon only, hide full logo */
.sidebar[data-collapsed="true"] .sidebar-logo-full { 
  display: none !important; 
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
}
.sidebar[data-collapsed="true"] .sidebar-logo-icon { 
  display: block !important; 
}

/* Extra safety: never show the icon variant when expanded */
.sidebar[data-collapsed="false"] .sidebar-header .sidebar-logo-icon { 
  display: none !important; 
}
.sidebar[data-collapsed="false"] .sidebar-header .sidebar-logo-full { 
  display: block !important; 
}

.sidebar[data-collapsed="true"] .sidebar-logo-icon {
  display: block;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 0;
  border-top: 1px solid var(--sidebar-border);
}

.nav-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  margin: 0;
  padding: 0 12px;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text-inactive);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  border-radius: 8px;
  transition: all 200ms ease;
  position: relative;
  white-space: nowrap;
  box-shadow: none;
}

.nav-item a:hover {
  background-color: var(--sidebar-hover-bg);
  color: var(--text-active);
}

.nav-item a:hover .nav-icon {
  color: var(--icon-active);
  transform: scale(1.05);
}

/* Active Navigation Item */
.nav-item.active a {
  background-color: var(--sidebar-active-bg);
  color: var(--text-active);
  font-weight: 600;
}

.nav-item.active a::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--sidebar-active-accent);
  border-radius: 0 4px 4px 0;
}

.nav-item.active .nav-icon {
  color: var(--icon-active);
}

/* Navigation Icon */
.nav-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--icon-inactive);
  transition: all 200ms ease-out;
}

/* Navigation Text */
.nav-text {
  transition: opacity var(--transition-speed) ease-in-out;
  overflow: hidden;
}

.sidebar[data-collapsed="true"] .nav-text {
  opacity: 0;
  width: 0;
}

/* Make tooltip an actual tooltip (so it doesn't affect layout) */
.sidebar .nav-item { 
  position: relative; 
}

.sidebar .nav-tooltip {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  margin-left: 10px;
  pointer-events: none;
  z-index: 9999;
  background-color: #1F2937;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 200ms ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.sidebar[data-collapsed="true"] .nav-item:hover .nav-tooltip,
.sidebar[data-collapsed="true"] .nav-item:focus-within .nav-tooltip {
  opacity: 1;
}

/* Sidebar Footer - Toggle Button */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-toggle {
  width: 100%;
  padding: 10px;
  background: none;
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--icon-inactive);
  transition: all 200ms ease;
}

.sidebar-toggle:hover {
  background-color: var(--sidebar-hover-bg);
  border-color: var(--icon-active);
  color: var(--icon-active);
}

.sidebar-toggle:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.main-content {
  margin-left: 310px;
  transition: margin-left var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 100vh;
  padding: 0;
  width: calc(100% - 310px);
  position: relative;
}

/* Safari-specific: Force content to start at viewport top */
@supports (-webkit-touch-callout: none) {
  .main-content {
    padding-top: 0;
    margin-top: 0;
  }
}

/* Adaptive top offset for Safari header positioning */
:root {
  --safari-top-offset: 0px;
}

.main-content {
  padding-top: var(--safari-top-offset);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 20px 3rem 20px;
  width: 100%;
}

/* Safari-specific: Ensure container starts at top */
@supports (-webkit-touch-callout: none) {
  .container {
    transform: translateZ(0);
    padding-top: 2rem;
    margin-top: 0;
  }
}

.sidebar[data-collapsed="true"] ~ .main-content {
  margin-left: 72px;
  width: calc(100% - 72px);
}

/* Mobile Menu Button */
.mobile-menu-button {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1001;
  padding: 8px;
  background-color: var(--sidebar-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-inactive);
  transition: all 200ms ease;
}

.mobile-menu-button:hover {
  background-color: var(--sidebar-hover-bg);
  color: var(--icon-active);
}

/* Mobile Backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--backdrop-overlay);
  z-index: 999;
  opacity: 0;
  transition: opacity 200ms ease;
}

.sidebar-backdrop.active {
  opacity: 1;
}

/* Focus Indicators for Accessibility */
.nav-item a:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.sidebar-logo:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Responsive Breakpoints */
@media (max-width: 1023px) {
  .sidebar {
    width: var(--sidebar-width-collapsed);
  }
  
  .sidebar .nav-text,
  .sidebar .sidebar-logo-text {
    opacity: 0;
    width: 0;
  }
  
  .sidebar .sidebar-logo-compact {
    display: block;
  }
}

@media (max-width: 767px) {
  /* Mobile: Hide sidebar by default */
  .sidebar {
    left: -280px;
    width: 280px;
    transition: left var(--transition-speed) ease-out;
  }
  
  .sidebar[data-mobile-open="true"] {
    left: 0;
  }
  
  .sidebar[data-mobile-open="true"] .nav-text,
  .sidebar[data-mobile-open="true"] .sidebar-logo-text {
    opacity: 1;
    width: auto;
  }
  
  .sidebar[data-mobile-open="true"] .sidebar-logo-compact {
    display: none;
  }
  
  /* Show mobile menu button */
  .mobile-menu-button {
    display: block;
  }
  
  /* Show backdrop when menu is open */
  .sidebar[data-mobile-open="true"] ~ .sidebar-backdrop {
    display: block;
  }
  
  /* Main content doesn't adjust on mobile */
  .main-content {
    margin-left: 0;
  }
  
  .sidebar[data-collapsed="true"] ~ .main-content {
    margin-left: 0;
  }
}

/* ===================================
   END SIDEBAR NAVIGATION
   =================================== */

/* Navigation Section Labels */
.nav-section-label {
  padding: 16px 24px 8px 24px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #9CA3AF;
  margin-top: 16px;
  border-bottom: none;
}

.nav-section-label:first-child {
  margin-top: 0;
}

/* Base: nav text visible, tooltips hidden (tooltips are for collapsed mode) */
.sidebar .nav-text { display: inline; }
.sidebar .nav-tooltip { display: none; }
.sidebar .nav-section-label { display: block; }

/* Collapsed: hide every text element by default */
.sidebar[data-collapsed="true"] .nav-text,
.sidebar[data-collapsed="true"] .nav-section-label,
.sidebar[data-collapsed="true"] .nav-tooltip {
  display: none !important;
}

/* Collapsed: show tooltip only when user hovers/focuses the icon */
.sidebar[data-collapsed="true"] .nav-item:hover .nav-tooltip,
.sidebar[data-collapsed="true"] .nav-item:focus-within .nav-tooltip {
  display: block !important;
}

/* Ensure collapsed width doesn't clip hidden text into "artifacts" */
.sidebar[data-collapsed="true"] .nav-item a {
  justify-content: center; /* icons centered */
}

/* Expanded mode: tooltips never show */
.sidebar[data-collapsed="false"] .nav-tooltip {
  display: none !important;
}

/* Disabled Navigation Items */
.nav-item.disabled {
  pointer-events: none;
}

.nav-link-disabled {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: #D1D5DB;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  border-radius: 8px;
  position: relative;
  white-space: nowrap;
  cursor: not-allowed;
}

.nav-link-disabled .nav-icon {
  color: #D1D5DB;
}

/* Legacy Navigation - Deprecated (Replaced by Sidebar) */
.navbar {
  display: none;
}

.navbar .container {
  display: none;
}

.nav-brand .brand-link {
  display: none;
}

.nav-links {
  display: none;
}

.nav-links a {
  display: none;
}

.nav-links a:hover {
  display: none;
}

/* Alerts */
.alert {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
}

.alert-success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.alert-danger {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

/* Headings - Modern Typography Scale */
h1 {
  font-size: 2rem;  /* 32px */
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  margin-top: 0;
  padding-top: 0;
}

h2 {
  font-size: 1.5rem;  /* 24px */
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  margin-top: 2rem;
}

h3 {
  font-size: 1.25rem;  /* 20px */
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.005em;
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
}

p, .body-text {
  font-size: 1rem;  /* 16px */
  font-weight: 400;
  line-height: 1.6;
}

.small-text {
  font-size: 0.875rem;  /* 14px */
  line-height: 1.5;
}

/* ===================================
   BUTTON SYSTEM - Standardized
   =================================== */

/* Base Button */
.btn {
  display: inline-block;
  font-family: inherit;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  line-height: 1.4;
  letter-spacing: -0.01em;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: all var(--btn-transition);
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  /* Default to medium secondary */
  padding: 10px 20px;
  font-size: 15px;
  min-width: 80px;
  background-color: transparent;
  border: 1px solid var(--btn-secondary-border);
  color: var(--btn-secondary-text);
}

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

.btn:active {
  background-color: var(--btn-secondary-bg-active);
  transform: translateY(0);
}

.btn:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.btn:disabled,
.btn[disabled] {
  background-color: var(--btn-disabled-bg);
  border-color: var(--btn-disabled-border);
  color: var(--btn-disabled-text);
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

/* Button Type Variants */
.btn-primary {
  background-color: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--btn-primary-bg-hover);
  border-color: var(--btn-primary-bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-primary:active {
  background-color: var(--btn-primary-bg-active);
  border-color: var(--btn-primary-bg-active);
  transform: translateY(0);
  box-shadow: none;
}

.btn-primary:disabled,
.btn-primary[disabled] {
  background-color: var(--btn-disabled-bg);
  border-color: var(--btn-disabled-bg);
  color: var(--btn-disabled-text);
  box-shadow: none;
}

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

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

.btn-secondary:active {
  background-color: var(--btn-secondary-bg-active);
}

.btn-secondary:disabled,
.btn-secondary[disabled] {
  border-color: var(--btn-disabled-border);
  color: var(--btn-disabled-text);
  background-color: transparent;
}

.btn-tertiary {
  background-color: transparent;
  border: none;
  color: var(--btn-tertiary-text);
  min-width: auto;
}

.btn-tertiary:hover {
  background-color: var(--btn-tertiary-bg-hover);
  color: var(--btn-tertiary-text-hover);
  border: none;
}

.btn-tertiary:active {
  background-color: var(--btn-tertiary-bg-active);
}

.btn-tertiary:disabled,
.btn-tertiary[disabled] {
  background-color: transparent;
  color: var(--btn-disabled-text);
  border: none;
}

/* Button Color Variants */
.btn-danger {
  background-color: var(--btn-danger-bg);
  border-color: var(--btn-danger-bg);
  color: #FFFFFF;
  font-weight: 600;
}

.btn-danger:hover {
  background-color: var(--btn-danger-bg-hover);
  border-color: var(--btn-danger-bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.btn-danger:active {
  background-color: #991B1B;
  border-color: #991B1B;
  transform: translateY(0);
  box-shadow: none;
}

.btn-success {
  background-color: var(--btn-success-bg);
  border-color: var(--btn-success-bg);
  color: #FFFFFF;
  font-weight: 600;
}

.btn-success:hover {
  background-color: var(--btn-success-bg-hover);
  border-color: var(--btn-success-bg-hover);
}

.btn-warning {
  background-color: var(--btn-warning-bg);
  border-color: var(--btn-warning-bg);
  color: #FFFFFF;
  font-weight: 600;
}

.btn-warning:hover {
  background-color: var(--btn-warning-bg-hover);
  border-color: var(--btn-warning-bg-hover);
}

/* Button Size Variants */
.btn-sm {
  padding: 6px 12px;
  font-size: 14px;
  line-height: 20px;
  min-width: 60px;
}

.btn-md {
  padding: 10px 20px;
  font-size: 15px;
  line-height: 22px;
  min-width: 80px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
  line-height: 24px;
  min-width: 120px;
}

/* Legacy Size Class Aliases (Deprecated - for backward compatibility) */
.btn-small {
  padding: 6px 12px;
  font-size: 14px;
  line-height: 20px;
  min-width: 60px;
}

.btn-large {
  padding: 12px 24px;
  font-size: 16px;
  line-height: 24px;
  min-width: 120px;
}

/* Button Groups */
.btn-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-group-compact {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-group-prominent {
  display: flex;
  gap: 16px;
  align-items: center;
}

.btn-group-vertical {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Utility Classes */
.btn-full-width {
  width: 100%;
  display: block;
}

/* Responsive Button Behavior */
@media (max-width: 767px) {
  .btn-lg {
    width: 100%;
  }
  
  .btn-group-vertical .btn {
    width: 100%;
  }
}

/* Blog Styles */
.blog-header {
  margin-bottom: 2rem;
}

.blog-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}

.blog-subtext {
  color: #6B7280;
  font-size: 1.125rem;
}

.blog-search-container {
  margin-bottom: 2rem;
}

.blog-search-form {
  display: flex;
  gap: 0.5rem;
}

.blog-search-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 1rem;
}

.blog-search-button {
  padding: 0.75rem 1.5rem;
  background-color: #6366F1;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
}

.blog-search-button:hover {
  background-color: #4F46E5;
}

.blog-posts-container {
  margin-bottom: 2rem;
}

.blog-post-card {
  padding: 1.5rem;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  margin-bottom: 1rem;
  background-color: white;
}

.blog-post-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.blog-post-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.blog-post-title a {
  color: #111827;
  text-decoration: none;
}

.blog-post-title a:hover {
  color: #6366F1;
}

.blog-post-date {
  color: #6B7280;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.blog-post-excerpt {
  color: #6B7280;
  margin-bottom: 1rem;
}

.blog-post-tags {
  display: flex;
  gap: 0.5rem;
}

.blog-tag {
  background-color: #EEF2FF;
  color: #6366F1;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.blog-empty-state {
  text-align: center;
  padding: 3rem;
  color: #6B7280;
}

.blog-back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: #6366F1;
  text-decoration: none;
  font-weight: 500;
}

.blog-back-link:hover {
  text-decoration: underline;
}

.blog-breadcrumb {
  margin-bottom: 1rem;
  color: #6B7280;
  font-size: 0.875rem;
}

.blog-breadcrumb a {
  color: #6366F1;
  text-decoration: none;
}

.blog-breadcrumb a:hover {
  text-decoration: underline;
}

.blog-post-header {
  margin-bottom: 2rem;
}

.blog-post-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}

.blog-post-content {
  max-width: 700px;
  margin-bottom: 2rem;
}

.blog-post-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2rem 0 1rem 0;
  color: #111827;
}

.blog-post-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem 0;
  color: #111827;
}

.blog-post-content p {
  margin-bottom: 1rem;
  line-height: 1.7;
  color: #374151;
}

.blog-post-content ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.blog-post-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.blog-post-content strong {
  font-weight: 600;
}

.blog-post-content em {
  font-style: italic;
}

/* Tables */
.table {
  width: 100%;
  background-color: white;
  border-collapse: collapse;
  margin-top: 1rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #E5E7EB;
}

/* Standardize all table cell values */
.table td {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

/* Ensure links in table cells match the cell styling */
.table td a {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

/* Prevent strong/bold tags from changing font size in tables */
.table td strong,
.table td b {
  font-size: inherit;
  line-height: inherit;
}

/* Ensure all spans in table cells have consistent sizing */
.table td span {
  font-size: inherit;
  line-height: inherit;
}

.table th {
  background-color: #F9FAFB;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6B7280;
}

.table tbody tr {
  transition: background-color 150ms ease;
}

.table tbody tr:hover {
  background-color: #F9FAFB;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Table Action Buttons */
.table td .btn-group-compact {
  display: inline-flex;
  gap: 8px;
}

/* Ensure small buttons in tables are properly sized */
.table .btn-sm {
  padding: 4px 10px;
  font-size: 13px;
  min-width: 50px;
}

/* Metric Value Styling for Projects Index */
.table .metric-value {
  font-weight: 400 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  display: inline !important;
  font-size: 16px !important;
  line-height: 1.5 !important;
  background-color: transparent !important;
}

.table .metric-high,
.table .metric-medium,
.table .metric-low {
  color: inherit !important;
  background-color: transparent !important;
}

.table .metric-na {
  color: #9CA3AF !important;
  font-style: italic;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  background-color: transparent !important;
  padding: 0 !important;
  display: inline !important;
}

/* ===================================
   BREADCRUMB NAVIGATION
   =================================== */

.breadcrumbs {
  z-index: 5;
  margin-bottom: 1.5rem;
  margin-top: 0;
  padding: 0;
  width: 100%;
}

/* ===================================
   PROJECT TABS
   =================================== */

.project-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #E5E7EB;
  margin-bottom: 1.5rem;
  margin-top: 1.5rem;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  font-size: 15px;
  color: #6B7280;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 200ms ease;
  position: relative;
  white-space: nowrap;
}

.tab-btn:hover {
  color: #374151;
  background-color: #F9FAFB;
}

.tab-btn.active {
  color: #6366F1;
  font-weight: 600;
  border-bottom: 2px solid #6366F1;
}

.tab-btn:focus {
  outline: 2px solid #6366F1;
  outline-offset: -2px;
}

.tab-content {
  /* Content containers controlled by JavaScript display toggling */
}

/* ===================================
   END PROJECT TABS
   =================================== */

/* Chart containers - Fixed height to prevent resize loops */
.chart-box {
  position: relative;
  width: 100%;
  height: 420px; /* pick something sane */
}

.chart-box--small {
  height: 260px;
}

/* Important: make canvas fill the box without affecting layout */
.chart-box canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Analytics Insights Chart Containers */
.analytics-charts {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.analytics-charts .chart-box {
  min-height: 260px;
  height: 300px;
}

/* Ensure canvas containers have explicit dimensions */
.position-chart-container,
.share-chart-container {
  position: relative;
  width: 100%;
  min-height: 250px;
  height: 280px;
}

.position-chart-container canvas,
.share-chart-container canvas {
  width: 100% !important;
  height: 100% !important;
  min-height: 250px;
}

.breadcrumb-list {
  z-index: 6;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0.5rem;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: var(--breadcrumb-text);
}

.breadcrumb-item a {
  color: var(--breadcrumb-text);
  text-decoration: none;
  transition: color 150ms ease;
}

.breadcrumb-item a:hover {
  color: var(--breadcrumb-link-hover);
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: var(--breadcrumb-text-active);
  font-weight: 500;
}

.breadcrumb-item:not(:last-child)::after {
  content: '›';
  display: inline-block;
  margin-left: 0.5rem;
  color: var(--breadcrumb-separator);
  font-size: 16px;
  font-weight: 400;
}

/* Responsive Breadcrumbs */
@media (max-width: 767px) {
  .breadcrumb-item:not(:nth-last-child(-n+2)) {
    display: none;
  }
  
  .breadcrumb-item:nth-last-child(3)::after {
    content: '...';
  }
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 1rem;
}

.form-control:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.form-text {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #6c757d;
}

/* Modern Select/Filter Styling */
.form-select {
  padding: 8px 32px 8px 12px;
  border: 1px solid #D1D5DB;
  border-radius: var(--btn-radius);
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  appearance: none;
  cursor: pointer;
  transition: all var(--btn-transition);
  line-height: 1.4;
}

.form-select:hover {
  border-color: #9CA3AF;
  background-color: #F9FAFB;
}

.form-select:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-color: var(--focus-ring);
  background-color: white;
}

.form-select:disabled {
  background-color: #F3F4F6;
  color: #9CA3AF;
  cursor: not-allowed;
}

/* Filter/Sort Bars */
.search-sort-bar,
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.filter-bar {
  padding: 12px;
  background: #F9FAFB;
  border-radius: 8px;
  border: 1px solid #E5E7EB;
}

/* Ensure search form displays inline */
.search-sort-bar form {
  display: flex !important;
  align-items: stretch;
  gap: 16px !important;
}

/* Prevent form control from taking full width in flex context */
.search-sort-bar .form-control {
  width: auto;
  min-width: 250px;
  margin-right: 0 !important;
}

/* Ensure button has proper spacing */
.search-sort-bar .btn {
  margin-left: 0 !important;
}

/* Filter Labels */
.filter-label {
  display: inline-block;
  margin-right: 8px;
  font-weight: 500;
  font-size: 14px;
  color: #374151;
}

.form-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
}

/* Project Page */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #dee2e6;
}

.text-muted {
  color: #6c757d;
}

.section {
  background-color: white;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Keywords */
.keyword-form .input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.keyword-list {
  list-style: none;
  margin-top: 1rem;
}

.keyword-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background-color: #f8f9fa;
  border-radius: 4px;
}

.last-run {
  margin-top: 0.5rem;
  color: #6c757d;
  font-size: 0.875rem;
}

/* Dashboard */
.dashboard-filters {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 4px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-group label {
  font-weight: 500;
  margin-bottom: 0;
}

.chart-container {
  margin-bottom: 2rem;
  padding: 1rem;
  background-color: white;
  border-radius: 4px;
}

/* Charts Grid for side-by-side layout */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Make charts responsive on smaller screens */
@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6c757d;
}

.empty-state p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 3px;
  text-transform: uppercase;
}

.badge-ok {
  background-color: #d4edda;
  color: #155724;
}

.badge-error {
  background-color: #f8d7da;
  color: #721c24;
}

.badge-pending {
  background-color: #fff3cd;
  color: #856404;
}

/* Debug Pages */
.details-table {
  width: 100%;
  margin-bottom: 2rem;
}

.details-table th {
  text-align: right;
  padding-right: 1rem;
  width: 200px;
  font-weight: 600;
  vertical-align: top;
}

.details-table td {
  padding-left: 1rem;
}

.code-block {
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
}

.error-text {
  color: #dc3545;
}

/* Date Range Selector (GA4-style) */
.date-range-selector {
  position: relative;
  display: inline-block;
  z-index: 100;
}

.date-range-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid #dadce0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  color: #202124;
  transition: all 0.2s;
  pointer-events: auto;
  position: relative;
  z-index: 101;
}

.date-range-trigger:hover {
  background: #f8f9fa;
  border-color: #5f6368;
}

.date-range-label {
  color: #5f6368;
  font-weight: 400;
}

.date-range-dates {
  color: #202124;
  font-weight: 500;
}

.dropdown-arrow {
  color: #5f6368;
}

.date-range-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: white;
  border: 1px solid #dadce0;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  min-width: 600px;
}

.date-range-content {
  display: flex;
}

.date-range-presets {
  flex: 0 0 250px;
  padding: 0.5rem 0;
  border-right: 1px solid #e8eaed;
}

.preset-option,
.compare-option {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: #202124;
  transition: background 0.2s;
}

.preset-option:hover,
.compare-option:hover {
  background: #f1f3f4;
}

.preset-option.active,
.compare-option.active {
  background: #e8f0fe;
  color: #1967d2;
  font-weight: 500;
}

.preset-divider {
  height: 1px;
  background: #e8eaed;
  margin: 0.5rem 0;
}

.date-range-calendar {
  flex: 1;
  padding: 1rem;
}

.calendar-section {
  margin-bottom: 1rem;
}

.calendar-section.compare-dates {
  padding-top: 1rem;
  border-top: 1px solid #e8eaed;
}

.compare-dates-header {
  font-size: 0.875rem;
  color: #5f6368;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.calendar-header {
  margin-bottom: 0.75rem;
}

.calendar-header label {
  display: block;
  font-size: 0.75rem;
  color: #5f6368;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.date-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #dadce0;
  border-radius: 4px;
  font-size: 0.875rem;
  color: #202124;
}

.date-input:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.calendar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e8eaed;
}

/* Legacy button classes - Deprecated, use .btn with modifiers instead */
.btn-cancel {
  /* Deprecated: Use .btn .btn-secondary .btn-md instead */
  padding: 10px 20px;
  border: 1px solid var(--btn-secondary-border);
  background: transparent;
  color: var(--btn-secondary-text);
  border-radius: var(--btn-radius);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--btn-transition);
}

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

.btn-apply {
  /* Deprecated: Use .btn .btn-primary .btn-md instead */
  padding: 10px 20px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border: none;
  border-radius: var(--btn-radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--btn-transition);
}

.btn-apply:hover {
  background: var(--btn-primary-bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Metric Summary Cards */
.metric-summary {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: white;
  border-radius: 4px;
}

.metric-card {
  flex: 1;
}

.metric-title {
  font-size: 0.875rem;
  color: #5f6368;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.metric-title svg {
  width: 16px;
  height: 16px;
  color: #9aa0a6;
  cursor: help;
}

.metric-value {
  font-size: 2rem;
  font-weight: 500;
  color: #202124;
  line-height: 1.2;
}

.metric-label {
  font-size: 0.75rem;
  color: #5f6368;
  margin-top: 0.25rem;
}

.metric-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.metric-change.positive {
  color: #137333;
}

.metric-change.negative {
  color: #c5221f;
}

.metric-change.neutral {
  color: #5f6368;
}

/* Metric Descriptions */
.metric-description {
  font-size: 0.875rem;
  color: #5f6368;
  line-height: 1.5;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f8f9fa;
  border-left: 3px solid #1a73e8;
  border-radius: 4px;
}

/* Tooltips */
.info-icon {
  position: relative;
  display: inline-flex;
  cursor: help;
}

.info-icon svg {
  width: 16px;
  height: 16px;
  color: #9aa0a6;
  transition: color 0.2s;
}

.info-icon:hover svg {
  color: #1a73e8;
}

.info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 14px;
  background: #202124;
  color: white;
  font-size: 0.8125rem;
  line-height: 1.5;
  border-radius: 6px;
  white-space: normal;
  min-width: 220px;
  max-width: 280px;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.info-icon::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #202124;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1001;
}

.info-icon:hover::after,
.info-icon:hover::before {
  opacity: 1;
}

/* Granularity Selector */
.granularity-selector {
  display: flex;
  align-items: center;
}

.granularity-select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid #dadce0;
  border-radius: 4px;
  font-size: 0.875rem;
  color: #202124;
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235f6368' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 12px;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.granularity-select:hover {
  border-color: #5f6368;
}

.granularity-select:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

/* Keyword Section Enhancements */
.keyword-instructions {
  background: #e8f0fe;
  border-left: 4px solid #1a73e8;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 4px;
}

.instruction-text {
  margin-bottom: 0.75rem;
  color: #202124;
  font-size: 0.9rem;
  line-height: 1.6;
}

.instruction-tip {
  margin-bottom: 0.75rem;
  color: #137333;
  font-size: 0.9rem;
  line-height: 1.6;
  background: #e6f4ea;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
}

.instruction-note {
  margin-bottom: 0;
  color: #5f6368;
  font-size: 0.875rem;
  font-style: italic;
}

.keyword-subheading {
  font-size: 1rem;
  color: #202124;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.keyword-subheading.inactive-heading {
  color: #5f6368;
}

.keyword-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.keyword-phrase {
  font-weight: 400;
  color: #202124;
  font-size: 0.95rem;
}

.keyword-date {
  font-size: 0.75rem;
  color: #5f6368;
}

.keyword-date.deactivated {
  color: #ea4335;
}

.keyword-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background-color: #f8f9fa;
  border-radius: 4px;
  border-left: 3px solid #1a73e8;
}

.keyword-item.inactive-item {
  background-color: #fafafa;
  border-left-color: #9aa0a6;
  opacity: 0.7;
}

.inactive-list {
  margin-top: 1rem;
}

/* Inactive Keywords Collapsible Section */
.inactive-keywords-section {
  margin-top: 1.5rem;
}

/* Keywords Two-Column Layout */
.keywords-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1rem;
}

.keywords-lists-column {
  min-width: 0; /* Prevent overflow */
}

.keyword-timeline-column {
  min-width: 0; /* Prevent overflow */
}

/* Responsive: Stack on smaller screens */
@media (max-width: 1024px) {
  .keywords-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.inactive-keywords-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 0.5rem 0;
  transition: all 0.2s ease;
  user-select: none;
}

.inactive-keywords-header:hover {
  opacity: 0.7;
}

.inactive-keywords-header h3 {
  margin: 0;
}

.inactive-toggle-icon {
  width: 20px;
  height: 20px;
  color: #5f6368;
  transition: transform 0.3s ease;
  stroke-width: 2;
}

.inactive-keywords-header.expanded .inactive-toggle-icon {
  transform: rotate(180deg);
}

/* Active Keywords Collapsible Section */
.active-keywords-section {
  margin-top: 1rem;
}

.active-keywords-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 0.5rem 0;
  transition: all 0.2s ease;
  user-select: none;
}

.active-keywords-header:hover {
  opacity: 0.7;
}

.active-keywords-header h3 {
  margin: 0;
}

.active-toggle-icon {
  width: 20px;
  height: 20px;
  color: #202124;
  transition: transform 0.3s ease;
  stroke-width: 2;
}

.active-keywords-header.expanded .active-toggle-icon {
  transform: rotate(180deg);
}

.active-heading {
  margin: 0;
  color: #202124;
  font-weight: 500;
}

.active-list {
  margin-top: 1rem;
}

/* Legacy Warning Button - Updated to match new system */
.btn-warning {
  background-color: var(--btn-warning-bg);
  border-color: var(--btn-warning-bg);
  color: #FFFFFF;
  font-weight: 600;
}

.btn-warning:hover {
  background-color: var(--btn-warning-bg-hover);
  border-color: var(--btn-warning-bg-hover);
}

/* Special Schedule Button - Preserves gradient per design requirement */
.btn-schedule {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  font-weight: 600;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: all var(--btn-transition);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  /* Use standard sizing */
  padding: 12px 24px;
  font-size: 16px;
  line-height: 24px;
  min-width: 120px;
}

.btn-schedule:hover {
  background: linear-gradient(135deg, #5568d3 0%, #63408a 100%);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
  transform: translateY(-1px);
}

/* Keyword Timeline */
.keyword-timeline-section {
  margin-top: 0; /* Removed since it's now in grid layout */
  padding-top: 0; /* Removed since it's now in grid layout */
  border-top: none; /* Removed since it's now side-by-side */
}

.keyword-timeline {
  /* Container styles for timeline in side-by-side layout */
}

.keyword-timeline h3 {
  font-size: 1.1rem;
  color: #202124;
  margin-bottom: 0.5rem;
}

.timeline-description {
  font-size: 0.875rem;
  color: #5f6368;
  margin-bottom: 1.5rem;
}

.timeline-chart {
  margin-bottom: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 4px;
  min-height: 250px;
}

.timeline-year-selector {
  display: flex;
  align-items: center;
}

.timeline-year-selector .year-select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background-color: white;
  color: #202124;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.timeline-year-selector .year-select:hover {
  border-color: #1a73e8;
}

.timeline-year-selector .year-select:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* Scheduling Center */
.schedule-options {
  margin-bottom: 2rem;
}

.scheduling-instructions {
  background: #e8f0fe;
  border-left: 4px solid #667eea;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 4px;
}

.scheduling-instructions .instruction-text {
  margin-bottom: 0.75rem;
  color: #202124;
  font-size: 0.9rem;
  line-height: 1.6;
}

.scheduling-instructions .instruction-tip {
  margin-bottom: 0.75rem;
  color: #137333;
  font-size: 0.9rem;
  line-height: 1.6;
  background: #e6f4ea;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
}

.scheduling-instructions .instruction-note {
  margin-bottom: 0;
  color: #5f6368;
  font-size: 0.875rem;
  font-style: italic;
}

.schedule-label {
  display: block;
  font-weight: 600;
  color: #202124;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.frequency-buttons {
  display: flex;
  gap: 0.75rem;
}

.frequency-btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
  background-color: white;
  color: #5f6368;
  border: 2px solid #dadce0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  text-align: center;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.frequency-btn:hover {
  border-color: #1a73e8;
  background-color: #f8f9fa;
  color: #1a73e8;
}

.frequency-btn.active {
  background-color: #667eea;
  color: white;
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.frequency-btn.active:hover {
  background-color: #5568d3;
  border-color: #5568d3;
}

/* Schedule Status Display */
.schedule-status {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #e6f4ea 0%, #e8f5e9 100%);
  border-left: 4px solid #34a853;
  border-radius: 6px;
  animation: fadeIn 0.3s ease-in;
}

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

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background-color: #34a853;
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: bold;
  flex-shrink: 0;
}

.status-text {
  color: #137333;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
}

.run-now-section {
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

/* Schedule Time Options */
.schedule-time-options {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e8eaed;
}

.time-selector-group {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.time-input-group,
.timezone-input-group {
  flex: 1;
}

.time-input,
.timezone-select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid #dadce0;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #202124;
  background-color: white;
  transition: border-color 0.2s;
}

.time-input:focus,
.timezone-select:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.timezone-select {
  cursor: pointer;
}

/* Day of Week Selector */
.day-selector-group {
  margin-bottom: 1.5rem;
}

.day-select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid #dadce0;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #202124;
  background-color: white;
  cursor: pointer;
  transition: border-color 0.2s;
}

.day-select:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

/* Exclude Weekends Checkbox */
.weekend-exclude-group {
  margin-bottom: 1.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #202124;
}

/* AI Page Optimizer Styles */
.label-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.label-excellent {
  background-color: #d4edda;
  color: #155724;
}

.label-good {
  background-color: #fff3cd;
  color: #856404;
}

.label-weak {
  background-color: #ffe5d0;
  color: #d63301;
}

.label-critical {
  background-color: #f8d7da;
  color: #721c24;
}

.form-select {
  padding: 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 1rem;
  background-color: white;
}

.alert {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.exclude-weekends-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #667eea;
}

/* Save Schedule Section */
.save-schedule-section {
  display: flex;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid #e8eaed;
}

/* Progress Bar */
.progress-bar-container {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 100;
}

/* Top Progress Bar - Enhanced Turbo-style bar */
turbo-frame[busy]::before,
.turbo-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  z-index: 10000;
  box-shadow: 0 0 8px rgba(102, 126, 234, 0.6);
  transform-origin: 0 0;
  transform: scaleX(0);
  animation: progressGrow 200ms ease-out forwards;
}

@keyframes progressGrow {
  0% { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}

/* Custom Progress Bar - Thicker and more colorful */
.progress-bar {
  width: 100%;
  height: 16px;
  background: linear-gradient(90deg, #e0e0e0 0%, #f0f0f0 50%, #e0e0e0 100%);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  background-size: 200% 100%;
  border-radius: 8px;
  transition: width 0.5s ease-out;
  animation: progressGradient 2s linear infinite;
  box-shadow: 0 0 10px rgba(102, 126, 234, 0.6);
  position: relative;
}

/* Add a subtle sheen effect to show activity */
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 30px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3));
  animation: progressSheen 1.5s ease-in-out infinite;
}

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

@keyframes progressSheen {
  0% { transform: translateX(-40px); }
  100% { transform: translateX(100%); }
}

/* Progress HUD Component */
/* HUD container - bottom-right toast */
.progress-hud {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: none;
}

/* panel base */
.progress-hud__panel {
  width: 380px;
  max-width: calc(100vw - 40px);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  overflow: hidden;
  background: #fff;
}

/* default: show expanded */
.progress-hud__collapsed { display: none; }
.progress-hud__expanded { display: block; }

/* collapsed mode */
.progress-hud.is-collapsed .progress-hud__expanded { display: none; }
.progress-hud.is-collapsed .progress-hud__collapsed { display: block; }

.progress-hud.is-collapsed .progress-hud__panel {
  width: 280px;
  border-radius: 14px;
}

/* collapsed layout is tight */
.progress-hud__collapsed {
  padding: 10px 12px;
}

.progress-hud__collapsed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.progress-hud__expand-btn {
  appearance: none;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.progress-hud__collapsed-title {
  font-size: 12px;
  opacity: 0.9;
}

/* compact bar */
.progress-hud__bar--compact {
  height: 8px;
}

/* icon button */
.progress-hud__icon-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.progress-hud__icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* header */
.progress-hud__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.progress-hud__header-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.progress-hud__header-actions {
  display: flex;
  gap: 8px;
}

/* body */
.progress-hud__body {
  padding: 20px;
}

/* bar */
.progress-hud__bar {
  height: 16px;
  background: #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.progress-hud__bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  background-size: 200% 100%;
  border-radius: 8px;
  transition: width 0.5s ease-out;
  animation: progressGradient 2s linear infinite;
  box-shadow: 0 0 10px rgba(102, 126, 234, 0.6);
  position: relative;
}

.progress-hud__bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 30px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3));
  animation: progressSheen 1.5s ease-in-out infinite;
}

/* status */
.progress-hud__status-title {
  margin: 0 0 8px 0;
  font-weight: 600;
  color: #202124;
  font-size: 1rem;
}

.progress-hud__status-text {
  margin: 0;
  color: #5f6368;
  font-size: 0.875rem;
  margin-bottom: 20px;
}

.progress-hud__statuses {
  /* for future use */
}



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

@keyframes progressPulse {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

.progress-text {
  margin-top: 0.75rem;
  color: #5f6368;
  font-size: 0.875rem;
  text-align: center;
  font-weight: 500;
  transition: opacity 0.3s ease-in-out; /* Smooth text fade */
  min-height: 1.2rem; /* Prevent layout shift during text changes */
}

/* Form Label with Tooltip */
.form-label-with-tooltip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.form-label-with-tooltip label {
  margin-bottom: 0;
  font-weight: 500;
  color: #202124;
}

.field-help-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #5f6368;
  color: white;
  font-size: 12px;
  font-weight: 600;
  cursor: help;
  transition: background-color 0.2s;
}

.field-help-icon:hover {
  background-color: #1a73e8;
}

.field-help-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 14px;
  background: #202124;
  color: white;
  font-size: 0.8125rem;
  line-height: 1.5;
  border-radius: 6px;
  white-space: normal;
  min-width: 220px;
  max-width: 280px;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-weight: 400;
}

.field-help-icon::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #202124;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1001;
}

.field-help-icon:hover::after,
.field-help-icon:hover::before {
  opacity: 1;
}

/* Analytics & Insights Section */
.analytics-insights {
  margin-top: 2rem;
}

.insights-loading,
.insights-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #5f6368;
}

.insights-empty > div {
  max-width: 600px;
  margin: 0 auto;
  text-align: left;
  padding: 0;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #1a73e8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.insights-content {
  /* Display controlled by JavaScript - no static rules needed */
  transition: opacity 0.3s ease-in-out;
}

/* Insights Layout - Top Row */
.insights-top-row {
  display: flex !important;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  min-height: 200px;
}

/* Insights Layout - Middle Row */
.insights-middle-row {
  display: flex !important;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  min-height: 200px;
}

/* Insights Layout - Bottom Row */
.insights-bottom-row {
  display: block !important;
  margin-bottom: 1.5rem;
}

/* Insight Cards */
.insight-card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #e8eaed;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: block !important;
  visibility: visible !important;
  flex: 1 1 auto;
  min-height: 200px;
}

.insight-card:focus-within {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}

.insight-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #202124;
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.insight-card h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #5f6368;
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Position Distribution Chart */
.position-avg-label {
  font-size: 0.875rem;
  color: #5f6368;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.position-chart-container {
  height: 250px;
  position: relative;
  display: block !important;
  visibility: visible !important;
}

.position-chart-container canvas {
  max-height: 250px;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  visibility: visible !important;
}

/* Insights Loading Block Wrapper */
[data-dashboard-charts-target="insightsLoadingBlock"] {
  position: relative;
  min-height: 200px;
}

/* AI Confidence Card */
.confidence-score-display {
  text-align: center;
  margin: 1.5rem 0;
}

.confidence-score-value {
  font-size: 3rem;
  font-weight: 600;
  color: #202124;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.confidence-label {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.confidence-label.high {
  color: #34a853;
}

.confidence-label.medium {
  color: #fbbc04;
}

.confidence-label.low {
  color: #ea4335;
}

.confidence-description {
  font-size: 0.875rem;
  color: #5f6368;
  line-height: 1.5;
  margin: 0;
}

/* Data Confidence Recommendations */
.confidence-interpretation {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e8eaed;
}

.confidence-interpretation h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #202124;
  margin: 0 0 0.75rem 0;
  text-transform: none;
  letter-spacing: normal;
}

.interpretation-content {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #5f6368;
  white-space: pre-line;
}

.interpretation-content p {
  margin: 0;
  color: #5f6368;
}

.interpretation-content strong {
  color: #202124;
  font-weight: 600;
}

.interpretation-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.interpretation-content li {
  padding: 0.375rem 0;
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.5;
}

.interpretation-content li::before {
  content: '•';
  position: absolute;
  left: 0.25rem;
  color: #5f6368;
  font-weight: bold;
}

/* Data Confidence CTA */
.confidence-cta {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e8eaed;
  text-align: center;
}

.learn-more-link {
  color: #1a73e8;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
}

.learn-more-link:hover {
  text-decoration: underline;
}

/* Top Cited URLs Table */
.urls-table-container {
  overflow-x: auto;
}

.urls-table {
  width: 100%;
  border-collapse: collapse;
}

.urls-table thead th {
  font-size: 0.75rem;
  font-weight: 600;
  color: #5f6368;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 0.5rem;
  border-bottom: 2px solid #e8eaed;
  text-align: left;
}

.urls-table tbody td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #e8eaed;
  font-size: 0.875rem;
  color: #202124;
}

.urls-table tbody td:first-child {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease;
}

.urls-table tbody td:first-child:hover {
  color: #1a73e8;
  text-decoration: underline;
}

.urls-table tbody td:nth-child(2),
.urls-table tbody td:nth-child(3) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* LLM Positioning Summary */
.llm-summary-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #202124;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-left: 3px solid #1a73e8;
  border-radius: 4px;
}

.brand-attributes {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.attribute-section {
  display: block;
}

.attribute-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.attribute-list li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  font-size: 0.875rem;
  color: #202124;
  line-height: 1.5;
}

.attribute-list li::before {
  content: '•';
  position: absolute;
  left: 0.5rem;
  color: #1a73e8;
  font-weight: bold;
}

/* Competitor Landscape Table */
.competitors-table-container {
  overflow-x: auto;
}

.competitors-table {
  width: 100%;
  border-collapse: collapse;
}

.competitors-table thead th {
  font-size: 0.75rem;
  font-weight: 600;
  color: #5f6368;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 0.75rem;
  border-bottom: 2px solid #e8eaed;
  text-align: left;
}

.competitors-table tbody td {
  padding: 1rem 0.75rem;
  border-bottom: 1px solid #e8eaed;
  font-size: 0.875rem;
  color: #202124;
  vertical-align: top;
}

.competitors-table tbody td:first-child {
  font-weight: 500;
}

.competitors-table tbody td:nth-child(2) {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.competitors-table tbody td:nth-child(3),
.competitors-table tbody td:nth-child(4) {
  max-width: 250px;
  line-height: 1.5;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .insights-top-row,
  .insights-middle-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .urls-table tbody td:first-child {
    max-width: 150px;
  }
  
  .competitors-table {
    font-size: 0.8rem;
  }
  
  .competitors-table thead th,
  .competitors-table tbody td {
    padding: 0.5rem;
  }
  
  .competitors-table tbody td:nth-child(3),
  .competitors-table tbody td:nth-child(4) {
    max-width: 120px;
    font-size: 0.75rem;
  }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
  .insights-top-row,
  .insights-middle-row {
    gap: 1.25rem;
  }
  
  .insight-card {
    padding: 1.25rem;
  }
}

/* Show More/Less Button Styling */
.show-more-urls-btn,
.show-more-competitors-btn {
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.show-more-urls-btn:hover,
.show-more-competitors-btn:hover {
  background-color: #f8f9fa;
  opacity: 0.9;
}

.show-more-urls-btn:active,
.show-more-competitors-btn:active {
  opacity: 0.7;
}

/* Print Styles */
@media print {
  .insights-loading,
  .insights-empty {
    display: none;
  }
  
  .insight-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  
  .insights-top-row,
  .insights-middle-row {
    page-break-inside: avoid;
  }
}
/* ===================================
   Dashboard Home Styles
   =================================== */

/* Dashboard Container */
.dashboard-container {
  width: 100%;
  padding: 2.5rem 2rem;
  background-color: #f8f9fa;
}

/* Dashboard Header */
.dashboard-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #E5E7EB;
}

.dashboard-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.025em;
}

.dashboard-subtitle {
  font-size: 0.875rem;
  color: #6B7280;
  margin: 0 0 0.5rem 0;
  font-weight: 400;
}

.dashboard-updated {
  font-size: 0.875rem;
  color: #9CA3AF;
  margin: 0;
  font-weight: 400;
}

/* Hero Metrics Section */
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

/* Metric Card */
.metric-card {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.metric-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  border-color: #D1D5DB;
}

.metric-card-header {
  margin-bottom: 1rem;
}

.metric-card-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.metric-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.metric-card-value {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  margin: 0;
  letter-spacing: -0.025em;
}

.metric-card-subtitle {
  font-size: 0.875rem;
  color: #6B7280;
  margin: 0;
  font-weight: 400;
}

/* Module Metrics Section */
.module-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.module-column {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.module-header {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 1.25rem 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid #E5E7EB;
  letter-spacing: -0.015em;
}

.module-header-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #111827;
  text-decoration: none;
  transition: color 0.2s ease;
}

.module-header-link:hover {
  color: #5F83FF;
}

.module-arrow {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.module-header-link:hover .module-arrow {
  transform: translateX(4px);
}

/* Metric List */
.metric-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1rem;
  background: #F9FAFB;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.metric-item:hover {
  background: #F3F4F6;
}

.metric-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6B7280;
}

.metric-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1F2937;
  letter-spacing: -0.01em;
}

/* Score Distribution Badges */
.score-distribution-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.score-badge {
  padding: 0.375rem 0.875rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* Trends Section */
.trends-section {
  margin-bottom: 2.5rem;
}

.section-header {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 1.25rem 0;
  letter-spacing: -0.02em;
}

.trends-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.trend-chart-container {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.trend-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 1rem 0;
  letter-spacing: -0.01em;
}

.no-data-message {
  padding: 3rem 2rem;
  text-align: center;
  color: #9CA3AF;
  font-size: 0.875rem;
  font-style: italic;
}

/* Quick Actions Panel */
.quick-actions-panel {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.action-card {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.action-card:hover {
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.action-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.01em;
}

.action-description {
  font-size: 0.875rem;
  color: #6B7280;
  margin: 0 0 1.25rem 0;
  line-height: 1.5;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  text-align: center;
}

.btn-primary {
  background-color: #5F83FF;
  color: white;
}

.btn-primary:hover {
  background-color: #4A6FE8;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(95, 131, 255, 0.3);
}

.btn-secondary {
  background-color: white;
  color: #5F83FF;
  border: 1px solid #5F83FF;
}

.btn-secondary:hover {
  background-color: #EEF2FF;
}

.btn-large {
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
}

/* Delete Button Outline Style - Must come after all base button styles */
.btn.btn-danger-outline,
button.btn.btn-danger-outline {
  background-color: transparent !important;
  border: 1px solid var(--btn-danger-bg) !important;
  color: var(--btn-danger-bg) !important;
}

.btn.btn-danger-outline:hover,
button.btn.btn-danger-outline:hover {
  background-color: rgba(220, 38, 38, 0.1) !important;
  border-color: var(--btn-danger-bg) !important;
  color: var(--btn-danger-bg) !important;
}

.btn.btn-danger-outline:active,
button.btn.btn-danger-outline:active {
  background-color: rgba(220, 38, 38, 0.2) !important;
}

.btn.btn-danger-outline:disabled,
.btn.btn-danger-outline[disabled],
button.btn.btn-danger-outline:disabled,
button.btn.btn-danger-outline[disabled] {
  border-color: var(--btn-disabled-border) !important;
  color: var(--btn-disabled-text) !important;
  background-color: transparent !important;
}

/* Empty State */
.empty-state {
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
}

.empty-state-content {
  max-width: 1000px;
  text-align: center;
}

.empty-state-icon {
  margin: 0 auto 2rem;
}

.empty-state-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 1rem 0;
}

.empty-state-description {
  font-size: 1.125rem;
  color: #6B7280;
  line-height: 1.6;
  margin: 0 0 3rem 0;
}

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

.empty-state-card {
  background: white;
  border: 2px solid #E5E7EB;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
}

.empty-state-card:hover {
  border-color: #5F83FF;
  box-shadow: 0 8px 24px rgba(95, 131, 255, 0.15);
  transform: translateY(-4px);
}

.empty-state-card-icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.empty-state-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.75rem 0;
}

.empty-state-card-text {
  font-size: 0.875rem;
  color: #6B7280;
  line-height: 1.5;
  margin: 0 0 1.5rem 0;
}

.empty-state-footer {
  padding-top: 2rem;
  border-top: 1px solid #E5E7EB;
}

.empty-state-footer-text {
  font-size: 1rem;
  color: #6B7280;
  margin: 0 0 0.75rem 0;
}

.empty-state-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #5F83FF;
  text-decoration: none;
  transition: color 0.2s ease;
}

.empty-state-link:hover {
  color: #4A6FE8;
  text-decoration: underline;
}

/* ===================================
   TOOLTIP SYSTEM
   =================================== */

/* AI Search Visibility Chart Tooltips - Fix for sizing and clipping issues */
.apexcharts-tooltip {
  min-width: 240px !important;
  max-width: 360px !important;
  width: max-content !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  line-height: 1.4 !important;
  box-sizing: border-box !important;
  padding: 10px 12px !important;
  z-index: 9999 !important;
  pointer-events: none !important;
  border-radius: 6px !important;
  /* Prevent tooltip from being clipped by parent containers */
  position: absolute !important;
}

/* Ensure chart containers don't clip tooltips */
.trend-chart-container,
.chart-container,
.chart-wrapper {
  overflow: visible !important;
  position: relative;
  /* Add padding to accommodate tooltips near edges */
  padding: 20px 10px 10px 10px;
}

/* Fix for chart tooltip positioning */
.apexcharts-tooltip.apexcharts-theme-light {
  background: #1F2937 !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06) !important;
}

/* Fix tooltip title styling */
.apexcharts-tooltip-title {
  background: #1F2937 !important;
  color: #FFFFFF !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding: 8px 12px !important;
  font-weight: 600 !important;
}

/* Fix tooltip text styling */
.apexcharts-tooltip-text {
  font-size: 0.8125rem !important;
  padding: 8px 12px !important;
}

/* Fix marker styling */
.apexcharts-tooltip-marker {
  width: 10px !important;
  height: 10px !important;
  border-radius: 50% !important;
  margin-right: 8px !important;
}

/* Chart.js tooltips */
.chartjs-tooltip {
  min-width: 240px !important;
  max-width: 360px !important;
  width: max-content !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  line-height: 1.4 !important;
  box-sizing: border-box !important;
  padding: 10px 12px !important;
  z-index: 9999 !important;
  pointer-events: none !important;
  border-radius: 6px !important;
  background: #1F2937 !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06) !important;
  opacity: 1 !important;
}

/* Chart.js tooltip body */
.chartjs-tooltip-body {
  font-size: 0.8125rem !important;
  white-space: normal !important;
  line-height: 1.4 !important;
}

/* Chart.js tooltip title */
.chartjs-tooltip-title {
  font-weight: 600 !important;
  margin-bottom: 6px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding-bottom: 6px !important;
}

/* Loading/skeleton layers must NOT intercept mouse */
.chart-loading,
.chart-overlay,
.chart-skeleton,
.skeleton,
.loading,
.spinner,
.insights-loading,
.loading-insights {
  pointer-events: none !important;
}

/* Canvas should always receive mouse events */
canvas {
  pointer-events: auto;
}

.tooltip-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
  transition: opacity 0.2s ease;
  /* Ensure tooltip triggers don't cause overflow issues */
  overflow: visible !important;
}

.tooltip-trigger:hover {
  opacity: 0.7;
}

.tooltip-trigger svg {
  flex-shrink: 0;
}

/* Tooltip content */
.tooltip-trigger::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background-color: #1F2937;
  color: #FFFFFF;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.8125rem;
  line-height: 1.5;
  white-space: normal;
  min-width: 220px;
  max-width: 280px;
  width: max-content;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  font-weight: 400;
}

/* Tooltip arrow */
.tooltip-trigger::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-2px);
  border: 6px solid transparent;
  border-top-color: #1F2937;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 1000;
}

/* Show tooltip on hover */
.tooltip-trigger:hover::after,
.tooltip-trigger:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Adjust tooltip position for right-aligned elements */
.metric-item .tooltip-trigger::after {
  left: auto;
  right: 0;
  transform: translateX(0) translateY(-8px);
}

.metric-item .tooltip-trigger::before {
  left: auto;
  right: 12px;
  transform: translateX(0) translateY(-2px);
}

.metric-item .tooltip-trigger:hover::after {
  transform: translateX(0) translateY(0);
}

.metric-item .tooltip-trigger:hover::before {
  transform: translateX(0) translateY(0);
}

/* Responsive tooltip adjustments */
@media (max-width: 767px) {
  .tooltip-trigger::after {
    min-width: 180px;
    max-width: 240px;
    font-size: 0.75rem;
    padding: 8px 12px;
  }
  
  .field-help-icon::after {
    min-width: 180px;
    max-width: 240px;
    font-size: 0.75rem;
    padding: 8px 12px;
  }
  
  .info-icon::after {
    min-width: 180px;
    max-width: 240px;
    font-size: 0.75rem;
    padding: 8px 12px;
  }
}

/* Responsive Design */
@media (max-width: 1199px) {
  .dashboard-container {
    padding: 2rem 1.5rem;
  }

  .hero-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .module-metrics {
    grid-template-columns: 1fr;
  }

  .trends-grid {
    grid-template-columns: 1fr;
  }

  .quick-actions-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .dashboard-container {
    padding: 1.5rem 1rem;
  }

  .dashboard-header h1 {
    font-size: 1.75rem;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .metric-card-value {
    font-size: 2rem;
  }

  .module-metrics {
    gap: 1rem;
  }

  .trends-grid {
    gap: 1rem;
  }

  .quick-actions-grid {
    gap: 1rem;
  }

  .empty-state-title {
    font-size: 1.75rem;
  }

  .empty-state-actions {
    grid-template-columns: 1fr;
  }

  .action-buttons {
    flex-direction: column;
  }
}

/* ===================================
   PROFILE PAGE STYLES
   =================================== */

.profile-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.profile-card {
  background-color: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  margin-bottom: 24px;
  overflow: hidden;
}

.profile-card .card-header {
  padding: 20px 24px;
  border-bottom: 1px solid #E5E7EB;
  background-color: #F9FAFB;
}

.profile-card .card-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.profile-card .card-body {
  padding: 24px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #F3F4F6;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 500;
  color: #6B7280;
  font-size: 14px;
}

.info-value {
  color: #111827;
  font-size: 14px;
  font-weight: 400;
}

.card-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
}

/* Organization Memberships */
.memberships-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.membership-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.membership-item:hover {
  border-color: #D1D5DB;
  background-color: #F9FAFB;
}

.membership-item.active {
  border-color: #6366F1;
  background-color: #EEF2FF;
}

.membership-info {
  flex: 1;
}

.org-name {
  font-weight: 600;
  color: #111827;
  font-size: 15px;
  margin-bottom: 4px;
}

.membership-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.role-badge,
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.role-badge.role-owner {
  background-color: #FEF3C7;
  color: #92400E;
}

.role-badge.role-admin {
  background-color: #DBEAFE;
  color: #1E3A8A;
}

.role-badge.role-member {
  background-color: #E0E7FF;
  color: #3730A3;
}

.status-badge.status-active {
  background-color: #D1FAE5;
  color: #065F46;
}

.status-badge.status-suspended {
  background-color: #FEE2E2;
  color: #991B1B;
}

/* Danger Zone */
.danger-zone {
  border-color: #FCA5A5;
}

.danger-zone .card-header {
  background-color: #FEF2F2;
  border-bottom-color: #FCA5A5;
}

.danger-zone .card-header h2 {
  color: #991B1B;
}

.warning-message {
  color: #991B1B;
}

.warning-message p {
  margin-bottom: 8px;
}

.warning-message p.text-muted {
  color: #6B7280;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: #6366F1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-text {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: #6B7280;
}

.text-muted {
  color: #6B7280;
}

.form-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
}

.password-requirements {
  margin-top: 20px;
  padding: 16px;
  background-color: #F9FAFB;
  border-radius: 6px;
  border: 1px solid #E5E7EB;
}

.password-requirements h4 {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.password-requirements ul {
  margin: 0;
  padding-left: 20px;
}

.password-requirements li {
  font-size: 13px;
  color: #6B7280;
  margin-bottom: 4px;
}

/* Alert Styles */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-success {
  background-color: #D1FAE5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.alert-danger {
  background-color: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

.alert-warning {
  background-color: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.alert h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
}

.alert ul {
  margin: 0;
  padding-left: 20px;
}

.alert li {
  margin-bottom: 4px;
}

/* Badge Styles */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-left: 8px;
}

.badge-success {
  background-color: #D1FAE5;
  color: #065F46;
}

.badge-warning {
  background-color: #FEF3C7;
  color: #92400E;
}

.badge-info {
  background-color: #DBEAFE;
  color: #1E3A8A;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  width: 100%;
  height: 100%;
  overflow: hidden;
  outline: 0;
}

.modal.fade {
  opacity: 0;
  transition: opacity 0.15s linear;
}

.modal.show {
  opacity: 1;
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: 1.75rem auto;
  max-width: 500px;
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: #FFFFFF;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  outline: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid #E5E7EB;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem;
  border-top: 1px solid #E5E7EB;
  gap: 12px;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: #000;
  opacity: 0.5;
  cursor: pointer;
}

.btn-close:hover {
  opacity: 0.75;
}

/* ===================================
   USER MENU (TOP HEADER)
   =================================== */

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background-color: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-menu-trigger:hover {
  background-color: #F9FAFB;
  border-color: #D1D5DB;
}

.user-menu-trigger:focus {
  outline: none;
  border-color: #6366F1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.user-email {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

.chevron-icon {
  width: 16px;
  height: 16px;
  color: #6B7280;
  transition: transform 0.2s ease;
}

.user-menu-trigger[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background-color: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.user-menu-header {
  padding: 16px;
  border-bottom: 1px solid #F3F4F6;
}

.user-email-full {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
  word-break: break-all;
}

.user-org {
  font-size: 13px;
  color: #6B7280;
}

.user-menu-divider {
  height: 1px;
  background-color: #F3F4F6;
  margin: 0;
}

.user-menu-items {
  list-style: none;
  padding: 8px 0;
  margin: 0;
}

.user-menu-item,
.user-menu-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  color: #374151;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.user-menu-item:hover,
.user-menu-button:hover {
  background-color: #F9FAFB;
}

.user-menu-item svg,
.user-menu-button svg {
  width: 20px;
  height: 20px;
  color: #6B7280;
}

.user-menu-item span,
.user-menu-button span {
  flex: 1;
}

/* Sign Out Button in Sidebar */
.nav-link-button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s ease;
}

.nav-link-button:hover {
  background-color: var(--sidebar-hover-bg);
}

/* Responsive */
@media (max-width: 768px) {
  .profile-container {
    padding: 16px;
  }
  
  .user-email {
    display: none;
  }
  
  .user-menu-dropdown {
    width: 240px;
  }
}

/* Modal Backdrop */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-backdrop.fade {
  opacity: 0;
}

.modal-backdrop.show {
  opacity: 1;
}

/* Modal default state - MUST be hidden */
.modal {
  display: none !important;
}

.modal.show {
  display: block !important;
}

/* Ensure modal backdrop doesn't block page by default */
.modal-backdrop {
  display: none;
}

.modal-backdrop.show {
  display: block;
}

/* ===================================
   MODERN AUTH PAGES (LOGIN/SIGNUP)
   =================================== */

/* Hide sidebar and adjust layout for auth pages */
body.users-sessions,
body.users-registrations,
body.users-passwords,
body.users-confirmations {
  overflow-x: hidden;
}

/* Ensure sidebar starts collapsed on auth pages */
body.users-sessions .sidebar[data-collapsed="true"],
body.users-registrations .sidebar[data-collapsed="true"],
body.users-passwords .sidebar[data-collapsed="true"],
body.users-confirmations .sidebar[data-collapsed="true"] {
  width: var(--sidebar-width-collapsed);
}

/* Adjust main content margin for collapsed sidebar on auth pages */
body.users-sessions .main-content,
body.users-registrations .main-content,
body.users-passwords .main-content,
body.users-confirmations .main-content {
  transition: margin-left var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 !important;
}

/* When sidebar is collapsed on auth pages */
body.users-sessions .sidebar[data-collapsed="true"] ~ .main-content,
body.users-registrations .sidebar[data-collapsed="true"] ~ .main-content,
body.users-passwords .sidebar[data-collapsed="true"] ~ .main-content,
body.users-confirmations .sidebar[data-collapsed="true"] ~ .main-content {
  margin-left: var(--sidebar-width-collapsed);
}

/* When sidebar is expanded on auth pages */
body.users-sessions .sidebar[data-collapsed="false"] ~ .main-content,
body.users-registrations .sidebar[data-collapsed="false"] ~ .main-content,
body.users-passwords .sidebar[data-collapsed="false"] ~ .main-content,
body.users-confirmations .sidebar[data-collapsed="false"] ~ .main-content {
  margin-left: 310px;
}

.auth-container {
  min-height: 100vh;
  width: 100%;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-content {
  display: flex;
  width: 100%;
  min-height: 100vh;
  max-width: 100%;
}

/* Left Section - Form */
.auth-form-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: #FFFFFF;
  position: relative;
  min-width: 0; /* Allow flexbox to shrink */
}

.auth-form-wrapper {
  width: 100%;
  max-width: 400px;
}

/* Brand/Logo */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
}

.auth-brand svg {
  flex-shrink: 0;
}

.auth-brand-name {
  font-size: 16px;
  font-weight: 600;
  color: #5F83FF;
  letter-spacing: -0.01em;
}

/* Header */
.auth-header {
  margin-bottom: 32px;
}

.auth-heading {
  font-size: 30px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.auth-subheading {
  font-size: 15px;
  color: #6B7280;
  font-weight: 400;
  line-height: 1.5;
}

/* Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.form-label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  display: block;
}

.form-hint {
  font-size: 13px;
  color: #6B7280;
  font-weight: 400;
  margin-left: 4px;
}

.form-link {
  font-size: 14px;
  font-weight: 500;
  color: #6366F1;
  text-decoration: none;
  transition: color 0.2s;
}

.form-link:hover {
  color: #4F46E5;
}

.form-link-small {
  font-size: 13px;
  font-weight: 500;
  color: #6366F1;
  text-decoration: none;
  transition: color 0.2s;
  margin-top: 6px;
  display: inline-block;
}

.form-link-small:hover {
  color: #4F46E5;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  background: #FFFFFF;
  color: #111827;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.form-input::placeholder {
  color: #9CA3AF;
}

.form-input:focus {
  outline: none;
  border-color: #6366F1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input:hover {
  border-color: #9CA3AF;
}

/* Password Input with Toggle */
.password-input-wrapper {
  position: relative;
  width: 100%;
}

.password-input-wrapper .form-input {
  padding-right: 45px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #6B7280;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: #374151;
}

.password-icon {
  display: block;
}

/* Checkbox */
.form-field-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  cursor: pointer;
  accent-color: #6366F1;
}

.form-checkbox-label {
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  user-select: none;
}

/* Submit Button */
.form-actions {
  margin-top: 8px;
}

.btn-auth-primary {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #FFFFFF;
  background: #6366F1;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.btn-auth-primary:hover {
  background: #4F46E5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-auth-primary:active {
  background: #4338CA;
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

/* Divider */
.auth-divider {
  margin: 24px 0;
  text-align: center;
  position: relative;
}

.auth-divider::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background: #E5E7EB;
}

.auth-divider span {
  position: relative;
  background: #FFFFFF;
  padding: 0 12px;
  font-size: 13px;
  color: #6B7280;
  font-weight: 500;
}

/* Google Button */
.btn-auth-google {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 500;
  color: #374151;
  background: #FFFFFF;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-auth-google:hover {
  background: #F9FAFB;
  border-color: #9CA3AF;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-auth-google:active {
  background: #F3F4F6;
  transform: translateY(0);
}

/* Footer */
.auth-footer {
  margin-top: 24px;
  text-align: center;
}

.auth-footer-text {
  font-size: 14px;
  color: #6B7280;
}

.auth-footer-link {
  color: #6366F1;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.auth-footer-link:hover {
  color: #4F46E5;
}

/* Right Section - Hero/Features */
.auth-hero-section {
  flex: 1;
  background: linear-gradient(135deg, #667EEA 0%, #764BA2 50%, #C471ED 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

/* Decorative gradient overlay */
.auth-hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.auth-hero-content {
  max-width: 500px;
  z-index: 1;
}

.auth-hero-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.auth-hero-title {
  font-size: 28px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 32px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Benefits List */
.auth-hero-benefits {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 32px;
}

.auth-hero-benefit {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.benefit-icon {
  flex-shrink: 0;
  color: #FFFFFF;
  margin-top: 2px;
}

.auth-hero-benefit span {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.5;
  font-weight: 400;
}

/* Trust Badge */
.auth-hero-trust {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-hero-trust svg {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.9);
}

.auth-hero-trust span {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .auth-hero-section {
    display: none;
  }
  
  .auth-form-section {
    flex: 1;
  }
}

@media (max-width: 768px) {
  /* On mobile, hide sidebar completely for auth pages */
  body.users-sessions .sidebar,
  body.users-registrations .sidebar,
  body.users-passwords .sidebar,
  body.users-confirmations .sidebar {
    transform: translateX(-100%);
  }
  
  body.users-sessions .main-content,
  body.users-registrations .main-content,
  body.users-passwords .main-content,
  body.users-confirmations .main-content {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .auth-form-section {
    padding: 32px 20px;
  }
  
  .auth-form-wrapper {
    max-width: 100%;
  }
  
  .auth-heading {
    font-size: 24px;
  }
  
  .auth-subheading {
    font-size: 14px;
  }
  
  .auth-brand svg {
    width: 28px;
    height: 28px;
  }
  
  .auth-brand-name {
    font-size: 14px;
  }
}

/* Alert messages on auth pages */
.auth-form-wrapper .alert {
  margin-bottom: 24px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}

.auth-form-wrapper .alert-danger {
  background-color: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

.auth-form-wrapper .alert-success {
  background-color: #D1FAE5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.auth-form-wrapper .alert-info {
  background-color: #EFF6FF;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}

.auth-form-wrapper .alert-warning {
  background-color: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}
}
  background-color: #D1FAE5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.auth-form-wrapper .alert-info {
  background-color: #EFF6FF;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}

.auth-form-wrapper .alert-warning {
  background-color: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}
}
