/*
 * ConnectLab CSS System v2.0
 * Last Updated: August 3, 2025
 * Target: < 1000 lines, 8 colors, 2 themes
 */

/* 1. CSS Reset & Variables (Target: ~50 lines) */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* -------------------------------------------------- */
/* LIGHT THEME (Default) & BOOTSTRAP OVERRIDES        */
/* -------------------------------------------------- */
:root {
  /* --- 1. Base Palette (Our 8 Colors) --- */
  --color-black: #000000;
  --color-white: #ffffff;
  --color-teal-dark: #006666;
  --color-teal-primary: #008080;
  --color-teal-light: #20b2aa;
  --color-teal-pale: #e0f2f1;
  --color-gray-dark: #333333;
  --color-gray-light: #f5f5f5;

  /* --- 2. Semantic Theme Mapping (Our Names) --- */
  --bg-primary: var(--color-white);
  --bg-secondary: var(--color-gray-light);
  --text-primary: var(--color-black);
  --text-secondary: var(--color-gray-dark);
  --text-tertiary: #666666; /* Better contrast for secondary text */
  --accent-primary: var(--color-teal-primary);
  --accent-hover: var(--color-teal-pale);
  --border-color: var(--color-gray-light);

  /* --- 3. Bootstrap Main & State Color Overrides --- */
  --bs-primary: var(--accent-primary);
  --bs-secondary: var(--color-gray-dark);
  --bs-success: var(--color-teal-dark);
  --bs-danger: #dc3545;
  --bs-warning: var(--color-teal-primary);
  --bs-info: var(--color-teal-light);
  
  /* --- 4. Bootstrap RGB Values for Focus States --- */
  --bs-primary-rgb: 0, 128, 128; /* RGB for #008080 (teal-primary) */
  --bs-secondary-rgb: 51, 51, 51; /* RGB for #333333 (gray-dark) */
  --bs-success-rgb: 0, 102, 102; /* RGB for #006666 (teal-dark) */
  --bs-danger-rgb: 220, 53, 69; /* RGB for #dc3545 */
  --bs-warning-rgb: 0, 128, 128; /* RGB for #008080 (teal-primary) */
  --bs-info-rgb: 32, 178, 170; /* RGB for #20b2aa (teal-light) */

  /* --- 4. Bootstrap Component State & Subtle Colors (THE KEY FIX) --- */
  --bs-primary-bg-subtle: var(--color-teal-pale);
  --bs-secondary-bg-subtle: var(--color-gray-light);
  --bs-success-bg-subtle: var(--color-teal-pale);
  --bs-danger-bg-subtle: rgba(220, 53, 69, 0.15);
  --bs-warning-bg-subtle: var(--color-teal-pale);
  --bs-info-bg-subtle: var(--color-teal-pale);
  --bs-table-hover-bg: var(--accent-hover); /* Explicitly fixes table hover */
  --bs-table-striped-bg: var(--bg-secondary);
  --bs-body-color: var(--text-primary);
  --bs-body-bg: var(--bg-primary);
  --bs-secondary-bg: var(--bg-secondary);
  --bs-tertiary-bg: var(--color-white);
  --bs-border-color: var(--border-color);
  --bs-border-color-translucent: rgba(0, 0, 0, 0.175);
  --bs-link-color: var(--accent-primary);
  --bs-link-hover-color: var(--color-teal-dark);
  --bs-card-bg: var(--bg-secondary);
  --bs-card-border-color: var(--border-color);
  --bs-list-group-bg: var(--bg-secondary);
  --bs-nav-tabs-link-active-bg: var(--bg-primary);
  --bs-text-muted: var(--text-tertiary);

  /* --- 5. Theme Variables (Legacy Support) --- */
  /* These map to existing semantic variables for backward compatibility */
  --theme-accent-primary: var(--accent-primary);
  --theme-accent-secondary: var(--bs-secondary);
  --theme-accent-primary-rgb: var(--bs-primary-rgb);
  --theme-bg-primary: var(--bg-primary);
  --theme-bg-secondary: var(--bg-secondary);
  --theme-bg-secondary-transparent: rgba(245, 245, 245, 0.8); /* Light mode: based on gray-light */
  --theme-bg-tertiary: var(--bs-tertiary-bg);
  --theme-border-color: var(--border-color);
  --theme-border-color-light: rgba(0, 0, 0, 0.1);
  --theme-shadow-medium: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2);
  --theme-text-primary: var(--text-primary);
  --theme-text-secondary: var(--text-secondary);
  --theme-text-primary-high-contrast: var(--color-black);
  --theme-success-color: var(--bs-success);
  --theme-success-color-rgb: var(--bs-success-rgb);
  --theme-danger-color: var(--bs-danger);
  --theme-danger-color-rgb: var(--bs-danger-rgb);
  --theme-warning-color: var(--bs-warning);
  --theme-warning-color-rgb: var(--bs-warning-rgb);

  /* --- 6. Mobile Variables --- */
  --mobile-left-sidebar-width: 70px;
  --mobile-right-sidebar-width: 280px;
  --mobile-header-height: 56px;
  --mobile-touch-target-min: 44px;
  --mobile-transition-speed: 0.3s;
  --mobile-backdrop-z-index: 1040;
  --mobile-sidebar-z-index: 1050;
  --mobile-header-z-index: 1030;
  
  /* --- 6. Z-Index Hierarchy System --- */
  /* Content Layers (1-100) */
  --z-index-base: 1;
  --z-index-content-low: 10;
  --z-index-content-mid: 50;
  --z-index-content-high: 100;
  
  /* Navigation & UI Elements (1000-1099) */
  --z-index-dropdown: 1000;
  --z-index-sticky-nav: 1020;
  --z-index-fixed-nav: 1030;
  
  /* Overlays & Modals (1040-1099) */
  --z-index-modal-backdrop: 1040;
  --z-index-modal-standard: 1050;
  --z-index-modal-high-priority: 1060;
  --z-index-popover: 1070;
  --z-index-tooltip: 1080;
  --z-index-notification: 1090;
  
  /* Special Purpose Modals (100000+) */
  --z-index-modal-facebook-style: 100000; /* Post/Comment creation modals */
  --z-index-modal-action: 100001; /* Action modals on top of facebook-style modals */
  
  /* Third-Party Overrides (999000+) */
  --z-index-tinymce: 999999; /* TinyMCE dialogs must be above all standard modals */
  
  /* Note: Messaging system uses existing variables:
   * --messaging-panel-z-index: 1040
   * --mobile-backdrop-z-index: 1040
   * --mobile-header-z-index: 1030
   */
  
  /* --- 7. Responsive Spacing Variables --- */
  --spacing-mobile: 0.5rem;
  --spacing-tablet: 0.75rem;
  --spacing-desktop: 1rem;
  
  /* --- 8. Messaging Component Variables --- */
  --messaging-container-height: 100vh;
  --messaging-header-height: 60px;
  --messaging-conversation-header-height: 80px;
  
  /* --- 9. Messaging UI Variables --- */
  --messaging-panel-width: 360px;
  --messaging-panel-width-mobile: 100vw;
  --messaging-panel-transition: 0.3s ease-in-out;
  --messaging-panel-bg: var(--bs-body-bg);
  --messaging-panel-border: var(--bs-border-color);
  --messaging-panel-shadow: var(--bs-box-shadow);
  
  /* Mobile-specific messaging variables */
  --mobile-conversation-window-margin: 1rem;
  --mobile-header-touch-target: 56px;
  --mobile-message-input-height: 48px;
  --mobile-professional-sidebar-overlay: rgba(0, 0, 0, 0.5);
  --messaging-conversation-item-height: var(--mobile-touch-target-min);
  --messaging-search-height: var(--mobile-touch-target-min);
  --messaging-badge-bg: var(--bs-primary);
  --messaging-hover-bg: var(--bs-tertiary-bg);
  
  /* Messaging-specific CSS variables */
  --messaging-search-highlight-bg: var(--bs-warning);
  --messaging-reaction-shadow: var(--bs-box-shadow);
  --conversation-window-width-mobile: 100vw;
  --conversation-window-width-tablet: 450px;
  --conversation-window-width-desktop: 500px;
  --conversation-window-height-mobile: 60vh;
  --conversation-window-height-tablet: 500px;
  --conversation-window-height-desktop: 600px;
  
  /* --- 10. Feed Component Variables (Facebook-Inspired) --- */
  --feed-text-muted: #65676B;
  --feed-comment-bg: #F0F2F5;
  --feed-border-subtle: #E4E6EB;
  --feed-hover-bg: #F2F3F5;
  
  /* --- 11. Modal Backdrop Variables --- */
  --modal-backdrop-bg: rgba(0, 0, 0, 0.5);
  --modal-backdrop-opacity: 0.5;
}

/* ============================================
 * Z-INDEX HIERARCHY DOCUMENTATION
 * ============================================
 * 
 * RANGES:
 * -------
 * 1-100:        Content layers and low-priority elements
 * 1000-1099:    Navigation, dropdowns, UI elements
 * 1040-1099:    Overlays, modals, popovers, notifications
 * 100000-100099: High-priority full-screen modals (facebook-style)
 * 999000+:      Third-party component overrides (TinyMCE, etc.)
 * 
 * USAGE RULES:
 * ------------
 * 1. Always use CSS variables instead of hardcoded z-index values
 * 2. Never use inline z-index styles - create CSS classes instead
 * 3. Document any new z-index variables in this :root section
 * 4. Never exceed --z-index-tinymce unless absolutely necessary
 * 5. Use calc() for relative z-index values when needed
 *    Example: calc(var(--z-index-dropdown) - 1)
 * 
 * COMMON PATTERNS:
 * ----------------
 * - Dropdown container: --z-index-dropdown (1000)
 * - Standard Bootstrap modal: --z-index-modal-standard (1050)
 * - Modal backdrop: --z-index-modal-backdrop (1040)
 * - Post creation modal: --z-index-modal-facebook-style (100000)
 * - Action modal over post modal: --z-index-modal-action (100001)
 * 
 * ============================================ */

/* -------------------------------------------------- */
/* DARK THEME & BOOTSTRAP OVERRIDES                   */
/* -------------------------------------------------- */
[data-bs-theme="dark"] {
  /* --- 1. Semantic Theme Mapping (Our Names) --- */
  --bg-primary: var(--color-black);
  --bg-secondary: var(--color-gray-dark);
  --text-primary: var(--color-white);
  --text-secondary: #cccccc; /* Better contrast for secondary text on dark */
  --text-tertiary: #aaaaaa; /* Better contrast for tertiary text on dark */
  --accent-primary: var(--color-teal-light);
  
  /* Feed Component Variables - Dark Theme Overrides */
  --feed-text-muted: #B0B3B8;
  --feed-comment-bg: #3A3B3C;
  --feed-border-subtle: #3A3B3C;
  --feed-hover-bg: #4E4F50;
  --accent-hover: var(--color-teal-dark);
  --border-color: var(--color-gray-dark);
  
  /* Modal Backdrop Variables - Dark Theme Overrides */
  --modal-backdrop-bg: rgba(0, 0, 0, 0.75);
  --modal-backdrop-opacity: 0.75;

  /* --- 2. Bootstrap Main & State Color Overrides --- */
  --bs-primary: var(--accent-primary);
  --bs-secondary: var(--color-gray-light);
  --bs-success: var(--color-teal-light);
  --bs-danger: #ff6b6b;
  --bs-warning: var(--color-teal-light);
  --bs-info: var(--color-teal-primary);
  
  /* --- 3. Bootstrap RGB Values for Focus States --- */
  --bs-primary-rgb: 32, 178, 170; /* RGB for #20b2aa (teal-light) */
  --bs-secondary-rgb: 245, 245, 245; /* RGB for #f5f5f5 (gray-light) */
  --bs-success-rgb: 32, 178, 170; /* RGB for #20b2aa (teal-light) */
  --bs-danger-rgb: 255, 107, 107; /* RGB for #ff6b6b */
  --bs-warning-rgb: 32, 178, 170; /* RGB for #20b2aa (teal-light) */
  --bs-info-rgb: 0, 128, 128; /* RGB for #008080 (teal-primary) */
  
  /* --- 4. Bootstrap Component State & Subtle Colors (THE KEY FIX) --- */
  --bs-primary-bg-subtle: var(--color-teal-dark);
  --bs-secondary-bg-subtle: var(--bs-gray-800);
  --bs-success-bg-subtle: var(--color-teal-dark);
  --bs-danger-bg-subtle: rgba(255, 107, 107, 0.15);
  --bs-warning-bg-subtle: var(--color-teal-dark);
  --bs-info-bg-subtle: var(--color-teal-dark);
  --bs-table-hover-bg: var(--accent-hover); /* Explicitly fixes table hover */
  --bs-table-striped-bg: var(--bg-secondary);
  --bs-body-color: var(--text-primary);
  --bs-body-bg: var(--bg-primary);
  --bs-secondary-bg: var(--bg-secondary);
  --bs-tertiary-bg: var(--color-gray-dark);
  --bs-border-color: var(--border-color);
  --bs-border-color-translucent: rgba(255, 255, 255, 0.15);
  --bs-link-color: var(--accent-primary);
  --bs-link-hover-color: var(--color-white);
  --bs-card-bg: var(--bg-secondary);
  --bs-card-border-color: var(--border-color);
  --bs-list-group-bg: var(--bg-secondary);
  --bs-nav-tabs-link-active-bg: var(--bg-primary);
  --bs-text-muted: var(--text-tertiary);

  /* --- 5. Theme Variables (Legacy Support) - Dark Mode Overrides --- */
  --theme-bg-secondary-transparent: rgba(51, 51, 51, 0.8); /* Dark mode: based on gray-dark */
  --theme-border-color-light: rgba(255, 255, 255, 0.1);
  --theme-shadow-medium: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.4);
  --theme-text-primary-high-contrast: var(--color-white);

  /* --- 6. Messaging UI Dark Theme Variables --- */
  --messaging-panel-shadow: 0 0 1rem rgba(255, 255, 255, 0.15);
  
  /* --- Definitive Fix for Invisible Outline Buttons in Dark Mode --- */
  .btn-outline-primary,
  .btn-outline-secondary,
  .btn-outline-success,
  .btn-outline-danger,
  .btn-outline-warning,
  .btn-outline-info {
    --bs-btn-color: var(--bs-body-color); /* Use the main text color (white) */
    --bs-btn-border-color: var(--bs-body-color); /* Use the main text color for the border */
    --bs-btn-hover-color: var(--bs-body-bg); /* On hover, use the background color for text (black) */
    --bs-btn-hover-bg: var(--bs-body-color); /* On hover, use the text color for the background (white) */
    --bs-btn-hover-border-color: var(--bs-body-color);
  }

  /* Fix for transparent modal background in dark mode */
  .modal-content {
    background-color: var(--bs-card-bg);
  }


}

/* 3. Base Typography (Target: ~50 lines) */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.3333;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-weight: 600;
}

p {
  margin-bottom: 1em;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* 4. Three-Column Layout (Target: ~150 lines) */
.page-container {
        display: flex;
        flex-direction: column;
  min-height: 100vh;
}

.content-wrapper {
  display: flex;
  flex: 1;
    width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

.content-wrapper.is-full-width {
  max-width: none;
}

.left-sidebar {
  width: 70px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
  flex-shrink: 0;
  position: relative; /* Creates stacking context */
  z-index: 1000; /* Lower than dropdowns to allow them to appear above */
}

.three-col-main-content-slot {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  min-height: 0; /* Allow flexbox to shrink */
}

.right-sidebar {
  width: 350px;
  background-color: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
  flex-shrink: 0;
  padding: 1rem;
}

/* Mobile Responsive Adjustments */
/* Note: Right sidebar visibility on mobile is controlled by transform: translateX() 
   and the .right-sidebar-active class, not display: none */

@media (max-width: 768px) {
  .content-wrapper {
    flex-direction: column;
  }

  .left-sidebar {
    width: 100%;
    height: 60px; /* Becomes a top bar on mobile */
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .three-col-main-content-slot {
    padding: 0.5rem;
  }
}

/* Mobile-Only Close Buttons */
.sidebar-close-button {
  display: none; /* Hidden by default on desktop */
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  z-index: 10;
}

/* Show the close button ONLY on mobile screens */
@media (max-width: 768px) {
  .right-sidebar .sidebar-close-button {
      display: block;
  }
}

/* 5. Core Components (Target: ~300 lines) */
/* Card - Facebook Style */
.card {
  background-color: var(--bs-body-bg);
  border: none;
  border-radius: 8px;
  padding: 0;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease-in-out;
}

.card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

[data-bs-theme="dark"] .card {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  background-color: var(--bs-secondary-bg);
}

[data-bs-theme="dark"] .card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* -- 5.1 Component Overrides: Buttons (Definitive Final System) -- */

/* Base .btn styles */
.btn {
  display: inline-block;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 6px;
  transition: all 0.15s ease-in-out;
}

/* --- THE GLOBAL OUTLINE FIX --- */
/* This is the key to light mode. It links border color to text color. */
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-info {
  border-color: currentColor;
}

/* --- Solid Buttons (Using Bootstrap's CSS Variables) --- */
.btn-primary {
  --bs-btn-color: var(--bs-white);
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: var(--color-teal-dark);
  --bs-btn-hover-border-color: var(--color-teal-dark);
}
.btn-danger {
  --bs-btn-color: var(--bs-white);
  --bs-btn-bg: var(--bs-danger);
  --bs-btn-border-color: var(--bs-danger);
}

/* --- THE ONLY DARK MODE FIX NEEDED --- */
/* This surgically fixes the contrast for outline buttons in dark mode */
[data-bs-theme="dark"] {
  .btn-outline-primary,
  .btn-outline-success,
  .btn-outline-info,
  .btn-outline-warning {
    color: var(--accent-primary);
  }
  .btn-outline-secondary {
    color: var(--bs-gray-500);
  }
  .btn-outline-danger {
    color: var(--bs-danger);
  }
}

/* -- 5.2 Navigation & Sidebar (Definitive Icon-Only Layout) -- */

/* Main container for the sidebar */
.sidebar-menu-container {
    display: flex;
    flex-direction: column;
  justify-content: flex-start; /* Align items from the top */
    align-items: center;
  --mobile-backdrop-opacity: 0.5;
  --mobile-touch-target-min: 44px;

  /* --- 5. Responsive Spacing Variables (NEW) --- */
  --spacing-mobile: 0.5rem;
  --spacing-tablet: 0.75rem;
  --spacing-desktop: 1rem;
    padding: 0;
    margin: 0;
    width: 100%;
}

/* Push the footer to the absolute bottom of the container */
.sidebar-menu-container .sidebar-footer {
  margin-top: auto;
    width: 100%;
  padding-bottom: 0.5rem;
}

/* Navigation menu container - remove default list styling */
.nav-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Individual navigation list items */
.nav-item {
  position: relative; /* Context for tooltips */
}

/* The link itself, which is the clickable area */
/* Only apply fixed-size icon button styles to links INSIDE the sidebar */
.sidebar-menu-container .nav-link {
    position: relative; /* Context for tooltips - CRITICAL for absolute positioning */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    margin: 0.5rem auto;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.2s ease-in-out;
}

/* --- THIS IS THE CRITICAL FIX FOR ICON SIZE --- */
.sidebar-menu-container .nav-link i, .sidebar-menu-container .nav-link img {
  font-size: 1.5rem;   /* Makes Font Awesome icons larger */
  line-height: 1;      /* Improves vertical alignment */
  width: 1.5rem;       /* Ensures the logo and icons have same space */
  height: 1.5rem;
}

/* --- Specific override for the main sidebar logo --- */
.sidebar-menu-container .nav-link .sidebar-logo-icon {
  height: 50px;
  width: 50px;
  background-color: var(--color-teal-primary); /* Sets the background to your primary teal */
  border-radius: 50%;                         /* Makes the background circular */
  padding: 5px;                               /* Adds some space between the icon and the circle edge */
  box-sizing: border-box;                     /* Ensures padding doesn't increase the total 50px size */
}

.sidebar-menu-container .nav-link:hover, .sidebar-menu-container .nav-link.active {
  background-color: var(--accent-primary);
  color: var(--color-white);
}

/* Hides the text label visually but keeps it for accessibility */
.nav-text {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}

/* Bootstrap Tooltip Customization */
.tooltip {
    --bs-tooltip-bg: var(--color-gray-dark);
    --bs-tooltip-color: var(--color-white);
    --bs-tooltip-opacity: 1;
    font-size: 0.875rem;
    font-weight: 500;
}

.tooltip-inner {
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tooltip-arrow::before {
    border-right-color: var(--color-gray-dark) !important;
}

/* Dark theme adjustments for tooltips */
[data-bs-theme="dark"] .tooltip {
    --bs-tooltip-bg: var(--color-black);
}

[data-bs-theme="dark"] .tooltip-arrow::before {
    border-right-color: var(--color-black) !important;
}

/* Page Header / Content Title Section */
.page-header {
  text-align: center;
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin-top: 0;
  margin-bottom: 0.25rem;
  font-size: 2rem;
}

.page-header .page-subtitle {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.page-header .search-form-professional {
  display: flex;
  align-items: center;
  max-width: 600px;
  margin: 1.5rem auto 0 auto; /* More top margin */
}

.search-form-professional .search-input {
  flex-grow: 1;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  /* Make the input taller */
  padding: 0.65rem 1rem; 
  border-right: none;
}

.search-form-professional .search-button {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding: 0.65rem 1rem;
}

.search-form-professional .advanced-toggle {
  margin-left: 1rem;
  background: none;
  border: none;
  color: var(--accent-primary);
  font-weight: 500;
  cursor: pointer;
}

/* Theme Toggle Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
}
.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 48px;
}
.theme-switch input {
    display: none;
}
.slider {
    background-color: var(--color-gray-dark);
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 24px;
}
.slider:before {
    background-color: var(--color-white);
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--accent-primary);
}
input:checked + .slider:before {
    transform: translateX(24px);
}

/* ========================================
   4.1 Layout Components (FIX FOR SCROLLING)
   ======================================== */

/* This is the overall container for the page, below the fixed nav */
.page-container {
    /* This padding creates space for the fixed top-row */
    /* Increased from 48px to 100px to accommodate multi-line branding content and padding */
    padding-top: 100px; 
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* The fixed top bar containing the NavBar */
.top-row {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* Increased from 48px to 100px to accommodate multi-line branding content and padding */
    /* Must match padding-top of .page-container */
    height: 100px;
    /* Solid, opaque background that works in both light and dark themes */
    background-color: var(--bs-body-bg);
    /* Ensure background is fully opaque (no transparency) */
    opacity: 1;
    /* Add border-bottom for visual separation when scrolling */
    border-bottom: 1px solid var(--bs-border-color);
    z-index: 1020; /* High z-index */
    display: flex;
    align-items: center;
    /* Ensure content doesn't show through on scroll */
    backdrop-filter: none;
}

/* Hide desktop NavBar on mobile - mobile header replaces it */
@media (max-width: 767px) {
    .top-row {
        display: none;
    }
    
    .page-container {
        padding-top: 0; /* Remove desktop padding on mobile */
    }
}

/* Layout wrapper for sidebar + content */
.layout-wrapper {
    display: flex;
    width: 100%;
    flex-grow: 1;
}

/* Sidebar wrapper - fixed width on desktop, hidden on mobile */
.sidebar-wrapper {
    width: 80px;
    min-width: 80px;
    background-color: var(--bs-body-bg);
    border-right: 1px solid var(--bs-border-color);
    overflow-y: auto;
    position: sticky;
    top: 100px; /* Match header height */
    height: calc(100vh - 100px);
}

@media (max-width: 768px) {
    .sidebar-wrapper {
        display: none; /* Hide sidebar on mobile */
    }
}

/* This is the main area that holds the @Body (and the ThreeColumnContainer) */
.main-content {
    flex-grow: 1;
    /* Updated to match new header height */
    min-height: calc(100vh - 100px);
    width: 100%;
}

/* --- CRITICAL: Styles for the ThreeColumnContainer's columns --- */

/* This ensures the three-column layout itself takes up the full available height */
.three-column-container {
    height: 100%;
}

/* These are the slots INSIDE the ThreeColumnContainer */
/* This makes the individual columns scrollable if their content overflows */
.main-content-col,
.right-sidebar-col {
    height: 100%;
    overflow-y: auto;
}

/* ========================================
   4.3 Navigation - Main Nav Bar (Global Messaging)
   ======================================== */

/* --- 4.3.1 Main Nav Bar (Global Messaging) --- */
.main-nav-bar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    /* Increased from 48px to 100px to accommodate multi-line branding content and padding */
    height: 100px;
    /* Solid, opaque background that works in both light and dark themes */
    background-color: var(--bs-body-bg);
    /* Ensure background is fully opaque (no transparency) */
    opacity: 1;
    /* Add border-bottom for visual separation when scrolling */
    border-bottom: 1px solid var(--bs-border-color);
    z-index: 1020; /* Below overlays */
    padding: 0;
    margin: 0;
    /* Ensure content doesn't show through on scroll */
    backdrop-filter: none;
    /* Add vertical padding to center content properly */
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Branding section styling */
.navbar-branding {
    /* Add significant padding below the Beta version line for better spacing */
    padding-bottom: 1.5rem !important;
    margin-bottom: 0.5rem;
}

/* Add margin below the Beta version line (last div in branding) */
.navbar-branding > div:last-child {
    margin-bottom: 1.5rem !important;
    display: block;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-right: 1.5rem;
}

.nav-action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    border: none;
    border-radius: var(--bs-border-radius-lg);
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.nav-action-button:hover,
.nav-action-button:focus {
    transform: translateY(-1px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.18);
    outline: none;
}

.nav-action-button:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.35);
}

.chat-button {
    position: relative;
    font-size: 1.15rem;
}

.chat-button .badge {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(45%, -45%);
    font-size: 0.65rem;
    padding: 0.25em 0.5em;
    border-radius: 1rem;
    background-color: var(--bs-danger);
    color: #fff;
}

/* ===== NOTIFICATION BELL STYLES (Phase 1) ===== */
.notification-bell-container {
    position: relative;
}

.notification-button {
    position: relative;
    font-size: 1.15rem;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(45%, -45%);
    font-size: 0.65rem;
    padding: 0.25em 0.5em;
    border-radius: 1rem;
    background-color: var(--bs-danger);
    color: #fff;
    min-width: 1.5em;
    text-align: center;
}

/* Notification Dropdown */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 380px;
    max-width: 90vw;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2);
    z-index: var(--z-index-dropdown, 1060);
    max-height: 500px;
    display: flex;
    flex-direction: column;
}

.notification-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.notification-dropdown-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: var(--bs-body-color);
}

.mark-all-read {
    font-size: 0.875rem;
    color: var(--bs-primary);
    text-decoration: none;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.mark-all-read:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.notification-dropdown-body {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
    max-height: 400px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--bs-border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background-color: var(--bs-secondary-bg);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background-color: var(--bs-primary-bg-subtle);
}

.notification-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bs-primary);
    color: var(--bs-body-bg);
    border-radius: 50%;
    font-size: 0.875rem;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 0.25rem;
}

.notification-message {
    font-size: 0.875rem;
    color: var(--bs-text-muted);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--bs-text-muted);
}

.notification-unread-indicator {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    background-color: var(--bs-primary);
    border-radius: 50%;
    margin-left: 0.5rem;
}

.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    color: var(--bs-text-muted);
    text-align: center;
}

.notification-empty i {
    color: var(--bs-border-color);
    margin-bottom: 1rem;
}

.notification-empty p {
    margin: 0;
}

.notification-dropdown-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--bs-border-color);
    text-align: center;
}

.view-all-link {
    font-size: 0.875rem;
    color: var(--bs-primary);
    text-decoration: none;
    font-weight: 500;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .notification-dropdown {
        width: calc(100vw - 2rem);
        right: -1rem;
    }
}

/* ============================================
   Notification Page Styles - Phase 2
   Full notification history page
   ============================================ */

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.notification-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.notification-card:hover {
    background: var(--bs-tertiary-bg);
    border-color: var(--bs-primary);
    transform: translateX(4px);
}

.notification-card.unread {
    background: var(--bs-primary-bg-subtle);
    border-left: 4px solid var(--bs-primary);
}

.notification-card-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-primary-bg-subtle);
    border-radius: 50%;
    color: var(--bs-primary);
    font-size: 1.25rem;
}

.notification-card-content {
    flex: 1;
    min-width: 0;
}

.notification-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.notification-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bs-heading-color);
    margin: 0;
}

.notification-card-time {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    white-space: nowrap;
}

.notification-card-message {
    font-size: 0.9375rem;
    color: var(--bs-body-color);
    margin: 0 0 0.75rem 0;
    line-height: 1.5;
}

.notification-card-actor {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    margin-top: 0.5rem;
}

.notification-card-actor-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.notification-card-unread-dot {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 10px;
    height: 10px;
    background: var(--bs-primary);
    border-radius: 50%;
}

.notification-card.read {
    opacity: 0.85;
}

.notification-card.read .notification-card-icon {
    background: var(--bs-secondary-bg);
    color: var(--bs-secondary-color);
}

/* Mobile Responsive - Notification Cards */
@media (max-width: 768px) {
    .notification-card {
        padding: 1rem;
        gap: 0.75rem;
    }

    .notification-card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }

    .notification-card-header {
        flex-direction: column;
        gap: 0.25rem;
    }

    .notification-card-time {
        font-size: 0.8125rem;
    }

    .notification-card-title {
        font-size: 0.9375rem;
    }

    .notification-card-message {
        font-size: 0.875rem;
    }
}

.token-widget-container {
    display: flex;
    align-items: center;
}

.token-widget-button {
    flex-direction: column;
    align-items: flex-start;
    min-width: 128px;
    padding: 0.6rem 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.token-widget-button-pro {
    background: var(--bs-primary);
    color: var(--bs-body-bg);
}

.token-widget-button-admin {
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.token-widget-button-error {
    background: var(--bs-danger);
    color: #fff;
}

.token-widget-button-loading,
.token-widget-button-loading:hover,
.token-widget-button-loading:focus {
    background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    transform: none;
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.08);
    cursor: default;
}

.token-widget-amount {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.1;
}

.token-widget-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
}

.token-widget-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.token-widget-text {
    font-size: 0.85rem;
    font-weight: 600;
}

.token-dashboard-right-sidebar {
    padding: 1rem 1.25rem;
}

.token-dashboard-right-sidebar .card {
    border: 1px solid var(--bs-border-color);
}

.token-dashboard-right-sidebar .card-body {
    padding: 1rem 1.25rem;
}

.token-quick-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.token-quick-links .nav-action-button {
    justify-content: flex-start;
}

.token-quick-links .nav-action-button .token-widget-icon {
    font-size: 1.1rem;
}

.token-quick-links .nav-action-button.token-widget-button-pro {
    width: 100%;
}

@media (max-width: 768px) {
    .navbar-actions {
        gap: 0.5rem;
        padding-right: 1rem;
    }

    .token-dashboard-right-sidebar {
        padding: 0.75rem 1rem 1.5rem;
    }

    .token-widget-button {
        min-width: 110px;
        padding: 0.55rem 0.75rem;
    }
}

/* -- 5.3 Component Overrides: Badges -- */
.badge {
  padding: 0.4em 0.65em;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  /* Ensure text color is always readable */
  color: var(--bs-body-bg) !important;
}

/* Force all semantic badges to use our theme colors */
.bg-success { background-color: var(--bs-success) !important; }
.bg-danger { background-color: var(--bs-danger) !important; }
.bg-warning { background-color: var(--bs-warning) !important; }
.bg-info { background-color: var(--bs-info) !important; }
.bg-primary { background-color: var(--bs-primary) !important; }

/* -- 5.3.1 Ranking Badge Styles -- */
.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--bs-border-radius);
  background-color: var(--bs-secondary-bg);
  border: 1px solid var(--bs-border-color);
  font-weight: 600;
  color: var(--bs-body-color);
  white-space: nowrap;
  vertical-align: middle;
  margin: 0.25rem 0;
}

/* Size variants */
.rank-badge-xs {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  gap: 0.25rem;
  margin: 0.125rem 0;
}

.rank-badge-small {
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  gap: 0.3rem;
  margin: 0.25rem 0;
}

.rank-badge-medium {
  font-size: 0.875rem;
  padding: 0.4rem 0.8rem;
  gap: 0.35rem;
  margin: 0.25rem 0;
}

.rank-badge-large {
  font-size: 1rem;
  padding: 0.5rem 1rem;
  gap: 0.5rem;
  margin: 0.375rem 0;
}

/* Rank-based colors - Gold, Silver, Bronze */
.rank-badge.rank-1 {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  border-color: #FFD700;
  box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.rank-badge.rank-2 {
  background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
  color: #000;
  border-color: #C0C0C0;
  box-shadow: 0 2px 4px rgba(192, 192, 192, 0.3);
}

.rank-badge.rank-3 {
  background: linear-gradient(135deg, #CD7F32, #B8860B);
  color: #fff;
  border-color: #CD7F32;
  box-shadow: 0 2px 4px rgba(205, 127, 50, 0.3);
}

/* Loading state */
.rank-badge-loading {
  background-color: var(--bs-secondary-bg);
  border-color: var(--bs-border-color);
  opacity: 0.7;
}

/* Network stats card */
.network-stats-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.network-stats-summary {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem;
  background-color: var(--bs-tertiary-bg);
  border-radius: var(--bs-border-radius);
  border: 1px solid var(--bs-border-color);
}

.rank-display-large {
  flex-shrink: 0;
}

.rank-info h4 {
  color: var(--bs-body-color);
  margin-bottom: 0.5rem;
}

.rank-info p {
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.connection-stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background-color: var(--bs-tertiary-bg);
  border-radius: var(--bs-border-radius);
  border: 1px solid var(--bs-border-color);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--bs-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--bs-primary);
}

.network-stats-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.breakdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background-color: var(--bs-tertiary-bg);
  border-radius: var(--bs-border-radius);
  border: 1px solid var(--bs-border-color);
  text-align: center;
}

.breakdown-item i {
  font-size: 1.5rem;
  color: var(--bs-primary);
}

.breakdown-label {
  font-size: 0.875rem;
  color: var(--bs-text-muted);
  font-weight: 500;
}

.breakdown-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bs-body-color);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .network-stats-breakdown {
    grid-template-columns: 1fr;
  }

  .network-stats-summary {
    flex-direction: column;
    text-align: center;
  }

  .rank-badge-large {
    font-size: 1.1rem;
    padding: 0.4rem 0.8rem;
  }
}

/* -- 5.4 Component Overrides: Dropdowns -- */
.dropdown-menu {
  background-color: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color-translucent);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item {
  color: var(--bs-body-color);
}

.dropdown-item:hover, .dropdown-item:focus {
  background-color: var(--accent-hover);
  color: var(--bs-body-color);
}

/* Search Filter Button - Fix transparent background */
.messaging-panel #searchFilterDropdown {
  background-color: var(--bs-body-bg) !important;
  border: 1px solid var(--bs-border-color) !important;
  color: var(--bs-body-color) !important;
  opacity: 1 !important;
}

.messaging-panel #searchFilterDropdown:hover,
.messaging-panel #searchFilterDropdown:focus {
  background-color: var(--bs-tertiary-bg) !important;
  border-color: var(--bs-border-color) !important;
  color: var(--bs-body-color) !important;
}

/* Search Filter Dropdown - Following CSS Style Guide Rule #1 */
.messaging-panel .search-filter-dropdown {
  position: fixed !important; /* Changed from absolute to fixed to escape stacking context */
  right: 50px;
  top: 40px;
  background-color: var(--bs-body-bg) !important;
  border: 1px solid var(--bs-border-color) !important;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.25) !important;
  z-index: 9999 !important; /* Maximum z-index to appear above everything */
  min-width: 140px;
  opacity: 1 !important;
  backdrop-filter: none !important;
  border-radius: var(--bs-border-radius);
  padding: 0.25rem 0;
}

.messaging-panel .search-filter-dropdown .search-filter-item {
  color: var(--bs-body-color) !important;
  background-color: var(--bs-body-bg) !important;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: block;
  width: 100%;
  text-align: left;
  font-weight: 500;
  transition: background-color 0.15s ease;
}

.messaging-panel .search-filter-dropdown .search-filter-item:hover,
.messaging-panel .search-filter-dropdown .search-filter-item:focus,
.messaging-panel .search-filter-dropdown .search-filter-item.active {
  background-color: var(--accent-hover) !important;
  color: var(--bs-body-color) !important;
}

/* Conversation Context Dropdown - Following CSS Style Guide Rule #1 */
.conversation-context-menu {
  position: fixed !important;
  z-index: 1090 !important; /* Above conversation list and windows */
}

.conversation-context-dropdown {
  background-color: var(--bs-tertiary-bg) !important;
  border: 1px solid var(--bs-border-color-translucent) !important;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
  min-width: 160px;
}

.conversation-context-dropdown .dropdown-item {
  color: var(--bs-body-color) !important;
  background-color: transparent !important;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
  display: block;
}

.conversation-context-dropdown .dropdown-item:hover,
.conversation-context-dropdown .dropdown-item:focus {
  background-color: var(--accent-hover) !important;
  color: var(--bs-body-color) !important;
}

.conversation-context-dropdown .dropdown-item.text-danger {
  color: var(--bs-danger) !important;
}

.conversation-context-dropdown .dropdown-item.text-danger:hover,
.conversation-context-dropdown .dropdown-item.text-danger:focus {
  background-color: var(--bs-danger) !important;
  color: var(--bs-white) !important;
}

.conversation-context-dropdown .dropdown-divider {
  margin: 0.5rem 0;
  border-top: 1px solid var(--bs-border-color-translucent);
}

/* -- 5.5 Component Overrides: Nav Tabs (Definitive Fix 2.0) -- */

/* Admin tabs container - prevents collapsing to ~1px height */
.admin-tabs-container {
  min-height: 42px;
}

/* This is the primary layout container for the tabs themselves */
ul.nav-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 2px solid var(--bs-border-color);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--bs-border-color) var(--bs-tertiary-bg);
  /* Resetting default list styles */
  margin-bottom: 0;
  padding-left: 0;
  list-style: none;
}

ul.nav-tabs::-webkit-scrollbar { height: 6px; }
ul.nav-tabs::-webkit-scrollbar-track { background: var(--bs-tertiary-bg); }
ul.nav-tabs::-webkit-scrollbar-thumb { background-color: var(--bs-border-color); border-radius: 6px; }

/* THE CRITICAL FIX: Prevents tabs from shrinking and overlapping */
ul.nav-tabs > .nav-item {
  flex-shrink: 0;
}

/* Styling for the links/buttons inside the tabs */
.nav-tabs .nav-link {
  color: var(--bs-text-muted) !important;
  background: none !important;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-weight: 500;
  white-space: nowrap; /* Prevent tab text from wrapping */
  transition: border-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.nav-tabs .nav-link:not(.active):hover {
  border-color: var(--accent-hover);
  color: var(--bs-body-color) !important;
}

.nav-tabs .nav-link.active {
  color: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
  font-weight: 600;
}

/* Specific styles for tabs inside a sidebar context */
.sidebar-tabs {
  border-bottom: 1px solid var(--bs-border-color);
  margin-bottom: 1rem;
}

.sidebar-tabs .nav-link {
  padding: 0.5rem 0.5rem; /* Further reduced horizontal padding */
  font-size: 0.75rem;     /* Further reduced font size */
  line-height: 1.2;       /* Tighter line height */
  /* We are removing white-space: nowrap; to allow natural stacking if needed */
}

/* Neutralize the rogue paginated-tabs container */
.paginated-tabs {
  border-bottom: 1px solid var(--bs-border-color);
  margin-bottom: 1rem;
}

/* Force the UL inside it to behave like our other tabs */
.paginated-tabs .nav-tabs {
    border-bottom: none; /* The parent now has the border */
}

/* -- 5.6 Component Overrides: Statistic Cards -- */
.stat-card-row {
  display: flex;
  flex-wrap: wrap; /* Allows wrapping on smaller screens */
  gap: 0.5rem; /* Creates space between cards - reduced to fit more cards */
  align-items: stretch; /* CRITICAL: Makes all cards in a row the same height */
}

.stat-card {
  flex: 1 1 100px; /* Flex-grow, flex-shrink, and base width - further reduced for narrower cards */
  display: flex;
  flex-direction: column; /* Align content vertically */
  justify-content: center; /* Center content vertically */
  align-items: center; /* Center content horizontally */
  padding: 1rem 0.25rem; /* Minimal horizontal padding to prevent wrapping */
  border-radius: 8px;
  background-color: var(--bs-tertiary-bg); /* Use a subtle background */
  border: 1px solid var(--bs-border-color);
  text-align: center;
  min-width: 0; /* Allow flex items to shrink below content size */
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent-primary);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.9rem;
  color: var(--bs-text-muted);
  font-weight: 500;
}

/* 6. Tables & Forms (Target: ~200 lines) */
/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  background-color: var(--bg-secondary);
}

.table th,
.table td {
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  text-align: left;
  vertical-align: middle; /* Set the global default to middle */
}

.table thead th {
  font-weight: 600;
  background-color: var(--bg-primary);
  border-bottom-width: 2px;
}

.table tbody tr:nth-of-type(even) {
  background-color: var(--bg-primary);
}

.table-striped > tbody > tr:nth-of-type(odd):hover,
.table-striped > tbody > tr:nth-of-type(even):hover {
    --bs-table-accent-bg: var(--bs-table-hover-bg); /* Use Bootstrap's own override variable */
    color: var(--bs-body-color);
    cursor: pointer;
}

/* Table row in edit mode - theme-aware highlight */
.table-row-editing {
    background-color: var(--bs-warning-bg-subtle) !important;
    border-left: 3px solid var(--bs-warning-border-subtle);
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-hover);
}

textarea.form-control {
  min-height: 120px;
}

/* 7. Utilities (Target: ~100 lines) */
/* Spacing */
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

/* Responsive Visibility */
.mobile-only {
  display: block;
}
.desktop-only {
  display: none;
}

@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
  .desktop-only {
    display: block !important;
  }
}

/* Link Utilities */
.link-accent {
  color: var(--accent-primary) !important;
  text-decoration: none;
}
.link-accent:hover {
  color: var(--accent-hover) !important;
  text-decoration: underline;
}



/* -- 7.3 Flexbox Grid Utilities -- */
.flex-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.flex-grid > .card {
  flex: 1 1 350px; /* ALLOW growing, allow shrinking, base width of 350px */
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.flex-grid > .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

[data-bs-theme="dark"] .flex-grid > .card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* Compact Card Modifier */
.flex-grid.is-compact .card {
  padding: 1rem; /* Reduce padding */
}

.flex-grid.is-compact .card h4 {
  font-size: 1.1rem; /* Smaller heading */
  margin-bottom: 0.25rem;
}

.flex-grid.is-compact .card p {
  font-size: 0.85rem; /* Smaller paragraph text */
  margin-bottom: 0;
}

.flex-grid.is-compact .card i {
    font-size: 1.5rem; /* Smaller icon */
    margin-bottom: 0.5rem;
}



/* 8. Must-Have Extras (Target: ~50 lines) */
/* -- 8.1 Toast Notifications -- */
/* ==========================================================================
   TOAST NOTIFICATION STYLES
   ========================================================================== */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Toast Notification Element */
.toast-notification {
    background: var(--bs-info);
    color: var(--bs-info-color);
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 250px;
    max-width: 350px;
    animation: slideInRight 0.3s ease-out;
    font-weight: 500;
}

/* Toast Types */
.toast-notification.success {
    background: var(--bs-success);
    color: var(--bs-success-color);
}

.toast-notification.error {
    background: var(--bs-danger);
    color: var(--bs-danger-color);
}

.toast-notification.warning {
    background: var(--bs-warning);
    color: var(--bs-warning-color);
}

.toast-notification.info {
    background: var(--bs-info);
    color: var(--bs-info-color);
}

/* Toast Content */
.toast-notification i {
    flex-shrink: 0;
}

.toast-notification span {
    flex: 1;
}

/* Toast Close Button */
.toast-notification button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
}

.toast-notification button:hover {
    opacity: 0.8;
}

/* Toast Animation */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Toast Exit Animation */
.toast-notification.slide-out {
    animation: slideInRight 0.3s ease-out reverse;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast-notification {
        min-width: auto;
        max-width: none;
    }
}

/* Theme-specific adjustments */
[data-bs-theme="dark"] .toast-notification {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

[data-bs-theme="light"] .toast-notification {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* -- 8.2 Loading Spinners -- */
/* ==========================================================================
   LOADING SPINNER STYLES
   ========================================================================== */

/* ===== GENERAL SPINNER STYLES ===== */

/* Bootstrap Spinner Override - Ensure spinners use theme colors */
.spinner-border {
    color: var(--theme-accent-primary) !important;
}

.spinner-border.text-primary {
    color: var(--theme-accent-primary) !important;
}

/* Small spinner variant */
.spinner-border-sm {
    /* Inherits from Bootstrap with theme colors */
}

/* ===== LOADING PROGRESS CIRCLE ===== */

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: var(--theme-accent-primary) !important;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--theme-bg-tertiary) !important; /* stroke-dasharray: calc(3.141592653589793 * 40px); */ /* Needs to be dynamic or removed */
        }

.loading-progress-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    text-align: center;
    line-height: 7.5rem;
    font-size: 1rem;
    color: var(--theme-text-secondary) !important;
}

/* ===== BASIC LOADING SPINNER ===== */

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Add your spinner styles here */
    z-index: 1; /* Ensure it's on top */
}

.loading-text {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--bs-body-color);
}

/* ===== GRAPH LOADING STATES ===== */

/* Graph container loading state */
.dashboard-content-actual > .graph-container.loading-graph {
    position: relative;
    min-height: 200px;
}

/* Loading overlay for graph */
.loading-graph::before { /* Overlay */
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--theme-bg-secondary-transparent, rgba(37, 42, 51, 0.8)); /* Themed overlay, needs var definition */
    z-index: 5;
        display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px; /* Match parent */
}

[data-bs-theme="light"] .loading-graph::before {
    background-color: var(--theme-bg-secondary-transparent, rgba(255, 255, 255, 0.8)); /* Lighter overlay */
}

/* Graph loading spinner */
.loading-graph::after { /* Spinner */
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    /* transform: translate(-50%, -50%); /* Animation handles this now */
    width: 40px;
    height: 40px;
    border: 4px solid var(--theme-bg-tertiary); /* Spinner track color */
    border-top: 4px solid var(--theme-accent-primary); /* Spinner active color */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 6;
}

/* ===== SPIN ANIMATION ===== */

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ===== TAB LOADING INDICATORS ===== */

/* Tab loading spinner */
        .paginated-connections > .pagination-tabs > .tab-button .tab-loading i.spin {
            animation: spin 1s linear infinite;
}

/* ===== SPECIFIC CONTEXT SPINNERS ===== */

/* Reports page spinners */
.reports-list-content .spinner-border,
.report-viewer-content .spinner-border {
    color: var(--theme-accent-primary) !important;
}

/* Paginated connections spinner */
        .paginated-connections > .tab-content .spinner-border-sm {
            color: var(--theme-accent-primary) !important;
        }

/* Right sidebar card spinner */
.right-sidebar .card.mb-3.shadow-sm > .card-body .spinner-border {
    color: var(--theme-accent-primary) !important;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */

@media (max-width: 768px) {
    .loading-progress {
        width: 6rem;
        height: 6rem;
        margin: 15vh auto 1rem auto;
    }
    
    .loading-progress-text {
        line-height: 5.5rem;
        font-size: 0.9rem;
    }
    
    .loading-graph::after {
        width: 32px;
        height: 32px;
        border-width: 3px;
    }
}

/* ===== THEME-SPECIFIC ADJUSTMENTS ===== */

[data-bs-theme="dark"] .loading-text {
    color: var(--theme-text-primary);
}

[data-bs-theme="light"] .loading-text {
        color: var(--theme-text-primary);
    }

/* ===== ACCESSIBILITY ===== */

/* Screen reader only text for loading states */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== LOADING STATE UTILITIES ===== */

/* Hide content while loading */
.loading-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Show loading indicator */
.loading-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Loading container */
.loading-container {
    position: relative;
    min-height: 100px;
}

/* Loading overlay for any container */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--theme-bg-secondary-transparent, rgba(37, 42, 51, 0.8));
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: inherit;
}

[data-bs-theme="light"] .loading-overlay {
    background-color: var(--theme-bg-secondary-transparent, rgba(255, 255, 255, 0.8));
}

/* -- 8.3 Form Validation -- */
/* ==========================================================================
   FORM VALIDATION STYLES
   ========================================================================== */

/* ===== BASIC VALIDATION FEEDBACK ===== */

/* Valid state styling */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--theme-success-color);
}

/* Invalid state styling */
.invalid {
    outline: 1px solid var(--theme-danger-color);
}

/* Validation message styling */
.validation-message {
    color: var(--theme-danger-color);
}

/* ===== BOOTSTRAP VALIDATION CLASSES ===== */

/* Bootstrap valid state */
.is-valid {
    border-color: var(--theme-success-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--theme-success-color-rgb), 0.25) !important;
}

/* Bootstrap invalid state */
.is-invalid {
    border-color: var(--theme-danger-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--theme-danger-color-rgb), 0.25) !important;
}

/* Valid feedback message */
.valid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--theme-success-color) !important;
}

/* Invalid feedback message */
.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--theme-danger-color) !important;
}

/* ===== FORM CONTROL VALIDATION STATES ===== */

/* Form control valid state */
.form-control.is-valid {
    border-color: var(--theme-success-color) !important;
    padding-right: calc(1.5em + 0.75rem) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23" + var(--bs-success) + "' d='m2.3 6.73.94-.94 2.89 2.89 2.89-2.89.94.94L6.12 9.62z'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right calc(0.375em + 0.1875rem) center !important;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem) !important;
}

/* Form control invalid state */
.form-control.is-invalid {
    border-color: var(--bs-danger) !important;
    padding-right: calc(1.5em + 0.75rem) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23" + var(--bs-danger) + "'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 1.4 1.4m0-1.4-1.4 1.4'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right calc(0.375em + 0.1875rem) center !important;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem) !important;
}

/* Form select valid state */
.form-select.is-valid {
    border-color: var(--bs-success) !important;
    padding-right: 4.125rem !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23" + var(--bs-success) + "' d='m2.3 6.73.94-.94 2.89 2.89 2.89-2.89.94.94L6.12 9.62z'/%3e%3c/svg%3e"), url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e\") !important;
    background-position: right 0.75rem center, center right 2.25rem !important;
    background-size: 16px 12px, 16px 12px !important;
}

/* Form select invalid state */
.form-select.is-invalid {
    border-color: var(--theme-danger-color) !important;
    padding-right: 4.125rem !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23" + var(--theme-danger-color) + "'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 1.4 1.4m0-1.4-1.4 1.4'/%3e%3c/svg%3e"), url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e\") !important;
    background-position: right 0.75rem center, center right 2.25rem !important;
    background-size: 16px 12px, 16px 12px !important;
}

/* ===== INPUT GROUP VALIDATION ===== */

/* Input group valid state */
.input-group .form-control.is-valid,
.input-group .form-select.is-valid {
    z-index: 1;
}

/* Input group invalid state */
.input-group .form-control.is-invalid,
.input-group .form-select.is-invalid {
    z-index: 2;
}

/* Input group addon with validation */
.input-group .form-control.is-valid:focus,
.input-group .form-select.is-valid:focus,
.input-group .form-control.is-invalid:focus,
.input-group .form-select.is-invalid:focus {
    z-index: 3;
}

/* ===== CHECKBOX AND RADIO VALIDATION ===== */

/* Form check valid state */
.form-check-input.is-valid {
    border-color: var(--theme-success-color) !important;
}

.form-check-input.is-valid:checked {
    background-color: var(--theme-success-color) !important;
    border-color: var(--theme-success-color) !important;
}

.form-check-input.is-valid:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--theme-success-color-rgb), 0.25) !important;
}

/* Form check invalid state */
.form-check-input.is-invalid {
    border-color: var(--theme-danger-color) !important;
}

.form-check-input.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--theme-danger-color-rgb), 0.25) !important;
}

/* ===== VALIDATION SUMMARY ===== */

/* Validation summary container */
.validation-summary-errors {
    color: var(--theme-danger-color) !important;
    background-color: rgba(var(--theme-danger-color-rgb), 0.1) !important;
    border: 1px solid var(--theme-danger-color) !important;
    border-radius: 0.375rem !important;
    padding: 0.75rem 1rem !important;
    margin-bottom: 1rem !important;
}

/* Validation summary title */
.validation-summary-errors ul {
    margin-bottom: 0 !important;
    padding-left: 1.5rem !important;
}

.validation-summary-errors li {
    margin-bottom: 0.25rem !important;
}

/* ===== SEARCH FEEDBACK MESSAGES ===== */

/* Search feedback message base */
.search-feedback-message {
    width: 100%;
    text-align: center;
    padding: 10px;
    margin-top: 10px;
    font-size: 0.9em;
    border-radius: 4px;
}

/* Info feedback message */
    .search-feedback-message.info {
        background-color: rgba(var(--bs-info-rgb), 0.1);
        color: var(--theme-accent-primary);
        border: 1px solid var(--theme-accent-secondary);
    }

/* Warning feedback message */
    .search-feedback-message.warning {
        background-color: rgba(var(--bs-warning-rgb), 0.1);
        color: var(--theme-warning-color);
        border: 1px solid var(--theme-warning-color);
    }

/* Danger feedback message */
    .search-feedback-message.danger {
        background-color: rgba(var(--bs-danger-rgb), 0.1);
        color: var(--theme-danger-color);
        border: 1px solid var(--theme-danger-color);
    }

/* ===== FOCUS STATES WITH VALIDATION ===== */

/* Focus state for valid inputs */
.form-control.is-valid:focus,
.form-select.is-valid:focus {
    border-color: var(--theme-success-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--theme-success-color-rgb), 0.25) !important;
}

/* Focus state for invalid inputs */
.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: var(--theme-danger-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--theme-danger-color-rgb), 0.25) !important;
}

/* ===== RESPONSIVE VALIDATION ===== */

@media (max-width: 768px) {
    .valid-feedback,
    .invalid-feedback {
    font-size: 0.8em;
    }
    
    .validation-summary-errors {
        padding: 0.5rem 0.75rem;
    font-size: 0.9em;
    }
}

/* ===== THEME-SPECIFIC VALIDATION ===== */

/* Dark theme validation adjustments */
[data-bs-theme="dark"] .form-control.is-valid,
[data-bs-theme="dark"] .form-select.is-valid {
    background-color: rgba(var(--theme-success-color-rgb), 0.05) !important;
}

[data-bs-theme="dark"] .form-control.is-invalid,
[data-bs-theme="dark"] .form-select.is-invalid {
    background-color: rgba(var(--theme-danger-color-rgb), 0.05) !important;
}

/* Light theme validation adjustments */
[data-bs-theme="light"] .form-control.is-valid,
[data-bs-theme="light"] .form-select.is-valid {
    background-color: rgba(var(--theme-success-color-rgb), 0.02) !important;
}

[data-bs-theme="light"] .form-control.is-invalid,
[data-bs-theme="light"] .form-select.is-invalid {
    background-color: rgba(var(--theme-danger-color-rgb), 0.02) !important;
}

/* ===== ACCESSIBILITY ===== */

/* Screen reader only validation messages */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ARIA live regions for validation */
[aria-live="polite"] {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ===== VALIDATION UTILITIES ===== */

/* Hide validation messages by default */
.valid-feedback,
.invalid-feedback {
    display: none;
}

/* Show validation messages when needed */
.was-validated .form-control:valid,
.form-control.is-valid {
    border-color: var(--theme-success-color) !important;
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: var(--theme-danger-color) !important;
}

.was-validated .form-control:valid ~ .valid-feedback,
.form-control.is-valid ~ .valid-feedback {
    display: block;
}

.was-validated .form-control:invalid ~ .invalid-feedback,
.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* ===== CUSTOM VALIDATION STATES ===== */

/* Custom validation state for modified fields */
.field-validation-valid {
    display: none;
}

.field-validation-error {
    color: var(--theme-danger-color) !important;
    font-size: 0.875em;
    margin-top: 0.25rem;
}

/* Input validation error styling */
.input-validation-error {
    border-color: var(--theme-danger-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--theme-danger-color-rgb), 0.25) !important;
}

/* Input validation success styling */
.input-validation-success {
    border-color: var(--theme-success-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--theme-success-color-rgb), 0.25) !important;
}

/* -- 8.4 Modals (Definitive Fix) -- */

/* This targets the content area of ANY modal within our app and FORCES the background */
.modal .modal-content {
    background-color: var(--bs-tertiary-bg) !important;
    border: 1px solid var(--bs-border-color-translucent) !important;
    box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.2) !important;
}

/* ==========================================================================
   MODAL STYLES
   ========================================================================== */

/* ===== BOOTSTRAP MODAL VARIABLES ===== */

/* Dark theme modal variables */
:root {
    --bs-modal-bg: var(--theme-bg-secondary);
    --bs-modal-border-color: var(--theme-border-color);
    --bs-modal-header-border-color: var(--theme-border-color-light);
    --bs-modal-footer-border-color: var(--theme-border-color-light);
    --bs-modal-box-shadow: var(--theme-shadow-medium);
    --bs-modal-header-close-color: var(--theme-text-primary);
}

/* Light theme modal variables */
[data-bs-theme="light"] {
    --bs-modal-bg: var(--theme-bg-secondary);
    --bs-modal-border-color: var(--theme-border-color);
    --bs-modal-header-border-color: var(--theme-border-color-light);
    --bs-modal-footer-border-color: var(--theme-border-color-light);
    --bs-modal-header-close-color: var(--theme-text-primary);
}

/* ===== CORE MODAL STYLES ===== */

/* Core Modal Styles */
.modal-content {
  background-color: var(--bs-tertiary-bg) !important; /* FORCE the background color */
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: 8px;
  color: var(--bs-body-color);
}

/* Modal header styling */
.modal-header {
    background-color: var(--theme-bg-tertiary) !important; /* Override BS var if different header bg desired */
    border-bottom: 1px solid var(--bs-modal-header-border-color) !important;
        color: var(--theme-text-primary-high-contrast) !important;
    border-top-left-radius: 7px; /* If modal-content has 8px radius */
    border-top-right-radius: 7px;
}

.modal-header .modal-title {
            color: var(--theme-text-primary-high-contrast) !important;
    font-weight: 600;
        }

/* Modal body styling */
.modal-body {
        color: var(--theme-text-primary);
    padding: 1.5rem !important;
}

.modal-body p {
    color: var(--theme-text-primary);
}

.modal-body .text-muted {
        color: var(--theme-text-secondary) !important;
    }

/* Modal footer styling */
.modal-footer {
    background-color: var(--theme-bg-tertiary) !important; /* Override BS var if different footer bg desired */
    border-top: 1px solid var(--bs-modal-footer-border-color) !important;
    border-bottom-left-radius: 7px;
    border-bottom-right-radius: 7px;
}

/* Modal backdrop styling */
.modal-backdrop.show {
    opacity: 0.7 !important;
    background-color: var(--theme-bg-primary) !important; /* Or a darker semi-transparent color */
}

/* ===== CUSTOM MODAL STYLES ===== */

/* Custom Modal Styles & Fix for tabs alignment */
/* These should ideally be covered by global styles in app.css for .modal and .nav-tabs.
   If they are not, or if admin modals/tabs need to be different, then theme them here.
   Otherwise, consider removing them to avoid conflicts.
*/
.admin-dashboard .custom-modal { /* Assuming this is for a specific admin modal not using standard bootstrap */
    z-index: 1050;
    /* If it's a bootstrap modal, app.css should handle it. If custom, needs full theming. */
}

.admin-dashboard .custom-backdrop {
    z-index: 1040;
    position: fixed;
    top: 0;
    left: 0;
        width: 100%;
    height: 100%;
    background-color: var(--theme-bg-secondary-transparent); /* Themed backdrop */
}

/* ===== REPORT VIEWER MODAL STYLES ===== */

/* Share modal specific styling */
.report-viewer-content .modal-content {
    /* Specific styling for report viewer modals */
}

/* ===== MODAL RESPONSIVE BEHAVIOR ===== */

/* Mobile modal adjustments */
@media (max-width: 768px) {
    .modal-content {
        margin: 1rem;
        border-radius: 6px !important;
    }
    
    .modal-header {
        border-top-left-radius: 5px;
        border-top-right-radius: 5px;
    }
    
    .modal-footer {
        border-bottom-left-radius: 5px;
        border-bottom-right-radius: 5px;
    }
    
    .modal-body {
        padding: 1rem !important;
    }
}

/* ===== MODAL ANIMATIONS ===== */

/* Modal fade in animation */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: none;
}

/* ===== MODAL ACCESSIBILITY ===== */

/* Focus management for modals */
.modal:focus {
    outline: none;
}

.modal-content:focus {
    outline: 2px solid var(--theme-accent-primary);
    outline-offset: 2px;
}

/* ===== MODAL UTILITIES ===== */

/* Modal size utilities */
.modal-sm .modal-content {
    max-width: 400px;
}

.modal-lg .modal-content {
    max-width: 800px;
}

.modal-xl .modal-content {
    max-width: 1140px;
}

/* ===== MODAL THEME VARIATIONS ===== */

/* Dark theme specific modal adjustments */
[data-bs-theme="dark"] .modal-content {
    background-color: var(--bs-card-bg) !important;
    border-color: var(--theme-border-color) !important;
}

[data-bs-theme="dark"] .modal-header {
    background-color: var(--theme-bg-tertiary) !important;
    border-bottom-color: var(--theme-border-color-light) !important;
}

[data-bs-theme="dark"] .modal-footer {
    background-color: var(--theme-bg-tertiary) !important;
    border-top-color: var(--theme-border-color-light) !important;
}

/* Light theme specific modal adjustments */
[data-bs-theme="light"] .modal-content {
    background-color: var(--theme-bg-secondary) !important;
    border-color: var(--theme-border-color) !important;
}

[data-bs-theme="light"] .modal-header {
    background-color: var(--theme-bg-tertiary) !important;
    border-bottom-color: var(--theme-border-color-light) !important;
}

[data-bs-theme="light"] .modal-footer {
                background-color: var(--theme-bg-tertiary) !important;
    border-top-color: var(--theme-border-color-light) !important;
}

/* ===== TINYMCE DIALOG Z-INDEX FIX ===== */

/* Ensure TinyMCE dialogs appear above Bootstrap modals */
.tox-tinymce-aux,
.tox-dialog,
.tox-menu,
.tox-collection,
.moxman-window,
.tam-assetmanager-root {
  z-index: 999999 !important;
}

/* Ensure TinyMCE dialogs are positioned correctly */
.tox-dialog__body-content {
  position: relative;
  z-index: 999999 !important;
}

/* ===== MODAL CLOSE BUTTON STYLING ===== */

/* Close button styling */
.modal-header .btn-close {
    color: var(--bs-modal-header-close-color) !important;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-header .btn-close:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--theme-accent-primary-rgb), 0.25);
}

/* ===== MODAL SCROLLING ===== */

/* Modal body scrolling */
.modal-body {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Custom scrollbar for modal body */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--theme-bg-tertiary);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--theme-border-color);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--theme-text-secondary);
}

/* ===== MODAL FORM STYLING ===== */

/* Form elements within modals */
.modal-body .form-control,
.modal-body .form-select {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border-color) !important;
    color: var(--theme-text-primary) !important;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: var(--theme-accent-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--theme-accent-primary-rgb), 0.25) !important;
}

.modal-body .form-control::placeholder {
    color: var(--theme-text-secondary) !important;
}



/* ===== MODAL ALERT STYLING ===== */

/* Alert styling within modals */
.modal-body .alert {
    margin-bottom: 1rem;
    border-radius: 6px;
}

.modal-body .alert-success {
    background-color: rgba(var(--theme-success-color-rgb), 0.1) !important;
    border-color: var(--theme-success-color) !important;
    color: var(--theme-success-color) !important;
}

.modal-body .alert-danger {
    background-color: rgba(var(--theme-danger-color-rgb), 0.1) !important;
    border-color: var(--theme-danger-color) !important;
    color: var(--theme-danger-color) !important;
}

.modal-body .alert-warning {
    background-color: rgba(var(--theme-warning-color-rgb), 0.1) !important;
    border-color: var(--theme-warning-color) !important;
    color: var(--theme-warning-color) !important;
}

.modal-body .alert-info {
    background-color: rgba(var(--theme-accent-primary-rgb), 0.1) !important;
    border-color: var(--theme-accent-primary) !important;
    color: var(--theme-accent-primary) !important;
}

/* General modal content - but facebook modals override this */
.modal-content:not(.facebook-modal-content) {
    background-color: var(--bs-tertiary-bg) !important;
}

/* -- 8.5 Migrated Component Styles -- */

/* AdvancedMemberTargeting.razor */
.form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.badge {
    font-size: 0.75em;
}

.alert h6 {
    margin-bottom: 0.5rem;
}

/* People/Index.razor */
.person-thumbnail {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 50%;
}

.person-thumbnail-placeholder {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}



.admin-title {
    font-weight: 500;
}

.admin-dashboard {
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.admin-dashboard h3 {
}

.person-link {
    color: inherit;
    text-decoration: none;
}

.person-link:hover {
    color: var(--accent-primary);
}

.rank-number {
    font-weight: bold;
    display: inline-block;
    min-width: 20px;
    text-align: center;
}

/* Objects/Index.razor */
.object-thumbnail {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
}

.object-thumbnail-placeholder {
    width: 30px;
    height: 30px;
    border-radius: 4px;
}

.object-link {
    color: inherit;
    text-decoration: none;
}

.object-link:hover {
    color: var(--bs-primary);
}

/* Groups/Index.razor */
.group-link {
    color: inherit;
    text-decoration: none;
}

.group-link:hover {
    color: var(--bs-primary);
}

.person-thumbnail {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 50%;
}

.person-thumbnail-placeholder {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.admin-title {
    color: var(--bs-body-color);
    font-weight: 500;
}

.admin-dashboard {
    background-color: var(--bs-body-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.admin-dashboard h3 {
    color: var(--bs-body-color);
}

/* Feed/Components/PostCard.razor */
.cursor-pointer {
    cursor: pointer;
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: 0.375rem;
}

.video-container video {
    width: 100%;
    /* Remove max-height constraint to allow full vertical videos */
    object-fit: contain; /* Show full video without cropping */
    height: auto; /* Allow natural height */
}

/* ===== Facebook-Inspired Feed Styling ===== */

/* Post Card Body Styling (Card itself is defined above) */
.card-body {
    padding: 12px 16px;
}

/* Post Header - Author Name & Timestamp */
.card-body header h6 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3333;
    color: var(--bs-body-color);
    margin-bottom: 2px;
}

.card-body header time,
.card-body header .text-muted {
    font-size: 13px;
    color: var(--feed-text-muted);
    line-height: 1.2308;
}

/* Post Text Content - Facebook Style (16px) */
.post-text {
    font-size: 16px;
    line-height: 1.3333;
    color: var(--bs-body-color);
    margin-top: 4px;
    margin-bottom: 8px;
    word-wrap: break-word;
}

/* ===== Phase 2: Engagement Summary & Action Buttons ===== */
.engagement-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--feed-text-muted);
    margin-top: 8px;
    margin-bottom: 4px;
    padding: 0 8px;
}

.reactions-line {
    display: flex;
    align-items: center;
    gap: 6px;
}

.reactions-line .reaction-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--bs-body-bg);
    margin-left: -4px;
}

.reactions-line .reaction-icon:first-child {
    margin-left: 0;
}

.secondary-metrics {
    display: flex;
    gap: 12px;
}

.metric-item {
    cursor: pointer;
    transition: text-decoration 0.2s ease;
}

.metric-item:hover {
    text-decoration: underline;
}

/* Post Action Buttons - Facebook Style */
/* ===== Phase 2.2: Facebook-Style Action Buttons ===== */
.post-actions {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid var(--bs-border-color);
    border-bottom: 1px solid var(--bs-border-color);
    padding: 4px 0;
    margin-top: 12px;
    margin-left: -16px;
    margin-right: -16px;
}

.action-button {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--bs-secondary-color);
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 2px;
    position: relative;
}

/* ===== Phase 4.1: Consistent Hover States ===== */
.action-button:hover {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
}

.action-button:active {
    background-color: var(--bs-tertiary-bg);
    transform: scale(0.98);
    transition: transform 0.1s ease, background-color 0.1s ease;
}

/* Comment item hover */
.comment-item:hover {
    background-color: transparent;
}

.comment-item:hover .comment-bubble {
    background-color: var(--feed-hover-bg);
}

/* Author name hover */
.comment-author:hover,
.post-author:hover {
    text-decoration: underline;
    cursor: pointer;
}

/* Metric items hover */
.metric-item:hover {
    text-decoration: underline;
    cursor: pointer;
}

/* Reaction summary hover */
.reaction-total:hover {
    text-decoration: underline;
    cursor: pointer;
}

/* See more/View replies hover */
.see-more-btn:hover,
.view-replies:hover,
.view-more-comments:hover {
    text-decoration: underline;
    background-color: transparent;
}

.action-button.active {
    color: var(--bs-primary);
}

.action-button.active:hover {
    color: var(--bs-primary);
    background-color: var(--bs-primary-bg-subtle);
}

.action-icon {
    font-size: 18px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.action-button:hover .action-icon {
    transform: scale(1.1);
}

.action-button-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Facebook-Inspired Comment Styling ===== */

/* Comment Item Container */
.comment-item {
    margin-bottom: 12px;
}

/* Comment Avatar */
.comment-avatar {
    margin-right: 8px;
    flex-shrink: 0;
}

.comment-avatar img,
.comment-avatar .avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* Comment Content Wrapper */
.comment-content-wrapper {
    flex: 1;
    min-width: 0;
}

/* Comment Bubble (Background) */
.comment-bubble {
    background-color: var(--feed-comment-bg);
    border-radius: 18px;
    padding: 8px 12px;
    max-width: calc(100% - 40px);
    display: inline-block;
    word-wrap: break-word;
}

/* Comment Header (Author Name & Menu) */
.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
}

.comment-author {
    font-size: 15px;
    font-weight: 600;
    color: var(--bs-body-color);
    line-height: 1.3333;
    margin-right: 8px;
}

.comment-menu {
    margin-left: auto;
}

.comment-menu .btn-link {
    padding: 4px;
    color: var(--feed-text-muted);
    font-size: 16px;
}

.comment-menu .btn-link:hover {
    background-color: var(--feed-border-subtle);
    border-radius: 50%;
}

/* Comment Content Text - Facebook Style (16px) */
.comment-content-wrapper .comment-content,
.comment-bubble {
    font-size: 16px;
    line-height: 1.3333;
    color: var(--bs-body-color);
    word-wrap: break-word;
}

/* Comment Footer (Timestamp & Actions) */
.comment-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    padding-left: 4px;
}

.comment-timestamp {
    font-size: 13px;
    color: var(--feed-text-muted);
    line-height: 1.2308;
}

/* Comment Actions (Like, Reply) */
.comment-action {
    font-size: 13px;
    font-weight: 600;
    color: var(--feed-text-muted);
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.comment-action:hover {
    background-color: var(--feed-border-subtle);
    text-decoration: none;
}

/* ===== Phase 5.5: Enhanced Focus Management ===== */
.comment-action:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Comprehensive focus-visible styles for all interactive elements */
.action-button:focus-visible,
.comment-action:focus-visible,
.see-more-btn:focus-visible,
.view-more-comments:focus-visible,
.view-replies:focus-visible,
.reaction-button:focus-visible,
.comment-menu button:focus-visible,
.comment-input:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Remove default focus for mouse users (keep for keyboard) */
.action-button:focus:not(:focus-visible),
.comment-action:focus:not(:focus-visible),
.see-more-btn:focus:not(:focus-visible),
.view-more-comments:focus:not(:focus-visible),
.view-replies:focus:not(:focus-visible),
.reaction-button:focus:not(:focus-visible),
.comment-menu button:focus:not(:focus-visible) {
    outline: none;
}

/* Focus styles for comment items */
.comment-item:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 4px;
    border-radius: 8px;
}

/* Post card focus */
.card:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 4px;
    border-radius: 8px;
}

/* See More Button */
.see-more-btn {
    font-size: 13px;
    font-weight: 600;
    color: var(--feed-text-muted);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    margin-left: 4px;
}

.see-more-btn:hover {
    text-decoration: underline;
}

/* View Replies / View More Comments */
.view-replies,
.view-more-comments {
    font-size: 13px;
    font-weight: 600;
    color: var(--feed-text-muted);
    background: none;
    border: none;
    padding: 4px 0;
    cursor: pointer;
    margin-top: 4px;
}

.view-replies:hover,
.view-more-comments:hover {
    text-decoration: underline;
}

/* Comment Input */
.comment-input-container {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #E4E6EB;
}

.comment-input {
    background-color: var(--feed-comment-bg);
    border: none;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 15px;
    line-height: 1.3333;
    color: var(--bs-body-color);
    width: 100%;
    resize: none;
}

.comment-input:focus {
    outline: none;
    background-color: var(--feed-border-subtle);
}

.comment-input::placeholder {
    color: var(--feed-text-muted);
}

/* Dark Theme Adjustments - Now using CSS variables automatically */

/* ===== Priority 2: Keyboard Navigation & Focus Management ===== */

/* Focus indicators for all interactive elements */
.action-button:focus-visible,
.comment-action:focus-visible,
.see-more-btn:focus-visible,
.view-more-comments:focus-visible,
.view-replies:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Ensure buttons are keyboard accessible */
button:not(:disabled),
[role="button"]:not(:disabled) {
    cursor: pointer;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--bs-primary);
    color: var(--bs-white);
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* ===== Priority 3: Loading Skeletons (Facebook-Style) ===== */
.skeleton {
    background: linear-gradient(90deg, 
        var(--bs-secondary-bg) 0%, 
        var(--bs-tertiary-bg) 50%, 
        var(--bs-secondary-bg) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    opacity: 0.7;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Dark theme skeleton adjustments */
[data-bs-theme="dark"] .skeleton {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.05) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.05) 100%);
    background-size: 200% 100%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5rem;
}

.skeleton-text-short {
    width: 60%;
}

.skeleton-text-medium {
    width: 80%;
}

.skeleton-text-long {
    width: 100%;
}

.skeleton-comment {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    margin-bottom: 8px;
}

.comments-skeleton {
    padding: 8px 0;
}

.skeleton-comment-avatar {
    flex-shrink: 0;
}

.skeleton-comment-content {
    flex: 1;
}

.skeleton-post {
    padding: 12px 16px;
    margin-bottom: 12px;
    background-color: var(--bs-body-bg);
    border-radius: 8px;
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.skeleton-post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.skeleton-post-content {
    margin-bottom: 16px;
}

.skeleton-post-actions {
    display: flex;
    gap: 24px;
    padding-top: 12px;
    border-top: 1px solid var(--bs-border-color);
}

.skeleton-button {
    width: 80px;
    height: 32px;
    border-radius: 4px;
}

/* ===== Priority 3: Empty & Error States (Facebook-Style) ===== */
.empty-state,
.error-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background-color: var(--bs-body-bg);
    border-radius: 8px;
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
}

.empty-icon,
.error-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.6;
    color: var(--bs-secondary-color);
}

.error-icon {
    color: var(--bs-danger);
}

.empty-title,
.error-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--bs-body-color);
}

.empty-message,
.error-message {
    color: var(--bs-secondary-color);
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Dark theme adjustments */
[data-bs-theme="dark"] .empty-state,
[data-bs-theme="dark"] .error-state {
    background-color: var(--bs-secondary-bg);
}

[data-bs-theme="dark"] .empty-icon {
    color: var(--bs-secondary-color);
}

/* ===== Phase 4.2: Enhanced Mobile Responsiveness ===== */

/* Mobile adjustments (< 768px) */
@media (max-width: 767px) {
    /* Empty and Error States */
    .empty-state,
    .error-state {
        padding: 2rem 1rem;
        margin: 0.75rem 0;
    }
    
    .empty-icon,
    .error-icon {
        font-size: 3rem;
    }
    
    .empty-title,
    .error-title {
        font-size: 1.25rem;
    }
    
    /* Engagement Summary - Stack on mobile */
    .engagement-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        font-size: 12px;
        padding: 0 8px;
    }
    
    .secondary-metrics {
        gap: 8px;
        flex-wrap: wrap;
    }
    
    /* Post Actions - Enhanced touch targets */
    .post-actions {
        padding: 8px 0;
        gap: 4px;
        margin-left: -12px;
        margin-right: -12px;
    }
    
    .action-button {
        padding: 12px 8px;
        font-size: 14px;
        min-height: var(--mobile-touch-target-min);
        min-width: var(--mobile-touch-target-min);
        flex: 1;
        gap: 6px;
    }
    
    .action-icon {
        font-size: 18px;
    }
    
    /* Post Content */
    .post-text {
        font-size: 15px;
        line-height: 1.6;
        padding: 0 4px;
    }
    
    /* Comment improvements - Better spacing and touch targets */
    .comment-item {
        margin-bottom: 16px;
    }
    
    .comment-bubble {
        max-width: calc(100% - 8px);
        padding: 10px 14px;
        border-radius: 18px;
    }
    
    .comment-level-1 {
        margin-left: 20px;
        padding-left: 8px;
    }
    
    .comment-level-2,
    .comment-level-3,
    .comment-level-4,
    .comment-level-5 {
        margin-left: 40px;
        padding-left: 8px;
    }
    
    /* All interactive comment elements - 44px minimum */
    .comment-action,
    .see-more-btn,
    .view-replies,
    .view-more-comments,
    .comment-menu button {
        min-height: var(--mobile-touch-target-min);
        min-width: var(--mobile-touch-target-min);
        padding: 10px 12px;
        font-size: 14px;
        margin: 4px 0;
    }
    
    /* Comment input - Prevent iOS zoom */
    .comment-input {
        font-size: 16px;
        padding: 12px 14px;
        border-radius: 20px;
        min-height: var(--mobile-touch-target-min);
    }
    
    /* Reaction picker - Better mobile positioning */
    .reaction-picker-popup {
        left: 50%;
        transform: translateX(-50%);
        bottom: calc(100% + 8px);
    }
    
    /* Skeleton adjustments */
    .skeleton-comment {
        padding: 12px 0;
    }
    
    .skeleton-avatar {
        width: 36px;
        height: 36px;
    }
    
    .skeleton-post {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    /* Card spacing on mobile */
    .card {
        margin-bottom: 12px;
        padding: 0;
    }
    
    .card-body {
        padding: 12px;
    }
    
    /* Post header adjustments */
    .post-header {
        padding: 0 4px;
    }
}

.dropdown-menu {
    z-index: 1000;
}

/* ===== FEED COMPONENT DROPDOWN STYLES ===== */

/* PostCard and CommentCard dropdown containers 
 * These containers need lower z-index than the dropdown menu itself
 * to create proper stacking context for the dropdown to appear above */
.feed-dropdown-container {
    position: relative;
    z-index: calc(var(--z-index-dropdown) - 2); /* 998: Lower than dropdown menu */
}

/* PostCard and CommentCard dropdown menus
 * Slightly below standard dropdown to avoid conflicts with modals */
.feed-dropdown-menu {
    position: absolute;
    z-index: calc(var(--z-index-dropdown) - 1); /* 999: Just below standard dropdown (1000) */
}

/* ===== COMPONENT-SPECIFIC Z-INDEX OVERRIDES ===== */

/* Admin dashboard alert container
 * Uses standard modal z-index to appear above content but below high-priority modals */
.admin-alert-container {
    z-index: var(--z-index-modal-standard); /* 1050 */
}

/* Dashboard 3D help overlay
 * Low z-index for content-layer help overlay */
.dashboard-help-overlay {
    z-index: var(--z-index-content-low); /* 10 */
}

/* Admin template test modal
 * Uses Facebook-style modal z-index to appear above ALL content including containers with stacking contexts
 * This is the same approach used for post creation modals that need to appear above everything */
.modal.admin-template-test-modal.show.d-block {
    z-index: var(--z-index-modal-facebook-style) !important; /* 100000 - Above everything */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: var(--modal-backdrop-bg) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
}

/* Ensure modal dialog appears above the modal container */
.modal.admin-template-test-modal.show.d-block .modal-dialog {
    z-index: calc(var(--z-index-modal-facebook-style) + 1) !important; /* 100001 - Above modal container */
    position: relative !important;
    margin: 1.75rem auto !important;
}

/* Ensure modal content appears above dialog */
.modal.admin-template-test-modal.show.d-block .modal-content {
    z-index: calc(var(--z-index-modal-facebook-style) + 2) !important; /* 100002 - Above dialog */
    position: relative !important;
}

/* Backdrop should be below modal but above all other content */
.modal-backdrop.admin-template-test-backdrop.fade.show {
    z-index: calc(var(--z-index-modal-facebook-style) - 1) !important; /* 99999 - Below modal but above all other content */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: var(--modal-backdrop-bg) !important;
    opacity: 1 !important;
}

/* Admin template test modal form elements - Theme-aware styling following CSS guidelines */
.modal.admin-template-test-modal .form-select {
    background-color: var(--bs-body-bg) !important;
    border-color: var(--bs-border-color) !important;
    color: var(--bs-body-color) !important;
}

.modal.admin-template-test-modal .form-select:focus {
    background-color: var(--bs-body-bg) !important;
    border-color: var(--bs-primary) !important;
    color: var(--bs-body-color) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25) !important;
}

/* Ensure dropdown options have proper contrast */
.modal.admin-template-test-modal .form-select option {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

/* Ensure form controls in modal have proper contrast */
.modal.admin-template-test-modal .form-control {
    background-color: var(--bs-body-bg) !important;
    border-color: var(--bs-border-color) !important;
    color: var(--bs-body-color) !important;
}

.modal.admin-template-test-modal .form-control:focus {
    background-color: var(--bs-body-bg) !important;
    border-color: var(--bs-primary) !important;
    color: var(--bs-body-color) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25) !important;
}

/* Ensure labels have proper contrast */
.modal.admin-template-test-modal .form-label {
    color: var(--bs-body-color) !important;
}

/* ===== Facebook-Style Modal for Post Creation ===== */
.facebook-modal {
    animation: fadeIn 0.2s ease-out;
    background-color: var(--modal-backdrop-bg);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-index-modal-facebook-style) !important; /* Extremely high to appear above everything including sidebars */
}

/* Action modals that appear on top of main post creation modal */
.facebook-modal.facebook-action-modal {
    z-index: var(--z-index-modal-action) !important; /* Must be higher than main modal */
}

.facebook-modal-dialog {
    max-width: 500px;
    width: 90%;
    margin: 0 auto;
    height: auto !important; /* Ensure dialog can expand */
    max-height: none !important; /* Remove any max-height constraints */
}

.facebook-modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
    overflow: visible !important; /* Changed from hidden to visible to show all content */
    background-color: #ffffff !important; /* Solid white for light mode - override any conflicting styles */
    color: var(--bs-body-color) !important;
    display: flex !important; /* Use flexbox for proper layout */
    flex-direction: column !important; /* Stack header, body, footer vertically */
    height: auto !important; /* Ensure content can expand */
    max-height: none !important; /* Remove any max-height constraints */
}

/* Dark theme modal adjustments */
[data-bs-theme="dark"] .facebook-modal-content {
    background-color: var(--bs-body-bg) !important;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--feed-border-subtle);
}

/* Facebook modal header - must override general modal-header styles */
.modal-header.facebook-modal-header,
.facebook-modal-content .modal-header.facebook-modal-header {
    border-bottom: 1px solid var(--feed-border-subtle) !important;
    padding: 16px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: relative !important;
    background-color: #ffffff !important; /* Solid white for light mode - override any conflicting styles */
    color: var(--bs-body-color) !important;
}

/* Dark theme header */
[data-bs-theme="dark"] .modal-header.facebook-modal-header,
[data-bs-theme="dark"] .facebook-modal-content .modal-header.facebook-modal-header {
    background-color: var(--bs-body-bg) !important;
}

.facebook-modal-header .modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    text-align: center;
}

.facebook-modal-header .btn-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--feed-comment-bg);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    opacity: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    filter: none;
}

.facebook-modal-header .btn-close:hover {
    background-color: var(--feed-hover-bg);
}

.facebook-modal-header .btn-close::before {
    content: "×";
    font-size: 24px;
    line-height: 1;
    color: var(--bs-body-color);
    font-weight: 300;
}

.facebook-modal-header .btn-close {
    background-image: none;
}

.facebook-modal-body {
    padding: 16px;
    max-height: none !important; /* Remove max-height constraint to show all content */
    overflow-y: visible !important; /* Allow content to be fully visible */
    background-color: #ffffff !important; /* Solid white for light mode - override any conflicting styles */
    color: var(--bs-body-color) !important;
    flex: 1; /* Allow body to grow to fit content */
    min-height: auto !important; /* Ensure minimum height doesn't constrain content */
    display: flex; /* Use flexbox for content layout */
    flex-direction: column; /* Stack content vertically */
}

/* Ensure form inside modal body can expand */
.facebook-modal-body form {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-height: 0 !important; /* Allow form to shrink if needed */
    width: 100% !important;
}

/* Explicit styling for "Add to your post" section to ensure visibility */
.facebook-modal-body .border-top {
    border-top: 1px solid var(--feed-border-subtle) !important;
    margin-top: 12px !important;
    padding-top: 12px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
}

/* Make the "Add to your post" label more visible */
.facebook-modal-body .border-top .text-muted {
    color: var(--bs-body-color) !important; /* Make text more visible */
    font-weight: 600 !important;
    font-size: 15px !important;
}

/* Ensure action buttons container is visible */
.facebook-modal-body .border-top > div.d-flex.gap-2 {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
}

/* Ensure action buttons are visible */
.facebook-modal-body .facebook-post-action-btn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 2 !important;
}

/* Dark theme body */
[data-bs-theme="dark"] .facebook-modal-body {
    background-color: var(--bs-body-bg) !important;
}

/* Form controls in Facebook modals - theme-aware styling */
.facebook-modal-body .form-control,
.facebook-modal-body textarea,
.facebook-modal-body input[type="text"],
.facebook-modal-body .facebook-post-textarea,
.facebook-modal-body .facebook-comment-textarea {
    background-color: #ffffff !important; /* Solid white for light mode - override any conflicting styles */
    color: var(--bs-body-color) !important;
    border: 1px solid var(--feed-border-subtle) !important;
    border-radius: 8px;
}

/* Dark theme form controls */
[data-bs-theme="dark"] .facebook-modal-body .form-control,
[data-bs-theme="dark"] .facebook-modal-body textarea,
[data-bs-theme="dark"] .facebook-modal-body input[type="text"],
[data-bs-theme="dark"] .facebook-modal-body .facebook-post-textarea,
[data-bs-theme="dark"] .facebook-modal-body .facebook-comment-textarea {
    background-color: var(--bs-body-bg) !important;
}

.facebook-modal-body .form-control:focus,
.facebook-modal-body textarea:focus,
.facebook-modal-body input[type="text"]:focus,
.facebook-modal-body .facebook-post-textarea:focus,
.facebook-modal-body .facebook-comment-textarea:focus {
    background-color: #ffffff !important; /* Solid white for light mode - override any conflicting styles */
    color: var(--bs-body-color) !important;
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25) !important;
    outline: none;
}

/* Dark theme form controls focus */
[data-bs-theme="dark"] .facebook-modal-body .form-control:focus,
[data-bs-theme="dark"] .facebook-modal-body textarea:focus,
[data-bs-theme="dark"] .facebook-modal-body input[type="text"]:focus,
[data-bs-theme="dark"] .facebook-modal-body .facebook-post-textarea:focus,
[data-bs-theme="dark"] .facebook-modal-body .facebook-comment-textarea:focus {
    background-color: var(--bs-body-bg) !important;
}

.facebook-modal-body .form-control::placeholder,
.facebook-modal-body textarea::placeholder,
.facebook-modal-body input[type="text"]::placeholder,
.facebook-modal-body .facebook-post-textarea::placeholder,
.facebook-modal-body .facebook-comment-textarea::placeholder {
    color: var(--feed-text-muted);
}

/* Post media image styling - Facebook-style */
.post-media {
    width: 100%;
    margin: 0;
    border-radius: 8px;
    overflow: visible; /* Changed from hidden to allow full vertical images to display */
    background-color: var(--feed-comment-bg);
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.post-media-image {
    width: 100%;
    max-width: 100%;
    display: block;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    /* Use contain to show full image without cropping - works for both landscape and portrait */
    object-fit: contain;
    /* No max-height constraint - let vertical images show at their natural size */
    margin: 0 auto;
    background-color: var(--feed-comment-bg);
    /* Ensure image maintains aspect ratio and shows fully */
    height: auto;
}

/* For landscape images that are wider, we can optionally use cover for better fill */
/* But contain ensures no cropping, which is better for user experience */
.post-media-image:hover {
    opacity: 0.95;
}

/* Video container styling */
.post-media .video-container {
    width: 100%;
    position: relative;
    /* Remove fixed aspect ratio padding to allow natural video dimensions */
    /* padding-bottom: 56.25%; */
    /* height: 0; */
    background-color: var(--feed-comment-bg);
    border-radius: 8px;
    overflow: visible; /* Changed from hidden to show full video */
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.post-media .video-container video {
    /* Remove absolute positioning to allow natural sizing */
    /* position: absolute; */
    /* top: 0; */
    /* left: 0; */
    width: 100%;
    /* Remove fixed height - let video maintain aspect ratio */
    /* height: 100%; */
    object-fit: contain; /* Changed from cover to show full video without cropping */
    border-radius: 8px;
    max-height: none; /* Remove height constraints for vertical videos */
    height: auto; /* Allow natural height */
}

/* Facebook modal footer - must override general modal-footer styles */
.modal-footer.facebook-modal-footer,
.facebook-modal-content .modal-footer.facebook-modal-footer {
    border-top: 1px solid var(--feed-border-subtle) !important;
    padding: 12px 16px !important;
    justify-content: center !important;
    background-color: #ffffff !important; /* Solid white for light mode - override any conflicting styles */
    color: var(--bs-body-color) !important;
    flex-shrink: 0 !important; /* Prevent footer from shrinking */
    margin-top: auto !important; /* Push footer to bottom */
}

/* Dark theme footer */
[data-bs-theme="dark"] .modal-footer.facebook-modal-footer,
[data-bs-theme="dark"] .facebook-modal-content .modal-footer.facebook-modal-footer {
    background-color: var(--bs-body-bg) !important;
}

.facebook-post-textarea {
    font-size: 24px !important;
    line-height: 1.5;
}

.facebook-post-textarea::placeholder {
    color: var(--feed-text-muted);
    font-size: 24px;
}

/* Character counter styling */
.facebook-modal-body .character-counter {
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.facebook-modal-body .character-counter.text-warning {
    color: var(--bs-warning) !important;
}

.facebook-modal-body .character-counter.text-danger {
    color: var(--bs-danger) !important;
    font-weight: 600;
}

.facebook-post-action-btn {
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.facebook-post-action-btn:hover {
    background-color: var(--feed-hover-bg);
}

.facebook-post-submit-btn {
    background-color: var(--bs-primary);
    border: none;
    color: white;
    font-size: 15px;
}

.facebook-post-submit-btn:hover:not(:disabled) {
    background-color: var(--bs-primary);
    opacity: 0.9;
}

.facebook-post-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.post-create-trigger {
    transition: box-shadow 0.2s ease-in-out;
}

.post-create-trigger:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-create-placeholder {
    cursor: pointer;
}

.post-create-placeholder:focus {
    outline: none;
    box-shadow: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Comment Modal - Smaller than Post Modal */
.facebook-comment-modal-dialog {
    max-width: 400px;
}

.facebook-comment-textarea {
    font-size: 16px !important;
}

.facebook-comment-textarea::placeholder {
    font-size: 16px;
}

.comment-input-trigger {
    transition: background-color 0.2s;
}

.comment-input-trigger:hover {
    background-color: var(--feed-hover-bg);
    border-radius: 20px;
}

.comment-placeholder-input:focus {
    outline: none;
    box-shadow: none;
}

/* Mobile adjustments for Facebook modal */
@media (max-width: 767px) {
    .facebook-modal-dialog {
        max-width: 100%;
        width: 100%;
        margin: 0;
        height: 100vh;
        display: flex;
        align-items: flex-end;
    }
    
    .facebook-modal-content {
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        display: flex;
        flex-direction: column;
        overflow: visible; /* Ensure content is not clipped on mobile */
    }
    
    .facebook-modal-body {
        max-height: none; /* Remove max-height constraint on mobile */
        overflow-y: visible; /* Allow content to be fully visible */
    }
    
    .facebook-post-textarea {
        font-size: 20px !important;
    }
    
    .facebook-post-textarea::placeholder {
        font-size: 20px;
    }
    
    .facebook-comment-modal-dialog {
        max-width: 100%;
    }
}



/* -- 8.6 Inline Style Refactoring -- */

/* BetaCtaPanel.razor */
.alpha-cta-title {
    color: var(--connect-teal-primary) !important;
}

.alpha-cta-text {
    color: var(--bs-body-color) !important;
}

.alpha-cta-checkmark {
    color: var(--bs-primary) !important;
}

.alpha-cta-strong {
    color: var(--bs-body-color) !important;
}

/* Status.razor */
.status-container {
    height: calc(100vh - 80px);
    overflow-y: auto;
}

.status-card {
    background: var(--theme-bg-secondary);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-development {
    color: var(--bs-warning);
    font-weight: 500;
}

.status-production {
    color: var(--bs-success);
    font-weight: 500;
}

.status-checking {
    color: var(--bs-info);
    font-weight: 500;
}

.status-connected {
    color: var(--bs-success);
    font-weight: 500;
}

.status-disconnected {
    color: var(--bs-danger);
    font-weight: 500;
}

.status-success {
    color: var(--bs-success);
    font-size: 0.875rem;
    font-weight: 500;
}

.status-error {
    color: var(--bs-danger);
    font-size: 0.875rem;
    font-weight: 500;
}

.status-muted {
    color: var(--bs-text-muted);
    font-size: 0.875rem;
}

.status-refresh-btn {
    background-color: var(--bs-primary);
    color: var(--bs-white);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    margin-top: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s;
}

.status-refresh-btn:hover {
    background-color: var(--color-teal-dark);
}

/* ProfileBuilder.razor */
.profile-builder-guide-img {
    height: 40px;
    width: auto;
}

.profile-builder-textarea {
    border: 2px solid var(--bs-border-color);
    border-radius: 0.375rem;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.profile-builder-magic-icon {
    font-size: 1.3rem;
}

.profile-builder-title {
    font-size: 1.2rem;
}

.profile-builder-description {
    font-size: 0.98rem;
}

.profile-builder-close-btn {
    z-index: 2;
}

.profile-builder-header-icon {
    font-size: 1.8rem;
    margin-top: 0.2rem;
}

.profile-builder-header-title {
    color: var(--bs-white) !important;
    font-size: 1.8rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.profile-builder-header-description {
    font-size: 1rem;
    opacity: 0.85;
    line-height: 1.5;
}

.profile-builder-change-section-btn {
    border-width: 2px;
}

/* -- 8.7 ProfileImage Component Styles -- */

/* Base ProfileImage Container */
.profile-image {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  border: 1px solid var(--bs-border-color);
  background-color: var(--bs-tertiary-bg);
  overflow: hidden;
}

/* ProfileImage Inner Image */
.profile-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Post Create Avatar Container - Ensure proper sizing */
.post-create-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-create-avatar .profile-image-container {
  width: 40px !important;
  height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
}

.post-create-avatar .profile-image img {
  width: 40px !important;
  height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  object-fit: cover;
}

.semantic-response-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.semantic-info-panel,
.semantic-suggestion-panel {
  background-color: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  color: var(--bs-body-color);
  border-radius: var(--bs-border-radius);
  padding: 1rem;
}

.semantic-info-panel--guidance {
  border-left: 4px solid var(--bs-warning);
}

.semantic-info-panel--info {
  border-left: 4px solid var(--bs-info);
}

.semantic-suggestion-panel ul {
  margin-bottom: 0;
  padding-left: 1.25rem;
}

/* More robust fix for profile image proportions */
.profile-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Forces the image to cover the area without distortion */
}

/* Circular Display Style */
.profile-image-circle {
  border-radius: 50%;
}

/* Thumbnail Display Style */
.profile-image-thumbnail {
  border-radius: var(--bs-border-radius);
}

/* Size Variants */
.profile-image-xs {
  width: 32px;
  height: 32px;
}

.profile-image-sm {
  width: 88px;
  height: 88px;
}

.profile-image-md {
  width: 128px;
  height: 128px;
}

.profile-image-lg {
  width: 256px;
  height: 256px;
}

.profile-image-xl {
  width: 344px;
  height: 344px;
}

/* Loading Spinner */
.profile-image .loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid var(--bs-border-color);
  border-top: 2px solid var(--bs-primary);
  border-radius: 50%;
  animation: profile-image-spin 1s linear infinite;
}

@keyframes profile-image-spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* -- 8.8 Custom Utilities -- */

/* Custom Utilities */
.cursor-pointer {
  cursor: pointer;
}

/* -- 8.9 MainNav Component Styles -- */

/* MainNav Link Styles */
.main-nav-link {
  height: 100%;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 56px;
}

/* Navbar height for consistent navigation */
.navbar {
  height: 56px;
}

/* Dropdown toggle arrow alignment */
.dropdown-toggle::after {
  vertical-align: middle;
}

/* Styles for the simplified navbar on /test2 */
.test2-navbar {
  padding-top: 0.25rem; /* Reduced padding */
  padding-bottom: 0.25rem; /* Reduced padding */
}

.test2-navbar .nav-link {
  color: var(--bs-primary) !important;
}

/* -- 8.10 IntroductionPath Component Styles -- */

/* IntroductionPath Container */
.intro-path-container {
  border: 1px solid var(--bs-border-color);
  padding: 0.625rem;
  margin-top: 0.625rem;
  border-radius: var(--bs-border-radius);
  background-color: var(--bs-tertiary-bg);
}

/* IntroductionPath Steps Container */
.intro-path-steps {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
}

/* IntroductionPath Step Items */
.intro-path-step {
  padding: 0.5rem 0.75rem;
  margin: 0.25rem 0;
  background-color: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  transition: background-color 0.2s ease-in-out;
  cursor: pointer;
}

.intro-path-step:hover {
  background-color: var(--bs-tertiary-bg);
}

/* IntroductionPath Line (for visual connections) */
.intro-path-line {
  height: 1px;
  background-color: var(--bs-border-color);
  margin: 0.5rem 0;
  opacity: 0.6;
}

/*
-- 8.11 Fix for Connection Path Card Hover, Focus, & Active Bug --
This rule overrides Bootstrap's default styles for all interactive states on path cards.
It ensures sufficient contrast in light and dark modes by controlling the background and text color.
*/
.path-card:hover,
.path-card:focus,
.path-card.active {
  background-color: var(--bs-tertiary-bg) !important;
  color: var(--bs-body-color) !important;
}

/*
-- 8.12 Migrated from connection-chain.css --
These styles were migrated from connection-chain.css to comply with Rule #4 of the CSS Style Guide.
All colors and backgrounds have been made theme-aware using Bootstrap CSS variables.
*/
.connection-chain-container {
  padding: 1rem;
  max-width: 100%;
}

.connection-arrow {
  color: var(--bs-gray-500);
}

.entity-node {
  background-color: var(--bs-tertiary-bg);
  border-radius: var(--bs-border-radius);
}

.connection-line {
  position: relative;
}

.connection-details {
  background-color: var(--bs-tertiary-bg);
  border-radius: var(--bs-border-radius);
}

.path-card {
  cursor: pointer;
  transition: all 0.2s ease;
}

.path-card:hover {
  transform: translateY(-2px);
  /* Background color handled by the fix in section 8.11 */
}

.connection-chain-graph {
  overflow: hidden;
  background-color: var(--bs-tertiary-bg);
}

.selected-entity {
  background-color: var(--bs-tertiary-bg);
}

.entity-node .small,
.connection-details .small {
  opacity: 0.7;
}

/* ==================================
   4.3 Mobile-First Three-Column Layout
   ================================== */

/* BASE (Mobile) STYLES */
.mobile-header {
  display: flex; /* Mobile header is visible by default */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--mobile-header-height);
  background-color: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color);
  z-index: var(--mobile-header-z-index);
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem; /* Reduced padding to give more space for buttons */
  gap: 0.5rem; /* Add gap between sections */
  overflow: visible; /* Ensure all content is visible */
}

/* Mobile: Add padding-top to account for fixed mobile header */
@media (max-width: 767px) {
    .three-column-container {
        padding-top: var(--mobile-header-height);
    }
}

.left-sidebar,
.right-sidebar {
  position: fixed;
  top: var(--mobile-header-height); /* Start below mobile header */
  height: calc(100vh - var(--mobile-header-height)); /* Account for header height */
  z-index: var(--mobile-sidebar-z-index);
  background-color: var(--bs-body-bg);
  transition: transform var(--mobile-transition-speed) ease-in-out;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Ensure sidebar content is scrollable on mobile */
.left-sidebar .sidebar-menu-container {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: 0.5rem; /* Add top padding so first icon isn't at edge */
  padding-bottom: 4rem; /* Add bottom padding so last icon is scrollable */
}

.left-sidebar {
  width: var(--mobile-left-sidebar-width);
  left: 0;
  transform: translateX(-100%);
  border-right: 1px solid var(--border-color);
  z-index: 1000; /* Lower than dropdowns */
}

.right-sidebar {
  width: var(--mobile-right-sidebar-width);
  right: 0;
  transform: translateX(100%);
  border-left: 1px solid var(--border-color);
  padding: 1rem;
}

/* Active states for mobile are driven by the container */
.left-sidebar-active .left-sidebar,
.right-sidebar-active .right-sidebar {
    transform: translateX(0);
}

/* Mobile main content padding to ensure footer is visible */
@media (max-width: 767px) {
    .main-content {
        padding-bottom: 3rem; /* Add bottom padding for mobile to see footer */
        min-height: calc(100vh - var(--mobile-header-height)); /* Account for mobile header only */
    }
    
    /* Mobile: Limit graph height so content below is scrollable */
    #graph3d-container {
        height: 60vh !important; /* Limit to 60% of viewport height on mobile */
        max-height: 60vh !important;
    }
    
    /* Hide desktop feed container on mobile - BottomSheet handles it */
    /* Only hide feed containers that are NOT inside the bottom sheet */
    .main-content .feed-container,
    .three-col-main-content-slot .feed-container {
        display: none !important;
    }
    
    /* Allow feed container inside bottom sheet to display */
    .bottom-sheet-content .feed-container {
        display: block !important;
    }
}

/* TABLET & DESKTOP OVERRIDES (min-width) */
@media (min-width: 768px) {
    .mobile-header {
        display: none; /* Hide mobile header on larger screens */
    }

    .three-column-container {
        display: flex;
        flex-grow: 1;
        min-height: 0;
        padding-top: 0; /* Remove mobile padding */
    }

    .left-sidebar {
        position: relative; /* Changed from static to relative for tooltip positioning */
        transform: translateX(0);
        flex-shrink: 0;
        top: 0; /* Reset top position for desktop */
        height: auto; /* Reset height for desktop */
        z-index: 1000; /* Lower than dropdowns to allow them to appear above */
    }

    /* Reset sidebar padding for desktop */
    .left-sidebar .sidebar-menu-container {
        padding-top: 0;
        padding-bottom: 0;
    }
    
    .right-sidebar {
        position: relative;
        transform: translateX(0);
        flex-shrink: 0;
        top: 0; /* Reset top position for desktop */
        height: auto; /* Reset height for desktop */
        z-index: 1000; /* Lower than dropdowns (10005) but above content */
    }

    .left-sidebar {
        width: 70px; /* Restore original desktop width */
    }

    .right-sidebar {
        width: 350px; /* Restore original desktop width */
    }

    .main-content {
        flex: 1;
        overflow-y: auto;
        padding: 1rem;
        padding-bottom: 1rem; /* Reset mobile padding for desktop */
    }

    /*
        ====================================================================
        AGGRESSIVE GRAPH CONTAINER SIZING - DEFINITIVE FIX V2
        ====================================================================
    */

    /* Force the body and the main app container to occupy the full height */
    html, body, #app {
        height: 100%;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
        overflow-y: auto;
    }

    /* Make the MainLayout and its content take up all available space */
    .page {
        display: flex;
        flex-direction: column;
        min-height: 100vh; /* Minimum viewport height, but allow growth */
    }

    main {
        flex-grow: 1; /* This is crucial, it makes the main content area expand */
        display: flex;
        flex-direction: column;
        min-height: 0; /* A flexbox trick to prevent overflow issues */
    }

    /* The known parent from the component hierarchy */
    .three-column-container {
        flex-grow: 1;
        display: flex;
        min-height: 0;
    }

    /* The direct parent of the graph element */
    .graph-container-parent {
        flex-grow: 1;
        display: flex;
        position: relative;
        min-height: 400px; /* Absolute fallback size */
    }

    /* The graph div itself */
    #graph {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

/* Mobile Header Component Styles */
.mobile-logo {
  flex: 1; /* Allow logo to take available space */
  min-width: 0; /* Allow shrinking if needed */
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-logo a {
  font-weight: bold;
  font-size: 1.1rem; /* Slightly smaller font */
  color: var(--bs-body-color);
  text-decoration: none;
  white-space: nowrap;
}

/* Mobile Header Actions Container */
.mobile-header-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px; /* Reduced gap to fit more buttons */
  flex-shrink: 0; /* Prevent shrinking */
  overflow: visible; /* Ensure all buttons are visible */
}

/* Ensure NotificationBell and TokenBalanceWidget fit in mobile header */
.mobile-header-actions .notification-bell-container,
.mobile-header-actions .token-widget-container {
  display: flex;
  align-items: center;
}

.mobile-header-actions .nav-action-button {
  min-width: 40px;
  min-height: 40px;
  width: 40px;
  height: 40px;
  padding: 8px;
  font-size: 16px; /* Smaller font for NotificationBell and TokenBalanceWidget */
  flex-shrink: 0; /* Prevent shrinking */
}

/* Mobile: Hide token widget text, show icon only */
@media (max-width: 767px) {
  .mobile-header-actions .token-widget-container .token-widget-button {
    min-width: 40px;
    width: 40px;
    padding: 8px;
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }
  
  .mobile-header-actions .token-widget-container .token-widget-text,
  .mobile-header-actions .token-widget-container .token-widget-label,
  .mobile-header-actions .token-widget-container .token-widget-amount {
    display: none !important; /* Hide text on mobile */
  }
  
  /* Show icon for all token widget states */
  .mobile-header-actions .token-widget-container .token-widget-icon,
  .mobile-header-actions .token-widget-container .fa-coins,
  .mobile-header-actions .token-widget-container .fa-sync,
  .mobile-header-actions .token-widget-container .fa-exclamation-triangle {
    display: block !important;
    font-size: 18px;
    margin: 0;
    line-height: 1;
  }
  
  /* Admin unlimited tokens - show infinity icon */
  .mobile-header-actions .token-widget-button-admin .token-widget-icon {
    display: block !important;
    font-size: 18px;
  }
}

/* Mobile Header Buttons */
.mobile-header-btn {
  position: relative;
  padding: 8px; /* Reduced padding to fit more buttons */
  background: none;
  border: none;
  color: var(--bs-body-color);
  font-size: 18px; /* Slightly smaller font */
  min-width: 40px; /* Slightly smaller minimum width */
  min-height: 40px; /* Slightly smaller minimum height */
  width: 40px; /* Fixed width for consistency */
  height: 40px; /* Fixed height for consistency */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
  flex-shrink: 0; /* Prevent button from shrinking */
}

.mobile-header-btn:hover,
.mobile-header-btn:focus {
  background-color: var(--bs-tertiary-bg);
  color: var(--bs-primary);
}

.mobile-header-btn:active {
  background-color: var(--bs-secondary-bg);
  transform: scale(0.95);
}

/* Mobile Notification Badge */
.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: var(--bs-danger);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bs-body-bg);
  z-index: 10;
}


/* Sidebar Header & Close Button */
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--bs-border-color);
}

.sidebar-title {
    margin-bottom: 0;
}

.sidebar-close-btn {
  background: none;
  border: none;
  color: var(--bs-secondary-color);
  font-size: 1.75rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  opacity: 0.7;
  cursor: pointer;
}

.sidebar-close-btn:hover {
    opacity: 1;
}

.hamburger-btn, .network-btn {
  background: none;
  border: none;
  color: var(--bs-body-color);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  min-width: var(--mobile-touch-target-min);
  min-height: var(--mobile-touch-target-min);
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

/* Hamburger Icon Lines */
.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--bs-body-color);
  border-radius: 2px;
}

/* Search Results Icons */
.search-results-icons-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 0;
}

.entity-icon-btn {
    /* Set a fixed size for the button container */
    width: 50px;
    height: 50px;
    
    /* Remove any padding or borders that might interfere */
    padding: 0;
    border: none;
    background-color: transparent;
    
    /* Ensure the button is circular */
    border-radius: 50%;
    
    /* Prevent the container from shrinking */
    flex-shrink: 0;
    
    /* Add a subtle hover effect */
    transition: transform 0.2s ease-in-out;
}

.entity-icon-btn:hover {
    transform: scale(1.1);
}

/* Pagination styling improvements */
.search-pagination {
  margin-top: 1rem;
  gap: 0.5rem;
}

/* Pagination buttons - Theme-aware with proper contrast (WCAG 2.1 AA: 4.5:1) */
.btn-pagination {
  border-radius: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  /* Use outline button styles by default - will be overridden by btn-outline-primary */
  background: transparent;
  border: 1px solid currentColor;
}

.btn-pagination:hover:not(:disabled) {
  opacity: 0.85;
}

.btn-pagination:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Dark theme override for pagination buttons - ensure high contrast */
[data-bs-theme="dark"] .btn-pagination {
  /* In dark mode, ensure buttons use white text/border for maximum contrast */
  color: var(--bs-body-color); /* White text */
  border-color: var(--bs-body-color); /* White border */
  background: transparent;
}

[data-bs-theme="dark"] .btn-pagination:hover:not(:disabled) {
  background: var(--bs-body-color); /* White background on hover */
  color: var(--bs-body-bg); /* Black text on hover */
  border-color: var(--bs-body-color);
}

[data-bs-theme="dark"] .btn-pagination:disabled {
  color: var(--bs-text-muted); /* Muted text for disabled */
  border-color: var(--bs-text-muted);
  background: transparent;
  opacity: 0.5;
}

.pagination-info {
  color: var(--bs-body-color);
  font-size: 0.875rem;
  font-weight: 500;
}

/* ========================================
   LANDING PAGE ANALYTICS STYLES
   Following CSS Style Guide Rules
   ======================================== */

/* Landing Page Stats Variables */
:root {
  /* Landing page specific variables */
  --landing-card-padding-mobile: 0.75rem;
  --landing-card-padding-tablet: 1rem;
  --landing-card-padding-desktop: 1.25rem;
  --landing-card-gap: 1rem;
  --landing-value-size-mobile: 1.5rem;
  --landing-value-size-desktop: 1.75rem;
  --landing-title-color: var(--bs-body-color);
  --landing-subtitle-color: var(--bs-secondary-color);
  --landing-accent-color: var(--bs-primary);
}

/* Landing Stats Container */
.landing-stats-container {
  background-color: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg);
  padding: var(--landing-card-padding-mobile);
  margin-bottom: var(--bs-gutter-y);
  box-shadow: var(--bs-box-shadow-sm);
}

/* Landing Stats Title */
.landing-stats-title {
  color: var(--landing-title-color);
  font-weight: 600;
  margin-bottom: var(--landing-card-gap);
  font-size: 1.25rem;
}

/* Summary Cards Grid - Mobile First */
.landing-stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--landing-card-gap);
  margin-bottom: calc(var(--landing-card-gap) * 1.5);
}

/* Individual Stat Cards */
.landing-stat-card {
  background-color: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  padding: var(--landing-card-padding-mobile);
  text-align: center;
  transition: border-color 0.15s ease-in-out;
}

.landing-stat-card:hover {
  border-color: var(--landing-accent-color);
}

.landing-stat-card-title {
  margin: 0 0 0.5rem 0;
  color: var(--landing-subtitle-color);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.landing-stat-card-value {
  font-size: var(--landing-value-size-mobile);
  font-weight: 700;
  color: var(--landing-accent-color);
  display: block;
  line-height: 1.2;
}

/* Page Performance Breakdown */
.landing-page-breakdown,
.landing-utm-breakdown {
  margin-top: calc(var(--landing-card-gap) * 1.5);
}

.landing-breakdown-title {
  color: var(--landing-title-color);
  font-weight: 600;
  margin-bottom: var(--landing-card-gap);
  font-size: 1.1rem;
}

.landing-utm-subtitle {
  color: var(--landing-subtitle-color);
  font-weight: 500;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

/* Table Enhancements */
.landing-performance-table,
.landing-utm-table {
  --bs-table-bg: var(--bs-tertiary-bg);
  margin-bottom: 0;
}

.landing-performance-table th,
.landing-utm-table th {
  background-color: var(--bs-secondary-bg);
  color: var(--bs-emphasis-color);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  border-bottom: 2px solid var(--bs-border-color);
}

.landing-performance-table td,
.landing-utm-table td {
  color: var(--bs-body-color);
  vertical-align: middle;
  font-size: 0.9rem;
}


/* Bulk Operations UI (Sprint 3 - P1-3) */
.bulk-action-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: var(--bs-secondary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 6px;
  flex-wrap: wrap;
}

.bulk-action-bar .selected-count {
  font-weight: 600;
  color: var(--bs-primary);
  margin-right: auto;
}

.connection-request-card.selected {
  border-color: var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.05);
  box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.1);
}

.card-checkbox {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
}

.card-checkbox input[type=checkbox] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.bulk-actions .form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.bulk-actions .form-check-input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin: 0;
}

.bulk-actions .form-check-label {
  cursor: pointer;
  user-select: none;
  margin: 0;
}
/* Loading State */
.landing-stats-loading {
  text-align: center;
  padding: calc(var(--landing-card-gap) * 2);
  color: var(--landing-subtitle-color);
}

.landing-stats-loading .spinner-border {
  margin-right: 0.5rem;
}

/* Debug Info */
.landing-debug-info {
  margin-top: calc(var(--landing-card-gap) * 1.5);
  padding: 0.75rem;
  background-color: var(--bs-light-bg-subtle);
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: var(--bs-border-radius);
}

/* Dark Theme Overrides */
[data-bs-theme="dark"] {
  --landing-title-color: var(--bs-body-color);
  --landing-subtitle-color: var(--bs-secondary-color);
  --landing-accent-color: var(--bs-info);
}

[data-bs-theme="dark"] .landing-debug-info {
  background-color: var(--bs-dark-bg-subtle);
}

/* Tablet Responsive (768px+) */
@media (min-width: 768px) {
  .landing-stats-container {
    padding: var(--landing-card-padding-tablet);
  }
  
  .landing-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .landing-stat-card {
    padding: var(--landing-card-padding-tablet);
  }
  
  .landing-stat-card-value {
    font-size: var(--landing-value-size-desktop);
  }
  
  .landing-stats-title {
    font-size: 1.375rem;
  }
}

/* Desktop Responsive (1024px+) */
@media (min-width: 1024px) {
  .landing-stats-container {
    padding: var(--landing-card-padding-desktop);
  }
  
  .landing-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .landing-stat-card {
    padding: var(--landing-card-padding-desktop);
  }
  
  .landing-stats-title {
    font-size: 1.5rem;
  }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
  .landing-stat-card {
    transition: none;
  }
}

/* Print Styles */
@media print {
  .landing-stats-container {
    border: none;
    box-shadow: none;
    page-break-inside: avoid;
  }
  
  .landing-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .landing-debug-info {
    display: none;
  }
  
  .landing-refresh-controls {
    display: none;
  }
  
  .landing-refresh-info {
    display: none;
  }
}

/* Refresh Controls */
.landing-refresh-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.landing-refresh-select {
  min-width: 120px;
  font-size: 0.875rem;
}

.landing-refresh-countdown {
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  min-width: 60px;
  text-align: center;
}

.landing-refresh-countdown i {
  margin-right: 0.25rem;
  opacity: 0.7;
}

.landing-refresh-btn {
  white-space: nowrap;
  min-width: 80px;
}

.landing-refresh-btn:disabled {
  opacity: 0.6;
}

.landing-refresh-info {
  background-color: var(--bs-light-bg-subtle);
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: var(--bs-border-radius);
  padding: 0.5rem 0.75rem;
  margin-bottom: var(--landing-card-gap);
}

[data-bs-theme="dark"] .landing-refresh-info {
  background-color: var(--bs-dark-bg-subtle);
}

/* Mobile Responsive for Refresh Controls */
@media (max-width: 767px) {
  .landing-refresh-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .landing-refresh-controls > div {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .landing-refresh-select {
    min-width: auto;
  }
  
  .landing-refresh-countdown {
    text-align: left;
    min-width: auto;
  }
}

/* Auto-refresh animation */
@keyframes refresh-pulse {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

.landing-refresh-countdown i {
  animation: refresh-pulse 2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .landing-refresh-countdown i {
    animation: none;
  }
}

/* -------------------------------------------------- */
/* SIDEBAR PANELS & GUIDE SECTIONS                   */
/* -------------------------------------------------- */

/* Sidebar Panel Components */
.sidebar-panel {
  background-color: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  margin-bottom: 1rem;
  overflow: hidden;
}

.sidebar-panel-header {
  background-color: var(--bs-secondary-bg);
  border-bottom: 1px solid var(--bs-border-color);
  padding: 0.75rem 1rem;
}

.sidebar-panel-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bs-body-color);
  display: flex;
  align-items: center;
}

.sidebar-panel-body {
  padding: 1rem;
}

/* Guide Section Components */
.guide-section {
  border-bottom: 1px solid var(--bs-border-color);
  padding-bottom: 1rem;
}

.guide-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.guide-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bs-body-color);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.guide-text {
  color: var(--bs-secondary-color);
  line-height: 1.5;
  margin-bottom: 0;
}

.guide-steps {
  color: var(--bs-secondary-color);
  padding-left: 1.25rem;
  margin-bottom: 0;
}

.guide-steps li {
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.guide-tips {
  color: var(--bs-secondary-color);
  padding-left: 1.25rem;
  margin-bottom: 0;
}

.guide-tips li {
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

/* Form Controls in Sidebar */
.sidebar-panel .form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.sidebar-panel .form-check {
  margin-bottom: 0.25rem;
}

.sidebar-panel .form-check-label {
  cursor: pointer;
  user-select: none;
}

.sidebar-panel .form-check-input:checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.sidebar-panel .form-check-input:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Mobile Responsive Adjustments */
@media (max-width: 767px) {
  .sidebar-panel {
    margin-bottom: 0.5rem;
  }
  
  .sidebar-panel-header {
    padding: 0.5rem 0.75rem;
  }
  
  .sidebar-panel-body {
    padding: 0.75rem;
  }
  
  .guide-section {
    padding-bottom: 0.75rem;
  }
}

/* ====================================================================
   GRAPH NODE STYLING - REMOVE VISIBLE BORDERS FROM NODE IMAGES
   ==================================================================== */

/* Remove visible borders from graph node circles */
.enhanced-graph g.nodes circle,
#graph g.node circle {
  stroke: transparent !important;
  stroke-width: 0 !important;
}

/* Alternative selectors for broader compatibility */
.enhanced-graph circle,
#graph circle {
  stroke: transparent !important;
  stroke-width: 0 !important;
}

/* ====================================================================
   GRAPH LINK STYLING - THEME-AWARE CONNECTION LINE COLORS
   ==================================================================== */

/* Default (light mode) link colors */
.enhanced-graph g.links .link,
#graph g.links .link {
  stroke: var(--text-primary) !important; /* Use theme-aware text color */
  stroke-opacity: 0.6 !important; /* Soften the lines */
}

/* Dark mode override for link colors */
[data-bs-theme="dark"] .enhanced-graph g.links .link,
[data-bs-theme="dark"] #graph g.links .link {
  stroke: var(--text-primary) !important; /* Use theme-aware text color (white in dark mode) */
  stroke-opacity: 0.6 !important; /* Maintain consistent opacity */
}

/* Alternative selectors for broader compatibility */
.enhanced-graph .link,
#graph .link {
  stroke: var(--text-primary) !important; /* Use theme-aware text color */
  stroke-opacity: 0.6 !important; /* Soften the lines */
}

[data-bs-theme="dark"] .enhanced-graph .link,
[data-bs-theme="dark"] #graph .link {
  stroke: var(--text-primary) !important; /* Use theme-aware text color (white in dark mode) */
  stroke-opacity: 0.6 !important; /* Maintain consistent opacity */
}

/* ====================================================================
   ENTITY TYPE STYLING - SPECIFIC SUBCLASS VISUAL DIFFERENTIATION
   ==================================================================== */

/* Entity type-specific styling for graph nodes */
.node-website {
  /* Website-specific styling if needed */
}

.node-blog {
  /* Blog-specific styling if needed */
}

.node-podcast {
  /* Podcast-specific styling if needed */
}

.node-business {
  /* Business-specific styling if needed */
}

.node-physical {
  /* Physical object-specific styling if needed */
}

.node-digital {
  /* Digital object-specific styling if needed */
}

.node-other {
  /* Other object-specific styling if needed */
}

/* Tooltip styling for entity types */
.graph-tooltip .entity-type-website {
  color: #ed8936; /* Orange for websites */
}

.graph-tooltip .entity-type-blog {
  color: #dd6b20; /* Darker orange for blogs */
}

.graph-tooltip .entity-type-podcast {
  color: #c05621; /* Even darker orange for podcasts */
}

.graph-tooltip .entity-type-business {
  color: #38a169; /* Green for business */
}

/* ====================================================================
   PROFESSIONAL CONTEXT COMPONENT STYLES
   ==================================================================== */

.professional-context-container {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--bs-border-radius);
  overflow: hidden;
}

.professional-context-panel {
  padding: 1rem;
  max-height: 80vh;
  overflow-y: auto;
}

.context-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.context-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.context-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
}

.context-section-title i {
  margin-right: 0.5rem;
  color: var(--accent-primary);
}

/* Participant Profiles */
.participant-profiles {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.participant-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  background-color: var(--bg-secondary);
  border-radius: var(--bs-border-radius);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.participant-item:hover {
  background-color: var(--accent-hover);
}

.participant-avatar {
  margin-right: 0.75rem;
}

.avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  position: relative;
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.participant-info {
  flex: 1;
}

.participant-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.participant-title,
.participant-company {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.125rem;
}

.participant-location {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

.participant-location i {
  margin-right: 0.25rem;
  font-size: 0.625rem;
}

.participant-actions {
  margin-left: 0.5rem;
}

/* Mutual Connections */
.mutual-connections {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.connection-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  background-color: var(--bg-secondary);
  border-radius: var(--bs-border-radius);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.connection-item:hover {
  background-color: var(--accent-hover);
}

.connection-avatar {
  margin-right: 0.75rem;
}

.connection-info {
  flex: 1;
}

.connection-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.connection-title,
.connection-company {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.125rem;
}

.connection-path {
  font-size: 0.75rem;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
}

.connection-path i {
  margin-right: 0.25rem;
  font-size: 0.625rem;
}

.connection-actions {
  margin-left: 0.5rem;
}

.more-connections {
  text-align: center;
  margin-top: 0.5rem;
}

/* Shared Groups */
.shared-groups {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.group-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  background-color: var(--bg-secondary);
  border-radius: var(--bs-border-radius);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.group-item:hover {
  background-color: var(--accent-hover);
}

.group-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-right: 0.75rem;
}

.group-info {
  flex: 1;
}

.group-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.group-members {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.group-engagement {
  display: flex;
  align-items: center;
}

.engagement-level {
  font-size: 0.75rem;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-weight: 500;
}

.engagement-level.high {
  background-color: #d4edda;
  color: #155724;
}

.engagement-level.medium {
  background-color: #fff3cd;
  color: #856404;
}

.engagement-level.low {
  background-color: #f8d7da;
  color: #721c24;
}

.group-actions {
  margin-left: 0.5rem;
}

.more-groups {
  text-align: center;
  margin-top: 0.5rem;
}

/* Connection Strength */
.connection-strength {
  padding: 1rem;
  background-color: var(--bg-secondary);
  border-radius: var(--bs-border-radius);
}

.strength-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.strength-bar {
  width: 100%;
  height: 8px;
  background-color: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.strength-fill {
  height: 100%;
  background-color: var(--accent-primary);
  transition: width 0.3s ease;
}

.strength-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Networking Insights */
.networking-insights {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.insight-item {
  display: flex;
  align-items: flex-start;
  padding: 0.75rem;
  background-color: var(--bg-secondary);
  border-radius: var(--bs-border-radius);
}

.insight-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.insight-content {
  flex: 1;
}

.insight-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.insight-description {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.insight-action {
  font-size: 0.75rem;
}

/* Conversation Analytics */
.conversation-analytics {
  padding: 1rem;
  background-color: var(--bg-secondary);
  border-radius: var(--bs-border-radius);
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.analytics-item {
  text-align: center;
}

.analytics-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin: 0 auto 0.5rem;
}

.analytics-content {
  text-align: center;
}

.analytics-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.analytics-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .professional-context-panel {
    padding: 0.75rem;
  }
  
  .context-section {
    margin-bottom: 1rem;
  }
  
  .participant-item,
  .connection-item,
  .group-item {
    padding: 0.5rem;
  }
  
  .avatar-circle {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
  
  .analytics-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* Loading and Error States */
.professional-context-loading {
  text-align: center;
  padding: 2rem;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.loading-spinner i {
  font-size: 1.5rem;
  color: var(--accent-primary);
}

.professional-context-error {
  padding: 1rem;
}

.professional-context-empty {
  text-align: center;
  padding: 2rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.empty-icon {
  font-size: 3rem;
  color: var(--text-secondary);
  opacity: 0.5;
}

/* Messaging Navigation Styles */
.unread-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 0.75rem;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 50%;
  background-color: var(--bs-danger);
  color: white;
  font-weight: 600;
  z-index: 10;
}

.nav-link {
  position: relative;
}

.messaging-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.messaging-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.messaging-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Mobile responsiveness for messaging elements */
@media (max-width: 768px) {
  .unread-badge {
    font-size: 0.7rem;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    top: -6px;
    right: -6px;
  }
  
  .messaging-button {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
  }
}

.empty-state h4 {
  color: var(--text-secondary);
  margin: 0;
}

.empty-state p {
  color: var(--text-secondary);
  margin: 0;
  opacity: 0.8;
}

/* New Conversation Initial Message Styles */
.initial-message-section {
  margin: 1.5rem 0;
  padding: 1rem;
  background-color: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
}

.initial-message-section h6 {
  color: var(--bs-body-color);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.message-input-container {
  position: relative;
}

.message-input-container .message-input {
  resize: vertical;
  min-height: 80px;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  padding: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.message-input-container .message-input:focus {
  border-color: var(--bs-primary);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

.message-input-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.character-count {
  font-weight: 500;
  color: var(--text-secondary);
}

/* Mobile responsiveness for initial message */
@media (max-width: 768px) {
  .initial-message-section {
    margin: 1rem 0;
    padding: 0.75rem;
  }
  
  .message-input-container .message-input {
    min-height: 60px;
    font-size: 0.85rem;
  }
}

/* ========================================
   MESSAGING COMPONENT STYLES
   ======================================== */

/* --- Messaging System Styles --- */
/* Mobile-first responsive design following CSS Style Guide */

/* New Conversation Avatar */
.new-conversation-avatar {
  width: 40px;
  height: 40px;
}

/* Messaging Modal Backdrop */
.messaging-modal-backdrop {
  background-color: var(--bg-primary);
}

/* Message Search List */
.message-search-list {
  max-height: 300px;
  overflow-y: auto;
}

.message-search-item {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.message-search-item:hover {
  background-color: var(--bs-tertiary-bg);
}

/* Conversation Window - Mobile First */
.conversation-window {
  position: fixed;
  bottom: 0;
  /* Right position set inline via style attribute */
  width: 500px; /* Increased width to give messages more space */
  height: 500px; /* Reduced height to not obscure main content */
  max-height: calc(100vh - 100px); /* Leave more space at top */
  background-color: var(--messaging-panel-bg);
  color: var(--bs-body-color);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0; /* Rounded top corners only */
  box-shadow: 0 -0.5rem 1rem rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  /* z-index set inline via style attribute based on WindowIndex */
  transition: transform 0.3s ease-in-out;
  /* Ensure all child elements use the same width */
  box-sizing: border-box;
  /* Ensure proper positioning */
  left: auto;
}

/* Ensure windows stack properly when multiple are open */
.conversation-window:hover {
  transform: translateY(-2px);
  box-shadow: 0 -0.75rem 1.5rem rgba(0, 0, 0, 0.2);
}

/* Conversation window main content area */
.conversation-window .conversation-content {
  flex: 1;
  display: flex;
  flex-direction: column; /* Column layout since no sidebar */
  min-height: 0; /* Allow flex shrinking */
  overflow: hidden;
  width: 100%; /* Use full width */
}

/* Messages area within conversation window */
.conversation-window .messages-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Allow flex item to shrink below content size */
  overflow: hidden;
  width: 100%; /* Take full width since no sidebar */
  max-width: 100%; /* Ensure no width constraints */
}

/* Messages container (the scrollable area) */
.conversation-window .messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1rem 1rem 1.5rem; /* Add extra left padding */
  min-height: 0;
  width: 100%; /* Use full width */
  max-width: 100%; /* Ensure no width constraints */
  box-sizing: border-box; /* Include padding in width calculation */
  /* Hide scrollbar but keep scrolling functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.conversation-window .messages-container::-webkit-scrollbar {
  display: none; /* WebKit browsers */
}

.conversation-window .conversation-content,
.conversation-window .messages-area,
.conversation-window .message-input-area {
  background-color: var(--messaging-panel-bg);
}

.conversation-window .messages-container {
  background-color: var(--messaging-panel-bg);
  min-width: 0;
}

/* Conversation Header */
.conversation-header {
  flex-shrink: 0;
  height: 50px;
  border-bottom: 1px solid var(--bs-border-color);
  width: 100%;
  box-sizing: border-box;
}

/* Ensure all conversation window elements have consistent width */
.conversation-window .conversation-header,
.conversation-window .conversation-content,
.conversation-window .messages-area,
.conversation-window .messages-container,
.conversation-window .message-input-area,
.conversation-window .message-input-container {
  width: 100% !important;
  box-sizing: border-box !important;
  /* Remove any padding/margin that could cause width differences */
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Specific fixes for conversation window header */
.conversation-window .conversation-window-header {
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0.5rem !important;
}

/* Specific fixes for message input area */
.conversation-window .message-input-area {
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0.5rem !important;
}

/* Specific fixes for messages container */
.conversation-window .messages-container {
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0.5rem 0.5rem 0.5rem 1rem !important; /* Add extra left padding */
}

/* Ensure message content works with avatars */
.conversation-window .message-with-avatar {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important; /* Allow shrinking */
  box-sizing: border-box !important;
  flex: 1 !important;
}

.conversation-window .message-content-with-avatar {
  width: 100% !important;
  max-width: calc(100% - 60px) !important; /* Leave space for avatar */
  min-width: 0 !important; /* Allow shrinking */
  box-sizing: border-box !important;
  flex: 1 !important;
}

.conversation-window .message-bubble {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important; /* Allow shrinking */
  box-sizing: border-box !important;
}

/* Additional targeting for the specific message container */
.conversation-window .messages-container .message-with-avatar {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  box-sizing: border-box !important;
}

/* Force all message elements to use full width */
.conversation-window .message-with-avatar.d-flex {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  box-sizing: border-box !important;
}

/* CRITICAL: Fix message width to work with avatars */
.conversation-window .messages-container .message-with-avatar {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important; /* Allow shrinking */
  flex: 1 !important;
  box-sizing: border-box !important;
}

.conversation-window .messages-container .message-content-with-avatar {
  width: 100% !important;
  max-width: calc(100% - 60px) !important; /* Leave space for avatar */
  min-width: 0 !important; /* Allow shrinking */
  flex: 1 !important;
  box-sizing: border-box !important;
}

.conversation-window .messages-container .message-bubble {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important; /* Allow shrinking */
  box-sizing: border-box !important;
}

/* Override any Bootstrap or other framework constraints */
.conversation-window .messages-container .d-flex {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  box-sizing: border-box !important;
}

/* Prevent conversation windows from overlapping with Messages panel */
.conversation-window {
  /* Ensure windows don't go behind the Messages panel (which is typically 300-350px wide) */
  /* This is now handled by inline max-width in the component */
}

/* Conversation Content */
.conversation-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Messages Area */
.messages-area {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Messages Container */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-mobile);
}

/* Message Bubble Clickable */
.message-bubble-clickable {
  cursor: pointer;
}

/* Message Context Menu Positioned */
.message-context-menu-positioned {
  z-index: 9999;
}

/* Conversation Info Sidebar - REMOVED: No longer used */

/* Conversation Context Menu */
.conversation-context-menu {
  position: fixed;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.conversation-context-menu .dropdown-menu {
  position: relative;
  display: block;
  margin: 0;
}

/* Conversation actions in conversation list items only */
.messaging-conversation-item .conversation-actions {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.messaging-conversation-item:hover .conversation-actions {
  opacity: 1;
}

/* New Conversation modal actions should always be visible */
.new-conversation-container .conversation-actions {
  opacity: 1 !important;
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: flex-end;
}

.messaging-conversation-item .conversation-actions button {
  color: var(--bs-secondary-color);
}

.messaging-conversation-item .conversation-actions button:hover {
  color: var(--bs-body-color);
}

/* Presence Indicators */
.presence-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bs-body-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.presence-online {
  background-color: #28a745;
}

.presence-away {
  background-color: #ffc107;
}

.presence-busy {
  background-color: #dc3545;
}

.presence-offline {
  background-color: #6c757d;
}

.presence-unknown {
  background-color: transparent;
  border-color: transparent;
}

/* Professional Context Panel */
.professional-context-panel {
  padding: 0.5rem 0;
}

.professional-context-panel .context-section {
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--bs-border-color-translucent);
}

.professional-context-panel .context-section:last-child {
  border-bottom: none;
}

.professional-context-panel .mutual-connection-item {
  padding: 0.25rem;
  border-radius: var(--bs-border-radius-sm);
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.professional-context-panel .mutual-connection-item:hover {
  background-color: var(--bs-tertiary-bg);
}

.professional-context-panel .shared-group-item {
  padding: 0.25rem;
}

.professional-context-panel .connection-strength-bar {
  width: 100%;
  height: 8px;
  background-color: var(--bs-tertiary-bg);
  border-radius: 4px;
  overflow: hidden;
}

.professional-context-panel .strength-fill {
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 4px;
}

.professional-context-panel .context-actions .btn {
  font-size: 0.875rem;
}

/* Pinned Messages Section */
.pinned-messages-section {
  background-color: var(--bs-light-bg-subtle);
  max-height: 200px;
  overflow-y: auto;
}

.pinned-messages-list {
  max-height: 150px;
  overflow-y: auto;
}

.pinned-message-item {
  background-color: var(--bs-body-bg);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.pinned-message-item:hover {
  background-color: var(--bs-tertiary-bg);
}

.pinned-message-item small {
  line-height: 1.4;
}

/* Typing Indicator Animation */
@keyframes typing-pulse {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-3px);
  }
}

.typing-indicator-animated {
  display: inline-block;
  animation: typing-pulse 1.4s infinite ease-in-out;
}

/* Read Receipts - Group Conversations */
.read-receipts-group {
  cursor: pointer;
}

.read-receipt-avatars {
  gap: -4px; /* Overlap avatars slightly */
}

.read-receipt-avatar {
  border: 2px solid var(--bs-body-bg);
  border-radius: 50%;
  width: 20px;
  height: 20px;
}

.read-receipts-detail {
  max-height: 150px;
  overflow-y: auto;
  font-size: 0.875rem;
}

.read-receipts-detail .small {
  color: var(--bs-body-color);
}

/* Reply Context Banner */
.reply-context-banner {
  border-top: 2px solid var(--bs-primary);
}

.reply-context-banner .btn-link {
  color: var(--bs-secondary-color);
}

.reply-context-banner .btn-link:hover {
  color: var(--bs-danger);
}

/* Message Threading */
.message-reply-indicator {
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.25rem;
  background-color: var(--bs-tertiary-bg);
  border-left: 3px solid var(--bs-primary);
  border-radius: var(--bs-border-radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.message-reply-indicator:hover {
  background-color: var(--bs-secondary-bg);
}

.message-reply-indicator .original-message {
  color: var(--bs-secondary-color);
  font-style: italic;
}

/* Mobile Touch Target Optimization */
.mobile-touch-target {
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ensure all interactive elements meet touch target minimum */
.messaging-panel .btn,
.messaging-panel .nav-link,
.messaging-panel .dropdown-item,
.conversation-window .btn {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
}

/* Mobile-specific touch feedback */
.mobile-touch-feedback:active {
  background-color: var(--bs-tertiary-bg);
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* Message Input Area */
.message-input-area {
  flex-shrink: 0;
  border-top: 1px solid var(--bs-border-color);
  background-color: var(--bs-body-bg);
}

/* Mobile Input Enhancements */
@media (max-width: 768px) {
  .message-input-area .form-control {
    font-size: 16px; /* Prevent iOS zoom on input focus */
    min-height: 44px;
  }
  
  .message-input-area .btn {
    min-width: 60px;
    min-height: 44px;
  }
  
  .messaging-conversation-item {
    padding: 1rem !important; /* Larger padding for easier tapping */
    min-height: 72px; /* Ensure comfortable touch target */
  }
  
  .conversation-window {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
  
  .messaging-panel {
    width: 100%;
  }
  
  /* Mobile reaction buttons - larger touch targets */
  .reaction-btn {
    min-width: 44px;
    min-height: 44px;
    font-size: 1.25rem;
    margin: 0 4px; /* Spacing between touch targets */
  }
  
  /* Mobile context menu items */
  .dropdown-item {
    padding: 0.75rem 1rem;
    min-height: 48px;
  }
  
  /* Mobile message bubbles - easier to tap for context menu */
  .message-bubble {
    min-height: 44px;
    padding: 0.75rem 1rem;
  }
  
  /* Mobile conversation actions - always visible */
  .conversation-actions {
    opacity: 1 !important;
  }
  
  /* Mobile pinned messages - full width on mobile */
  .pinned-messages-section {
    max-height: 250px;
  }
  
  /* Mobile professional context - collapsible by default */
  /* .conversation-info-sidebar removed - no longer used */
  
  /* Mobile search bar - larger for easier typing */
  .messaging-panel input[type="text"] {
    font-size: 16px;
    min-height: 44px;
  }
  
  /* Mobile filter tabs - larger touch targets */
  .nav-tabs .nav-link {
    min-height: 44px;
    padding: 0.75rem 1rem;
  }
  
  /* Mobile-specific swipe gesture area */
  .messaging-panel {
    touch-action: pan-y; /* Allow vertical scrolling, enable horizontal swipe detection */
  }
  
  /* Mobile message context menu - better positioning */
  .message-context-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  }
  
  /* Mobile conversation context menu - bottom sheet style */
  .conversation-context-menu {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
  }
  
  /* Mobile delete confirmation - full screen for better visibility */
  .modal-dialog-centered {
    margin: 1rem;
  }
  
  /* Mobile profile images - larger for better visibility */
  .conversation-profile-image {
    width: 48px;
    height: 48px;
  }
  
  /* Mobile presence indicators - larger and more visible */
  .presence-indicator {
    width: 14px;
    height: 14px;
    border-width: 3px;
  }
}

/* Tablet adjustments (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .messaging-panel {
    width: 400px; /* Wider on tablet */
  }
  
  .conversation-window {
    width: 450px;
    height: 550px;
  }
  
  /* .conversation-info-sidebar removed - no longer used */
  
  /* Tablet touch targets - slightly smaller than mobile but still comfortable */
  .messaging-panel .btn,
  .conversation-window .btn {
    min-height: 40px;
  }
}

/* Mobile Gesture Improvements */
@media (max-width: 768px) {
  /* Swipe gesture visual feedback */
  .messaging-panel.swiping {
    transition: transform 0.1s ease-out;
  }
  
  /* Pull-to-refresh indicator spacing */
  .messaging-panel > * {
    overscroll-behavior: contain;
  }
  
  /* Prevent accidental text selection during swipes */
  .messaging-conversation-item,
  .message-bubble {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
  }
  
  /* Re-enable text selection for message content when long-pressing */
  .message-content {
    user-select: text;
    -webkit-user-select: text;
  }
  
  /* Mobile accessibility - ensure focus indicators are visible */
  .messaging-panel *:focus-visible,
  .conversation-window *:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
  }
  
  /* Mobile loading states - larger spinners */
  .spinner-border-sm {
    width: 1.25rem;
    height: 1.25rem;
  }
  
  /* Mobile error alerts - more prominent */
  .alert {
    font-size: 0.9375rem;
    padding: 0.75rem 1rem;
  }
}

/* Professional Context Sidebar */
.professional-context-sidebar {
  width: 280px;
}

/* Mutual Connection Count */
.mutual-connection-count {
  width: 32px;
  height: 32px;
}

/* New Conversation Component Styles */
.new-conversation-container {
  padding: var(--spacing-mobile);
}

.new-conversation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-mobile);
  padding-bottom: var(--spacing-mobile);
  border-bottom: 1px solid var(--bs-border-color);
}

.new-conversation-content {
  padding: var(--spacing-mobile) 0;
}

.conversation-type-selection {
  margin-bottom: var(--spacing-mobile);
}

.conversation-type-selection h5 {
  margin-bottom: var(--spacing-mobile);
  color: var(--bs-body-color);
  font-size: 1rem;
  font-weight: 600;
}

.participant-selection {
  margin-bottom: var(--spacing-mobile);
}

.participant-selection h5 {
  margin-bottom: var(--spacing-mobile);
  color: var(--bs-body-color);
  font-size: 1rem;
  font-weight: 600;
}

.search-box {
  position: relative;
  margin-bottom: var(--spacing-mobile);
}

.search-box .search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bs-text-muted);
}

.search-results {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background-color: var(--bs-body-bg);
}

.person-item {
  display: flex;
  align-items: center;
  padding: var(--spacing-mobile);
  border-bottom: 1px solid var(--bs-border-color);
  cursor: pointer;
  transition: background-color 0.2s ease;
  min-height: var(--mobile-touch-target-min);
}

.person-item:hover {
  background-color: var(--bs-tertiary-bg);
}

.person-item.selected {
  background-color: var(--bs-primary-bg-subtle);
}

.person-avatar {
  width: 40px;
  height: 40px;
  margin-right: var(--spacing-mobile);
  flex-shrink: 0;
}

.person-avatar .profile-image-container {
  width: 100%;
  height: 100%;
}

.person-avatar .profile-image.profile-image-xs {
  width: 40px;
  height: 40px;
}

.person-avatar .profile-image-container img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.person-info {
  flex: 1;
  min-width: 0;
}

.person-name {
  font-weight: 600;
  color: var(--bs-body-color);
  margin-bottom: 2px;
}

.person-title {
  font-size: 0.875rem;
  color: var(--bs-text-muted);
  margin-bottom: 2px;
}

.person-company {
  font-size: 0.75rem;
  color: var(--bs-text-muted);
}

.selected-icon {
  color: var(--bs-primary);
  font-size: 1.2rem;
}

.selected-participants {
  margin-bottom: var(--spacing-mobile);
}

.selected-participants h6 {
  margin-bottom: var(--spacing-mobile);
  color: var(--bs-body-color);
  font-size: 0.875rem;
  font-weight: 600;
}

.participant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.participant-chip {
  display: flex;
  align-items: center;
  background-color: var(--bs-primary);
  color: var(--bs-white);
  padding: 0.25rem 0.5rem;
  border-radius: var(--bs-border-radius-pill);
  font-size: 0.75rem;
  gap: 0.25rem;
}

.participant-chip .btn-close {
  color: var(--bs-white);
  font-size: 0.75rem;
  margin-left: 0.25rem;
}

.initial-message-section {
  margin-bottom: var(--spacing-mobile);
}

.initial-message-section h6 {
  margin-bottom: var(--spacing-mobile);
  color: var(--bs-body-color);
  font-size: 0.875rem;
  font-weight: 600;
}

.message-input-container {
  position: relative;
}

.message-input-container .message-input {
  min-height: 80px;
  resize: vertical;
  font-size: 0.875rem;
}

.message-input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
}

.character-count {
  font-size: 0.75rem;
  color: var(--bs-text-muted);
}

.conversation-actions {
  display: flex;
  gap: var(--spacing-mobile);
  justify-content: flex-end;
  margin-top: var(--spacing-mobile);
  padding-top: var(--spacing-mobile);
  border-top: 1px solid var(--bs-border-color);
}

.conversation-actions .btn {
  min-height: var(--mobile-touch-target-min);
  min-width: var(--mobile-touch-target-min);
}

/* Loading and Error States */
.loading-message {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-mobile);
  color: var(--bs-text-muted);
}

.loading-message i {
  margin-right: 0.5rem;
}

.no-results {
  text-align: center;
  padding: var(--spacing-mobile);
  color: var(--bs-text-muted);
}

.no-results i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* Tablet Adjustments */
@media (min-width: 768px) {
  .conversation-window {
    top: auto;
    left: auto;
    bottom: 0;
    right: calc(20px + var(--window-offset, 0px));
    width: var(--conversation-window-width-tablet);
    height: var(--conversation-window-height-tablet);
    min-width: 400px;
    max-width: 500px;
    border: 1px solid var(--messaging-panel-border);
    border-bottom: none;
    border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10000 !important; /* Must be above messaging panel (9999) */
  }
  
  /* .conversation-info-sidebar removed - no longer used */
  
  .messages-container {
    padding: var(--spacing-tablet);
  }
  
  .new-conversation-container {
    padding: var(--spacing-tablet);
  }
  
  .new-conversation-content {
    padding: var(--spacing-tablet) 0;
  }
  
  .search-results {
    max-height: 300px;
  }
  
  .person-item {
    padding: var(--spacing-tablet);
  }
}

/* Desktop Adjustments */
@media (min-width: 1024px) {
  .conversation-window {
    width: var(--conversation-window-width-desktop);
    height: var(--conversation-window-height-desktop);
  }
  
  /* .conversation-info-sidebar removed - no longer used */
  
  .messages-container {
    padding: var(--spacing-desktop);
  }
  
  .new-conversation-container {
    padding: var(--spacing-desktop);
  }
  
  .new-conversation-content {
    padding: var(--spacing-desktop) 0;
  }
  
  .search-results {
    max-height: 400px;
  }
  
  .person-item {
    padding: var(--spacing-desktop);
  }
}

/* Messaging page container */
.messaging-page {
  height: 100%;
  background-color: var(--bs-body-bg);
}

/* Messaging headers */
.messaging-header {
  background-color: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color);
  min-height: var(--messaging-header-height);
}

/* Conversation header */
.messaging-conversation-header {
  background-color: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color);
  min-height: var(--messaging-conversation-header-height);
}

.conversation-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--bs-body-color);
  line-height: 1.2;
}

.conversation-meta {
  font-size: 0.875rem;
  color: var(--bs-text-muted);
  line-height: 1.3;
}

/* Touch targets for mobile */
.mobile-touch-target {
  min-width: var(--mobile-touch-target-min);
  min-height: var(--mobile-touch-target-min);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Professional context section */
.professional-context-section {
  background-color: var(--bs-tertiary-bg);
  border-top: 1px solid var(--bs-border-color);
  max-height: 200px;
  overflow-y: auto;
}

/* Messaging welcome state */
.messaging-welcome {
  padding: var(--spacing-mobile);
  text-align: center;
}

.welcome-content h3 {
  color: var(--bs-body-color);
  font-weight: 600;
  margin-bottom: var(--spacing-mobile);
}

.welcome-content p {
  color: var(--bs-text-muted);
  line-height: 1.5;
}

/* Tablet adjustments */
@media (min-width: 768px) {
  .messaging-welcome {
    padding: var(--spacing-tablet);
  }
  
  .conversation-title {
    font-size: 1.125rem;
  }
  
  .professional-context-section {
    max-height: 250px;
  }
}

/* Desktop adjustments */
@media (min-width: 1024px) {
  .messaging-welcome {
    padding: var(--spacing-desktop);
  }
  
  .conversation-title {
    font-size: 1.25rem;
  }
  
  .professional-context-section {
    max-height: 300px;
  }
}

/* ====================================================================
   MESSAGING UI SYSTEM - FACEBOOK-STYLE OVERLAY PANEL
   Following CSS Style Guide: Mobile-first, CSS Variables, Bootstrap utilities only
   ==================================================================== */

/* ========================================
   6. Mobile Styles - Messaging Panel
   ======================================== */

/* Variables Definition (Rule #1) */
:root {
  --messaging-panel-width-mobile: 100vw;
  --messaging-panel-width-tablet: 400px;
  --messaging-panel-width-desktop: 360px;
  --messaging-panel-transition: 0.3s ease-in-out;
  --messaging-panel-z-index: 1040;
  --messaging-touch-target: 44px;
}

/* Mobile-First Base Styles (Rule #8) */
.messaging-panel {
  /* Theme-aware colors (Rule #3) */
  background-color: var(--bs-body-bg);
  border-left: 1px solid var(--bs-border-color);
  color: var(--bs-body-color);
  
  /* Mobile-first dimensions */
  width: var(--messaging-panel-width-mobile);
  height: 100vh;
  top: 0;
  right: 0;
  /* Messaging Panel - must be above everything including feed content */
  z-index: 9999 !important; /* Maximum z-index to appear above all content */
  position: fixed !important;
  
  /* Default state - completely hidden */
  transform: translateX(100%);
  transition: transform var(--messaging-panel-transition);
  /* Ensure it's actually off-screen */
  right: 0;
}

/* When visible - slide in */
.messaging-panel.messaging-panel-visible {
  transform: translateX(0);
}

/* When hidden - slide out (explicit state) */
.messaging-panel.messaging-panel-hidden {
  transform: translateX(100%) !important;
}

/* Remove any conflicting styles that might override the transform */
.messaging-panel.position-fixed {
  /* Ensure positioning doesn't conflict */
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  z-index: 9999 !important;
}

/* Make sure no other elements override these z-indexes */
.messaging-panel,
.messaging-panel * {
  z-index: inherit;
}

/* Touch targets for mobile (Rule #9) */
.messaging-panel .btn,
.messaging-panel .nav-link {
  min-height: var(--messaging-touch-target);
  min-width: var(--messaging-touch-target);
}

/* Tablet adjustments (Rule #11 - 768px breakpoint) */
@media (min-width: 768px) {
  .messaging-panel {
    width: var(--messaging-panel-width-tablet);
  }
}

/* Desktop adjustments (Rule #11 - 1024px breakpoint) */
@media (min-width: 1024px) {
  .messaging-panel {
    width: var(--messaging-panel-width-desktop);
  }
}

/* ========================================
   Conversation Window Positioning
   ======================================== */


/* Stack multiple conversation windows - must be above messaging panel */
.conversation-window:nth-child(1) { z-index: 10001 !important; }
.conversation-window:nth-child(2) { z-index: 10002 !important; }
.conversation-window:nth-child(3) { z-index: 10003 !important; }
/* Conversation windows (10001+) are above messaging panel (9999) */

/* Ensure right sidebar content has lower z-index */
.right-sidebar,
.right-sidebar-content,
.connections-list,
.people-list {
  z-index: 1000 !important; /* Much lower than messaging components and dropdowns */
}

/* Ensure all dropdown menus appear above sidebar */
.dropdown-menu.show {
  z-index: 99999 !important; /* Extremely high z-index above everything */
  position: fixed !important; /* Fixed positioning escapes stacking contexts */
}

/* Specific rules for comment and post dropdown menus */
.comment-menu .dropdown-menu.show,
.card .dropdown .dropdown-menu.show {
  z-index: 99999 !important;
  position: fixed !important; /* Fixed positioning escapes stacking contexts */
}

/* Ensure dropdown parent and ancestors create proper stacking context */
.dropdown,
.comment-menu,
.card .dropdown {
  position: relative;
  z-index: 99998 !important;
}

.comment-item,
.card {
  position: relative; /* Needed for stacking context */
  z-index: 99997 !important; /* High z-index for parent containers */
}

/* Force main content area to have lower z-index than dropdowns */
.three-col-main-content-slot {
  position: relative;
  z-index: 1;
}

/* Minimized state */
.conversation-window.minimized {
    height: 40px;
    overflow: hidden;
}

/* Conversation Window Layout */
.conversation-window .conversation-content {
    display: flex;
    flex-direction: column;
    height: calc(100% - 50px); /* Subtract header height */
}

.conversation-window .messages-area {
    flex: 1;
    overflow: hidden;
    display: flex;
}

.conversation-window .messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px 10px 10px 15px; /* Add extra left padding */
    width: 100%; /* Use full width */
    max-width: 100%; /* Ensure no width constraints */
    box-sizing: border-box; /* Include padding in width calculation */
    /* Hide scrollbar but keep scrolling functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.conversation-window .messages-container::-webkit-scrollbar {
    display: none; /* WebKit browsers */
}

/* .conversation-info-sidebar removed - no longer used */

@media (max-width: 768px) {
    .conversation-window .messages-area {
        flex-direction: column;
    }
}

/* Message Input Area - Fixed at Bottom */
.conversation-window .message-input-area {
    flex-shrink: 0;
    border-top: 1px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
    z-index: 1; /* Ensure it stays above messages */
}

/* Profile Image Layout for Messaging */
.conversation-profile-image {
    flex-shrink: 0;
}

.message-with-avatar {
    align-items: flex-start;
    gap: 0.25rem; /* Reduced gap for more compact layout */
}

.message-profile-image {
    flex-shrink: 0;
}

.message-avatar {
    /* ProfileImage component handles sizing internally */
}

.message-content-with-avatar {
    flex: 1;
    min-width: 0;
}

/* Conversation List Profile Images - Use ProfileImage size classes */
.messaging-conversation-item .conversation-profile-image {
    /* ProfileImage component handles sizing with Size="xs" (64px) */
}

/* Message Bubbles with Profile Images */
.message-with-avatar .message-bubble {
    max-width: calc(100% - 70px); /* Account for smaller profile image space */
}

/* Message Reactions Styles */
.message-reactions-container {
  position: relative;
}

.reaction-buttons {
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  padding: 0.25rem;
  box-shadow: var(--messaging-reaction-shadow);
  z-index: 10;
  animation: fadeIn 0.2s ease-in-out;
}

.reaction-btn {
  border: none !important;
  background: transparent !important;
  padding: 0.25rem 0.5rem !important;
  font-size: 1.2rem;
  transition: all 0.2s ease;
  border-radius: var(--bs-border-radius-sm) !important;
}

.reaction-btn:hover {
  background: var(--bs-tertiary-bg) !important;
  transform: scale(1.1);
}

.existing-reactions {
  margin-top: 0.25rem;
}

.reaction-item {
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--bs-border-radius-pill);
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
}

.reaction-item:hover {
  transform: scale(1.05);
  opacity: 0.8;
}

.reaction-item.user-reaction {
  background-color: var(--bs-primary) !important;
  color: var(--bs-white) !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Phase 2: Post/Comment Reaction Picker Component ===== */
.reaction-picker-container {
  position: relative;
  display: inline-block;
}

.reaction-picker-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 4px 8px;
  display: flex;
  gap: 4px;
  z-index: 1060; /* Above mobile sidebar (1050) */
  animation: slideUp 0.2s ease-out;
}

[data-bs-theme="dark"] .reaction-picker-popup {
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.1);
}

.reaction-option {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: transform 0.1s ease, background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.reaction-option:hover {
  transform: scale(1.3);
  background-color: var(--bs-secondary-bg);
}

.reaction-emoji {
  font-size: 28px;
  line-height: 1;
  user-select: none;
}

.reaction-button {
  background: none;
  border: none;
  color: var(--bs-secondary-color);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  line-height: 16px;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.reaction-button:hover:not(:disabled) {
  color: var(--bs-body-color);
  text-decoration: underline;
}

.reaction-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.reaction-button.active {
  color: var(--bs-primary);
}

.reaction-icon {
  font-size: 14px;
  line-height: 1;
  display: inline-block;
  flex-shrink: 0; /* Prevent icon from shrinking */
}

.reaction-label {
  user-select: none;
  white-space: nowrap; /* Prevent text wrapping */
}

.reaction-count {
  color: var(--bs-secondary-color);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Mobile responsiveness for reaction picker */
@media (max-width: 767px) {
  .reaction-button {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .reaction-picker-popup {
    left: 0;
    transform: none;
  }

  .reaction-option {
    width: 48px;
    height: 48px;
  }

  .reaction-emoji {
    font-size: 32px;
  }
}

/* Message Edit/Delete Styles */
.message-context-menu {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  box-shadow: var(--bs-box-shadow);
  min-width: 150px;
}

.message-context-menu .dropdown-item {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  transition: background-color 0.2s ease;
}

.message-context-menu .dropdown-item:hover {
  background-color: var(--bs-tertiary-bg);
}

.message-context-menu .dropdown-item.text-danger:hover {
  background-color: var(--bs-danger);
  color: var(--bs-white);
}

.edit-message-container {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  padding: 0.5rem;
  margin-top: 0.25rem;
}

.edit-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.message-edited-indicator {
  font-size: 0.75rem;
  font-style: italic;
  margin-left: 0.5rem;
}

/* Message hover effects for context menu */
.message-bubble:hover {
  cursor: context-menu;
}

.message-bubble.editing {
  background-color: var(--bs-warning-bg-subtle);
  border: 1px solid var(--bs-warning);
}

/* Message Search Styles */
.message-search-results {
  background: var(--bs-body-bg);
  border-top: 1px solid var(--bs-border-color);
}

.message-search-list {
  max-height: 300px;
  overflow-y: auto;
}

.message-search-item {
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.message-search-item:hover {
  background-color: var(--bs-tertiary-bg);
}

.message-search-avatar {
  width: 32px;
  height: 32px;
}

.message-search-item mark {
  background-color: var(--messaging-search-highlight-bg);
  padding: 0.1em 0.2em;
  border-radius: 0.2em;
}

/* Compact Conversation List Items */
.messaging-conversation-item {
    padding: 0.5rem 0.75rem !important; /* Reduced padding */
    min-height: 60px; /* Reduced minimum height */
}

.messaging-conversation-item .conversation-profile-image {
    margin-right: 0.5rem !important; /* Reduced margin */
}

/* Compact Message Panel */
.messaging-panel {
    width: 350px; /* Increased for better usability */
    max-width: 380px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .message-with-avatar .message-bubble {
        max-width: calc(100% - 60px);
    }
    
    .messaging-panel {
        width: 300px;
    }
    
    .messaging-conversation-item {
        padding: 0.4rem 0.6rem !important;
        min-height: 55px;
    }
}

@media (max-width: 768px) {
    .conversation-window[data-window-index]:not([data-window-index="0"]) {
        display: none;
    }

    .conversation-window .conversation-window-header,
    .conversation-window .message-input-area {
        position: sticky;
        z-index: 1;
        background-color: var(--messaging-panel-bg);
    }

    .conversation-window .conversation-window-header {
        top: 0;
        border-bottom: 1px solid var(--messaging-panel-border);
    }

    .conversation-window .message-input-area {
        bottom: 0;
        border-top: 1px solid var(--messaging-panel-border);
    }
}

/* Messaging Panel Header */
.messaging-nav-toggle {
  min-height: var(--mobile-touch-target-min);
  min-width: var(--mobile-touch-target-min);
  border: none;
  background: none;
  color: var(--bs-body-color);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.messaging-nav-toggle:hover,
.messaging-nav-toggle:focus {
  color: var(--bs-primary);
  background-color: var(--messaging-hover-bg);
  border-radius: var(--bs-border-radius);
}

/* Filter Tabs */
.messaging-filter-tab {
  min-height: var(--mobile-touch-target-min);
  min-width: var(--mobile-touch-target-min);
  border: none;
  background: none;
  color: var(--bs-body-color);
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--bs-border-radius);
  transition: all var(--messaging-panel-transition);
}

.messaging-filter-tab:hover,
.messaging-filter-tab:focus {
  color: var(--bs-primary);
  background-color: var(--messaging-hover-bg);
}

.messaging-filter-tab.active {
  color: var(--bs-primary);
  background-color: var(--messaging-hover-bg);
  border-bottom: 2px solid var(--bs-primary);
}

/* Conversation Items */
.messaging-conversation-item {
  min-height: var(--messaging-conversation-item-height);
  cursor: pointer;
  transition: background-color var(--messaging-panel-transition);
  border-bottom: 1px solid var(--messaging-panel-border) !important;
}

.messaging-conversation-item:hover,
.messaging-conversation-item:focus {
  background-color: var(--messaging-hover-bg);
}

.messaging-conversation-item:active {
  background-color: var(--bs-primary-bg-subtle);
}

/* Unread Badge */
.messaging-badge,
.messaging-unread-badge,
.messaging-notification-badge {
  background-color: var(--messaging-badge-bg) !important;
  color: var(--bs-white);
  font-size: 0.75rem;
  min-width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Navigation Button */
.messaging-nav-button {
  min-height: var(--mobile-touch-target-min);
  min-width: var(--mobile-touch-target-min);
  border: none;
  background: none;
  color: var(--bs-body-color);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--bs-border-radius);
  transition: all var(--messaging-panel-transition);
}

.messaging-nav-button:hover,
.messaging-nav-button:focus {
  color: var(--bs-primary);
  background-color: var(--messaging-hover-bg);
}

/* Online Status Indicator */
.messaging-online-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--bs-success);
  border-radius: 50%;
  border: 2px solid var(--messaging-panel-bg);
  position: absolute;
  bottom: 2px;
  right: 2px;
}


/* Desktop enhancements */
@media (min-width: 1024px) {
  .messaging-panel {
    /* Desktop-specific adjustments if needed */
  }
}

/* Layout compatibility for messaging panel overlay */
.messaging-panel-active {
  /* This class is applied to the main container when messaging panel is open */
  /* Allows for layout adjustments if needed */
}

/* Dark theme specific adjustments */
[data-bs-theme="dark"] .messaging-panel {
  /* Dark theme uses CSS variables, so no specific overrides needed */
  /* The --messaging-panel-shadow variable handles dark theme shadows */
}

/* Accessibility improvements */
.messaging-conversation-item:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

.messaging-nav-button:focus-visible,
.messaging-nav-toggle:focus-visible,
.messaging-filter-tab:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

/* Messaging toggle button in sidebar */
.messaging-toggle-btn {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: 0;
  color: inherit;
  transition: background-color 0.2s ease;
}

.messaging-toggle-btn:hover {
  background-color: var(--bs-tertiary-bg);
}

.messaging-toggle-btn:focus {
  outline: 2px solid var(--bs-primary);
  outline-offset: -2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .messaging-panel {
    border-left-width: 2px;
  }
  
  .messaging-conversation-item {
    border-bottom-width: 2px !important;
  }
  
  .messaging-filter-tab.active {
    border-bottom-width: 3px;
  }
}

        /* Reduced motion support */
        @media (prefers-reduced-motion: reduce) {
          .messaging-panel,
          .messaging-conversation-item,
          .messaging-nav-button,
          .messaging-nav-toggle,
          .messaging-filter-tab {
            transition: none;
          }
        }

        /* ====================================================================
           CONVERSATION WINDOW SYSTEM - DRAGGABLE POPUP WINDOWS
           Following CSS Style Guide: Mobile-first, CSS Variables, Bootstrap utilities only
           ==================================================================== */

        /* Base styles (Mobile) - No media query needed */
        .conversation-window {
          background-color: var(--messaging-panel-bg);
          border: 1px solid var(--messaging-panel-border);
          border-radius: var(--bs-border-radius);
          box-shadow: var(--messaging-panel-shadow);
          
          /* Mobile: Fixed positioning with touch-friendly sizing */
          min-width: 280px;
          min-height: 300px;
          max-width: 100vw;
          max-height: 100vh;

          /* Ensure window is above messaging panel content */
          z-index: 10000 !important;

          /* Smooth transitions for window state changes */
          transition: all var(--messaging-panel-transition);
        }

        .conversation-window-minimized {
          height: 60px !important;
          min-height: 60px !important;
        }

        /* Window Header */
        .conversation-window-header {
          background-color: var(--messaging-hover-bg);
          border-bottom: 1px solid var(--messaging-panel-border);
          min-height: var(--mobile-touch-target-min);
          
          /* Make header draggable */
          cursor: move;
          user-select: none;
        }

        .conversation-window-header:active {
          cursor: grabbing;
        }

        /* Message Bubbles */
        .message-bubble {
          max-width: 70%;
          padding: 0.75rem 1rem;
          border-radius: 1.5rem; /* More rounded message bubbles */
          position: relative;
          word-wrap: break-word;
          word-break: break-word;
        }

        .message-sent {
          background-color: var(--bs-primary);
          color: var(--bs-white);
          border-bottom-right-radius: 0.5rem; /* Slightly less rounded on the tail */
        }

        .message-received {
          background-color: var(--messaging-hover-bg);
          color: var(--bs-body-color);
          border-bottom-left-radius: 0.5rem; /* Slightly less rounded on the tail */
        }

        .message-content {
          margin-bottom: 0.25rem;
          line-height: 1.4;
        }

        .message-timestamp {
          opacity: 0.7;
          font-size: 0.75rem;
          display: block;
        }

        .message-read-indicator {
          position: absolute;
          bottom: 0.25rem;
          right: 0.5rem;
          opacity: 0.7;
        }

        /* Messages Container */
        .conversation-messages {
          /* Ensure messages scroll properly */
          scroll-behavior: smooth;
        }

        /* Professional Context Sidebar */
        .professional-context-sidebar {
          background-color: var(--messaging-hover-bg);
          border-left: 1px solid var(--messaging-panel-border);
          
          /* Mobile: Hide sidebar by default */
          display: none;
        }

        .participant-item {
          cursor: pointer;
          border-radius: var(--bs-border-radius);
          transition: background-color var(--messaging-panel-transition);
        }

        .participant-item:hover,
        .participant-item:focus {
          background-color: var(--bs-primary-bg-subtle);
        }

        .mutual-connection-item {
          cursor: pointer;
          transition: transform var(--messaging-panel-transition);
        }

        .mutual-connection-item:hover,
        .mutual-connection-item:focus {
          transform: scale(1.1);
        }

        /* Typing Indicator */
        .typing-indicator {
          padding: 0.5rem 1rem;
          background-color: var(--messaging-hover-bg);
          border-radius: var(--bs-border-radius);
          margin: 0.5rem 0;
        }

        .typing-dots {
          display: flex;
          align-items: center;
          gap: 0.25rem;
        }

        .typing-dot {
          width: 6px;
          height: 6px;
          background-color: var(--bs-primary);
          border-radius: 50%;
          animation: typingAnimation 1.4s infinite ease-in-out;
        }

        .typing-dot:nth-child(2) {
          animation-delay: 0.2s;
        }

        .typing-dot:nth-child(3) {
          animation-delay: 0.4s;
        }

        @keyframes typingAnimation {
          0%, 60%, 100% {
            transform: scale(1);
            opacity: 0.5;
          }
          30% {
            transform: scale(1.2);
            opacity: 1;
          }
        }

        /* Tablet and up (Rule #11 - Standard breakpoints) */
        @media (min-width: 768px) {
          .conversation-window {
            /* Tablet: Allow larger windows */
            min-width: 320px;
            min-height: 400px;
          }
          
          .professional-context-sidebar {
            /* Tablet: Show sidebar for larger screens */
            display: flex;
          }
        }

        /* Desktop enhancements */
        @media (min-width: 1024px) {
          .conversation-window {
            /* Desktop: Full window functionality */
            min-width: 450px; /* Increased from 400px */
            min-height: 500px;
            width: 450px; /* Set explicit width for desktop */
            height: 500px; /* Set explicit height for desktop */
          }
          
          .message-bubble {
            max-width: 60%;
          }
        }

        /* Dark theme specific adjustments */
        [data-bs-theme="dark"] .conversation-window {
          /* Dark theme uses CSS variables, so no specific overrides needed */
          /* The --messaging-panel-shadow variable handles dark theme shadows */
        }

        /* Accessibility improvements */
        .conversation-window-header:focus-visible {
          outline: 2px solid var(--bs-primary);
          outline-offset: 2px;
        }

        .participant-item:focus-visible,
        .mutual-connection-item:focus-visible {
          outline: 2px solid var(--bs-primary);
          outline-offset: 2px;
        }

        /* High contrast mode support */
        @media (prefers-contrast: high) {
          .conversation-window {
            border-width: 2px;
          }
          
          .message-bubble {
            border: 1px solid var(--bs-border-color);
          }
          
          .message-sent {
            border-color: var(--bs-primary);
          }
          
          .message-received {
            border-color: var(--bs-border-color);
          }
        }

        /* Reduced motion support */
        @media (prefers-reduced-motion: reduce) {
          .conversation-window,
          .participant-item,
          .mutual-connection-item,
          .typing-dot {
            transition: none;
          }
          
          .typing-dot {
            animation: none;
          }
        }

        /* ====================================================================
           PHASE 5: MOBILE OPTIMIZATIONS AND TOUCH ENHANCEMENTS
           Following CSS Style Guide: Mobile-first, CSS Variables, Touch targets
           ==================================================================== */

          }
          
          .professional-context-sidebar {
            position: fixed;
            top: 0;
            right: 0;
            height: 100vh;
            width: 100vw;
            background-color: var(--bs-body-bg);
            z-index: 1060;
            border-radius: 0;
          }
          
          .professional-context-sidebar::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: var(--mobile-professional-sidebar-overlay);
            z-index: -1;
          }

          /* Mobile message input optimization */
          .message-input {
            min-height: var(--mobile-message-input-height);
            padding: 0.75rem 1rem;
          }

          /* Mobile conversation list optimization */
          .conversation-item {
            min-height: var(--mobile-touch-target-min);
            padding: 0.75rem 1rem;
          }

          /* Mobile touch feedback */
          .mobile-touch-feedback:active {
            background-color: var(--bs-tertiary-bg);
            transform: scale(0.98);
            transition: all 0.1s ease;
          }

          .conversation-item:active {
            background-color: var(--messaging-hover-bg);
            transform: translateX(2px);
          }
        }

        /* Tablet optimizations */
        @media (min-width: 768px) and (max-width: 1023px) {
          .messaging-panel {
            width: calc(100vw - 2rem);
            right: -100vw;
          }
          
          .conversation-window {
            max-width: calc(100vw - 2rem);
            max-height: calc(100vh - 4rem);
          }
        }

        /* Touch target size enforcement for all messaging elements */
        .messaging-panel .btn,
        .messaging-panel .nav-link,
        .messaging-panel .form-control,
        .conversation-item,
        .professional-context-action,
        .conversation-window .btn {
          min-height: var(--mobile-touch-target-min);
          min-width: var(--mobile-touch-target-min);
        }

        /* Performance optimizations */
        .messaging-panel,
        .conversation-window,
        .professional-context-sidebar {
          will-change: transform;
          transform: translateZ(0); /* Force hardware acceleration */
        }

        .conversation-list {
          contain: layout style paint;
        }

        /* Optimize animations for 60fps */
        @media (prefers-reduced-motion: no-preference) {
          .messaging-panel {
            transition: transform var(--messaging-panel-transition);
          }
        }

        @media (prefers-reduced-motion: reduce) {
          .messaging-panel {
            transition: none;
          }
        }

/* ========================================
   GLOBAL MESSAGING OVERLAY STYLES
   ======================================== */

/* Global Messaging Overlay */
.global-messaging-overlay {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background-color: var(--bs-body-bg);
  border-left: 1px solid var(--bs-border-color);
  z-index: 1050;
  transition: right var(--mobile-transition-speed) ease-in-out;
  display: flex;
  flex-direction: column;
}

.global-messaging-overlay.visible {
  right: 0;
}

/* Desktop: Right-side panel */
@media (min-width: 768px) {
  .global-messaging-overlay {
    width: 400px;
    right: -400px;
  }
  
  .global-messaging-overlay.visible {
    right: 0;
  }
}

/* Messaging Container */
.messaging-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Header */
.messaging-header {
  padding: 1rem;
  border-bottom: 1px solid var(--bs-border-color);
  background-color: var(--bs-body-bg);
  flex-shrink: 0;
}

.header-actions .btn {
  padding: 0.375rem 0.75rem;
  border-radius: var(--bs-border-radius-sm);
}

/* Search Container */
.search-container {
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Conversation List */
.conversation-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.conversation-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
  border-bottom: 1px solid var(--bs-border-color-translucent);
}

.conversation-item:hover {
  background-color: var(--bs-tertiary-bg);
}

.conversation-item.active {
  background-color: var(--bs-primary-bg-subtle);
  border-left: 3px solid var(--bs-primary);
}

.conversation-avatar {
  position: relative;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.conversation-avatar img {
  width: 40px;
  height: 40px;
  object-fit: cover;
}

.unread-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--bs-danger);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.conversation-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  /* Use full width - no sidebar constraints */
  width: 100%;
  max-width: 100%;
}

.conversation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.conversation-name {
  font-weight: 600;
  color: var(--bs-body-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px; /* Ensure truncation on long names */
}

.conversation-time {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
}

.conversation-preview {
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px; /* Ensure preview text truncates to make room for actions */
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  height: 200px;
}

/* Footer */
.messaging-footer {
  padding: 1rem;
  border-top: 1px solid var(--bs-border-color);
  background-color: var(--bs-body-bg);
  flex-shrink: 0;
}

/* Main Page Footer */
footer.footer {
  background-color: var(--bs-body-bg) !important;
  border-top: 2px solid var(--bs-border-color) !important;
  padding: 2rem 0 !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
  color: var(--bs-body-color) !important;
  width: 100% !important;
  display: block !important;
  position: relative !important;
  z-index: 10 !important;
  visibility: visible !important;
  opacity: 1 !important;
  clear: both !important;
  min-height: 80px !important;
  box-sizing: border-box !important;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--bs-body-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--bs-primary);
  text-decoration: none;
}

.footer-separator {
  color: var(--bs-secondary-color);
  margin: 0 0.25rem;
}

[data-bs-theme="dark"] .footer {
  background-color: var(--bs-body-bg);
  border-top-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .footer-link {
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .footer-link:hover {
  color: var(--bs-primary);
}

/* Loading and Error States */
.messaging-loading,
.messaging-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  height: 100%;
}

.messaging-loading .spinner-border {
  width: 3rem;
  height: 3rem;
}

/* Mobile Responsive */
@media (max-width: 767px) {
  .global-messaging-overlay {
    width: 100%;
  }
  
  .conversation-item {
    padding: 1rem;
  }
  
  .conversation-avatar img {
    width: 48px;
    height: 48px;
  }
}

/* ========================================
   CONVERSATION WINDOW STYLES
   ======================================== */

/* Conversation Window */
.conversation-window {
  background-color: var(--messaging-panel-bg);
  color: var(--bs-body-color);
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all var(--messaging-panel-transition);
  user-select: none;
  min-width: 0;
}

.conversation-window.minimized {
  height: 60px !important;
}

.conversation-window.dragging {
  cursor: move;
  transform: scale(1.02);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Header */
.conversation-header {
  background-color: var(--messaging-hover-bg);
  color: var(--bs-body-color);
  padding: 0.75rem 1rem;
  flex-shrink: 0;
  border-bottom: 1px solid var(--messaging-panel-border);
}

.conversation-avatar {
  position: relative;
  width: 32px;
  height: 32px;
}

.conversation-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.online-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background-color: var(--bs-success);
  border: 2px solid white;
  border-radius: 50%;
}

.conversation-info {
  min-width: 0;
}

.conversation-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--bs-body-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-info small {
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
}

.conversation-actions .btn {
  padding: 0.25rem 0.5rem;
  border-color: transparent;
  color: inherit;
  font-size: 0.75rem;
}

.conversation-actions .btn:hover {
  background-color: var(--messaging-hover-bg);
  border-color: transparent;
}

/* Messages Area */


.message {
  display: flex;
  max-width: 80%;
}

.message-sent {
  align-self: flex-end;
}

.message-received {
  align-self: flex-start;
}

.message-content {
  background-color: var(--bs-tertiary-bg);
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  position: relative;
}

.message-sent .message-content {
  background-color: var(--bs-primary);
  color: white;
}

.message-text {
  margin-bottom: 0.25rem;
  word-wrap: break-word;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  opacity: 0.7;
}

.message-time {
  margin-right: 0.5rem;
}

.message-status {
  display: flex;
  align-items: center;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: var(--bs-tertiary-bg);
  border-radius: 1rem;
  max-width: 120px;
}

.typing-dots {
  display: flex;
  gap: 0.25rem;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background-color: var(--bs-secondary);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

.typing-text {
  font-size: 0.75rem;
  color: var(--bs-secondary);
  font-style: italic;
}

/* Empty Messages */
.empty-messages {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  color: var(--bs-secondary);
}

/* Input Area */
.conversation-input {
  padding: 1rem;
  background-color: var(--messaging-panel-bg);
  border-top: 1px solid var(--messaging-panel-border);
  flex-shrink: 0;
}

.conversation-input .input-group {
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.conversation-input .form-control {
  border: none;
  border-radius: 0;
  padding: 0.75rem 1rem;
  background-color: var(--bs-body-bg);
}

.conversation-input .form-control:focus {
  box-shadow: none;
  background-color: var(--bs-body-bg);
}

.conversation-input .btn {
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 0;
}

.conversation-input .btn:first-child {
  border-right: 1px solid var(--bs-border-color);
}

.conversation-input .btn:last-child {
  border-left: 1px solid var(--bs-border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
  .conversation-window.minimized {
    height: 60px !important;
  }
}

/* ========================================
   MESSAGE REQUEST SYSTEM STYLES
   ======================================== */

/* Message Request Inbox */
.message-request-inbox {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.inbox-header {
  padding: 1rem;
  border-bottom: 1px solid var(--bs-border-color);
  background-color: var(--bs-body-bg);
}

.inbox-header h3 {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  color: var(--bs-body-color);
}

/* Inbox Tabs */
.inbox-tabs {
  display: flex;
  gap: 0.5rem;
}

.tab-btn {
  padding: 0.5rem 1rem;
  border: none;
  background-color: transparent;
  color: var(--bs-body-color);
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  background-color: var(--bs-secondary-bg);
  border-radius: 0.25rem 0.25rem 0 0;
}

.tab-btn.active {
  color: var(--bs-primary);
  border-bottom-color: var(--bs-primary);
  font-weight: 600;
}

.tab-btn .badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
}

/* Loading Container */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.loading-container .spinner-border {
  width: 2.5rem;
  height: 2.5rem;
}

.loading-container p {
  color: var(--bs-text-muted);
  margin-top: 1rem;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.empty-state i {
  font-size: 3rem;
  color: var(--bs-secondary);
  margin-bottom: 1rem;
}

.empty-state p {
  color: var(--bs-text-muted);
  margin: 0;
}

/* Requests List */
.requests-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

/* Message Request Card */
.message-request-card {
  background-color: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}

.message-request-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: var(--bs-primary);
}

.message-request-card.unread {
  background-color: var(--bs-primary-bg-subtle);
  border-left: 3px solid var(--bs-primary);
}

/* Request Header */
.request-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.sender-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bs-border-color);
}

.sender-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sender-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bs-body-color);
}

.request-date {
  font-size: 0.85rem;
  color: var(--bs-text-muted);
}

/* Request Status */
.request-status {
  flex-shrink: 0;
}

.badge-warning {
  background-color: #ffc107;
  color: #000;
}

.badge-success {
  background-color: var(--bs-success);
  color: var(--bs-white);
}

.badge-secondary {
  background-color: var(--bs-secondary);
  color: var(--bs-white);
}

.badge-danger {
  background-color: var(--bs-danger);
  color: var(--bs-white);
}

/* Request Subject */
.request-subject {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.request-subject strong {
  color: var(--bs-body-color);
}

/* Request Message */
.request-message {
  color: var(--bs-body-color);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  word-wrap: break-word;
}

/* Request Actions */
.request-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.request-actions .btn {
  flex: 1;
  min-height: 44px;
  font-size: 0.9rem;
}

.request-actions .btn-primary {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.request-actions .btn-primary:hover {
  background-color: var(--color-teal-dark);
  border-color: var(--color-teal-dark);
}

.request-actions .btn-outline-secondary {
  color: var(--bs-secondary);
  border-color: var(--bs-secondary);
}

.request-actions .btn-outline-secondary:hover {
  background-color: var(--bs-secondary);
  color: var(--bs-white);
}

/* Decline Reason */
.decline-reason {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background-color: var(--bs-secondary-bg);
  border-radius: 0.25rem;
  font-size: 0.85rem;
}

.decline-reason small {
  color: var(--bs-body-color);
}

/* Expiration Info */
.expiration-info {
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.expiration-info small {
  color: var(--bs-text-muted);
}

/* Send Message Request Modal */
.modal-dialog {
  max-width: 500px;
}

.modal-content {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  border: 1px solid var(--bs-border-color);
}

.modal-header {
  border-bottom: 1px solid var(--bs-border-color);
}

.modal-footer {
  border-top: 1px solid var(--bs-border-color);
}

.modal-title {
  color: var(--bs-body-color);
  font-weight: 600;
}

/* Alert Styles */
.alert-info {
  background-color: var(--bs-info-bg-subtle);
  border-color: var(--bs-info);
  color: var(--bs-body-color);
}

.alert-danger {
  background-color: var(--bs-danger-bg-subtle);
  border-color: var(--bs-danger);
  color: var(--bs-body-color);
}

.alert-warning {
  background-color: var(--bs-warning-bg-subtle);
  border-color: var(--bs-warning);
  color: var(--bs-body-color);
}

.alert-secondary {
  background-color: var(--bs-secondary-bg);
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
}

/* Form Controls */
.form-label {
  color: var(--bs-body-color);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-control {
  background-color: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  color: var(--bs-body-color);
}

.form-control:focus {
  background-color: var(--bs-body-bg);
  border-color: var(--bs-primary);
  color: var(--bs-body-color);
  box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.form-control:disabled {
  background-color: var(--bs-secondary-bg);
  color: var(--bs-text-muted);
  cursor: not-allowed;
}

.text-muted {
  color: var(--bs-text-muted) !important;
}

.text-danger {
  color: var(--bs-danger) !important;
}

/* Character Counter */
small.text-muted {
  font-size: 0.8rem;
  display: block;
  margin-top: 0.25rem;
}

/* Checkbox Styling */
.form-check-input {
  background-color: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  cursor: pointer;
}

.form-check-input:checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.form-check-input:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.form-check-label {
  color: var(--bs-body-color);
  cursor: pointer;
}

/* Spinner Button State */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .message-request-card {
    padding: 0.75rem;
  }

  .profile-avatar {
    width: 40px;
    height: 40px;
  }

  .sender-name {
    font-size: 0.95rem;
  }

  .request-date {
    font-size: 0.8rem;
  }

  .request-actions {
    flex-direction: column;
  }

  .request-actions .btn {
    width: 100%;
  }

  .inbox-header h3 {
    font-size: 1.1rem;
  }

  .tab-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
  }

  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }
}

/* Tablet Responsive */
@media (min-width: 768px) and (max-width: 1023px) {
  .requests-list {
    padding: 1.25rem;
  }

  .message-request-card {
    padding: 1.25rem;
  }
}

/* Desktop Enhancements */
@media (min-width: 1024px) {
  .message-request-card:hover {
    transform: translateY(-2px);
  }

  .request-actions .btn {
    transition: all 0.2s ease;
  }

  .request-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
}

/* Dark Theme Support */
[data-bs-theme="dark"] .message-request-card {
  background-color: var(--bs-dark);
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .message-request-card.unread {
  background-color: rgba(var(--bs-primary-rgb), 0.15);
}

[data-bs-theme="dark"] .profile-avatar {
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .modal-content {
  background-color: var(--bs-dark);
}

[data-bs-theme="dark"] .form-control {
  background-color: var(--bs-dark);
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .form-control:focus {
  background-color: var(--bs-dark);
}

[data-bs-theme="dark"] .badge-warning {
  background-color: #ffc107;
  color: #000;
}

/* Accessibility */
.message-request-card:focus-visible,
.tab-btn:focus-visible,
.request-actions .btn:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

/* Touch Targets - Ensure minimum 44x44px */
@media (max-width: 768px) {
  .tab-btn,
  .request-actions .btn,
  .profile-avatar {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ========================================
   PROFESSIONAL CONTEXT PANEL STYLES
   ======================================== */

/* Professional Context Panel */
.professional-context-panel {
  background-color: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  max-height: 600px;
  overflow-y: auto;
}

/* Loading and Error States */
.context-loading,
.context-error,
.empty-context {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.context-loading .spinner-border {
  width: 2rem;
  height: 2rem;
}

/* Context Content */
.context-content {
  padding: 1.5rem;
}

/* Participant Header */
.participant-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bs-border-color);
}

.participant-avatar {
  position: relative;
  flex-shrink: 0;
}

.participant-avatar img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 50%;
}

.online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background-color: var(--bs-success);
  border: 2px solid var(--bs-body-bg);
  border-radius: 50%;
}

.participant-info {
  flex: 1;
  min-width: 0;
}

.participant-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--bs-body-color);
  margin-bottom: 0.25rem;
}

.participant-title {
  font-size: 0.9rem;
  color: var(--bs-primary);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.participant-company {
  font-size: 0.85rem;
  color: var(--bs-secondary-color);
  margin-bottom: 0.5rem;
}

.participant-summary {
  font-size: 0.85rem;
  color: var(--bs-body-color);
  line-height: 1.4;
  margin-bottom: 0;
}

/* Section Titles */
.section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--bs-body-color);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
}

/* Connection Strength */
.connection-strength-section {
  margin-bottom: 1.5rem;
}

.strength-meter {
  margin-bottom: 0.75rem;
}

.strength-bar {
  height: 8px;
  background-color: var(--bs-tertiary-bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.strength-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--bs-danger) 0%, var(--bs-warning) 50%, var(--bs-success) 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.strength-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.strength-level {
  font-weight: 500;
  color: var(--bs-body-color);
}

.strength-score {
  color: var(--bs-secondary-color);
}

.strength-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-item {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
}

.detail-item i {
  width: 16px;
  color: var(--bs-primary);
}

/* Mutual Connections */
.mutual-connections-section {
  margin-bottom: 1.5rem;
}

.mutual-connections-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mutual-connection-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background-color: var(--bs-tertiary-bg);
  border-radius: var(--bs-border-radius-sm);
}

.connection-avatar {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}

.connection-info {
  flex: 1;
  min-width: 0;
}

.connection-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--bs-body-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.connection-title {
  font-size: 0.75rem;
  color: var(--bs-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.connection-company {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.connection-degree {
  flex-shrink: 0;
}

/* Shared Groups */
.shared-groups-section {
  margin-bottom: 1.5rem;
}

.shared-groups-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.shared-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background-color: var(--bs-tertiary-bg);
  border-radius: var(--bs-border-radius-sm);
}

.group-info {
  flex: 1;
  min-width: 0;
}

.group-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--bs-body-color);
  margin-bottom: 0.25rem;
}

.group-description {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  margin-bottom: 0.25rem;
}

.group-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.7rem;
  color: var(--bs-secondary-color);
}

.member-count,
.active-members {
  display: flex;
  align-items: center;
}

.group-role {
  flex-shrink: 0;
}

/* Skills */
.skills-section {
  margin-bottom: 1.5rem;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  background-color: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--bs-border-radius-pill);
  font-size: 0.75rem;
  font-weight: 500;
}

.skill-tag.more-skills {
  background-color: var(--bs-secondary-bg);
  color: var(--bs-secondary-color);
}

/* Show More */
.show-more {
  text-align: center;
  margin-top: 0.5rem;
}

/* Context Actions */
.context-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bs-border-color);
}

.context-actions .btn {
  width: 100%;
  justify-content: center;
}

/* Responsive Design */
@media (max-width: 768px) {
  .professional-context-panel {
    max-height: 70vh;
  }
  
  .participant-header {
    flex-direction: column;
    text-align: center;
  }
  
  .participant-avatar {
    align-self: center;
  }
  
  .context-actions {
    flex-direction: row;
  }
  
  .context-actions .btn {
    flex: 1;
  }
}

/* ========================================
   SEMANTIC GRAPH STYLES
   ======================================== */

/* Semantic Graph Container - Theme-Aware */
.semantic-graph {
    min-height: 20rem;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
}

/* Semantic Graph SVG Elements - Theme-Aware */
.semantic-graph svg {
    background-color: transparent;
}

.semantic-graph .node text {
    fill: var(--bs-body-color) !important;
    font-family: var(--bs-font-sans-serif);
    font-size: 12px;
    font-weight: 500;
}

.semantic-graph .node circle {
    stroke: var(--bs-border-color);
    stroke-width: 1.5px;
    fill: var(--bs-tertiary-bg);
}

.semantic-graph .link {
    stroke: var(--bs-border-color);
    stroke-opacity: 0.6;
    stroke-width: 1px;
}

/* Ensure all text elements in the graph have proper contrast */
.semantic-graph text {
    fill: var(--bs-body-color) !important;
}

.semantic-graph .label {
    fill: var(--bs-body-color) !important;
}

.semantic-graph .title {
    fill: var(--bs-body-color) !important;
}

/* Dark theme specific adjustments */
[data-bs-theme="dark"] .semantic-graph .node text {
    fill: #ffffff !important;
}

[data-bs-theme="dark"] .semantic-graph text {
    fill: #ffffff !important;
}

[data-bs-theme="dark"] .semantic-graph .label {
    fill: #ffffff !important;
}

[data-bs-theme="dark"] .semantic-graph .title {
    fill: #ffffff !important;
}

[data-bs-theme="dark"] .semantic-graph .link {
    stroke: var(--bs-border-color);
    stroke-opacity: 0.8;
}

[data-bs-theme="dark"] .semantic-graph .node circle {
    fill: var(--bs-dark);
    stroke: var(--bs-light);
}

/* Light theme specific adjustments */
[data-bs-theme="light"] .semantic-graph .node text {
    fill: #000000 !important;
}

[data-bs-theme="light"] .semantic-graph text {
    fill: #000000 !important;
}

[data-bs-theme="light"] .semantic-graph .label {
    fill: #000000 !important;
}

[data-bs-theme="light"] .semantic-graph .title {
    fill: #000000 !important;
}

[data-bs-theme="light"] .semantic-graph .link {
    stroke: var(--bs-border-color);
    stroke-opacity: 0.4;
}

[data-bs-theme="light"] .semantic-graph .node circle {
    fill: var(--bs-light);
    stroke: var(--bs-dark);
}

/* --- AI Dashboard & Semantic Search Styles --- */

.ai-dashboard-icon {
    font-size: 2rem;
    color: var(--accent-primary);
}

.ai-dashboard-icon-large {
    font-size: 4rem;
    color: var(--accent-primary);
}

/* Card for individual search results */
.search-result-card {
    transition: box-shadow 0.2s ease-in-out;
    border-left: 3px solid transparent; /* Placeholder for potential future status indicators */
}

.search-result-card:hover {
    box-shadow: 0 4px 12px rgba(var(--bs-emphasis-color-rgb), 0.08);
    border-left-color: var(--bs-primary);
}

/* Container for AI-generated insights */
.intelligent-context.bg-body-tertiary {
    border-left: 3px solid var(--bs-warning);
    padding: 0.75rem;
}

/* Highlights for factual matches */
.match-highlights .badge {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Conversation starter topic badges */
.suggested-topics .badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
}

/* Collapsible detailed breakdown section */
.match-breakdown a {
    cursor: pointer;
    text-decoration: none;
}
.match-breakdown a:hover {
    text-decoration: underline;
}

.match-breakdown .collapse {
    transition: all 0.3s ease-in-out;
}

/* Scrollbar styling for the breakdown content */
.match-breakdown .card-body::-webkit-scrollbar { width: 6px; }
.match-breakdown .card-body::-webkit-scrollbar-track { background: transparent; }
.match-breakdown .card-body::-webkit-scrollbar-thumb { background: var(--bs-secondary-bg); border-radius: 3px; }
.match-breakdown .card-body::-webkit-scrollbar-thumb:hover { background: var(--bs-secondary); }

/* --- Accessibility Enhancements --- */
.mobile-touch-target {
    min-height: var(--mobile-touch-target-min, 44px);
    min-width: var(--mobile-touch-target-min, 44px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   SEMANTIC SEARCH AI DASHBOARD FIXES
   ======================================== */

/* Fix contrast for semantic search match percentages and details */
.search-result-card .badge {
  background-color: var(--bs-primary) !important;
  color: var(--bs-white) !important;
}

/* Fix contrast for "Why this matches" section */
.match-highlights .small {
  color: var(--bs-text-muted) !important;
}

.match-highlights .text-body-tertiary {
  color: var(--bs-text-muted) !important;
}

.match-highlights .badge {
  background-color: var(--bs-secondary-bg-subtle) !important;
  color: var(--bs-body-color) !important;
  border: 1px solid var(--bs-border-color);
}

/* Fix contrast for score percentages within badges */
.match-highlights .badge span {
  color: var(--bs-body-color) !important;
}

/* Fix contrast for match details text */
.search-result-card .text-body-secondary {
  color: var(--bs-text-muted) !important;
}

/* Fix contrast for AI insights text */
.intelligent-context .text-body-secondary {
  color: var(--bs-text-muted) !important;
}

/* Fix contrast for breakdown link */
.match-breakdown a {
  color: var(--bs-text-muted) !important;
}

.match-breakdown a:hover {
  color: var(--bs-primary) !important;
}

/* Fix contrast for debug panel elements */
.debug-panel .badge.bg-body-secondary {
  background-color: var(--bs-secondary-bg-subtle) !important;
  color: var(--bs-body-color) !important;
  border: 1px solid var(--bs-border-color);
}

.debug-panel .badge.text-body {
  color: var(--bs-body-color) !important;
}

/* Fix contrast for semantic response metadata */
.semantic-response-meta .bg-body-tertiary {
  background-color: var(--bs-secondary-bg-subtle) !important;
  color: var(--bs-body-color) !important;
}

.semantic-response-meta .text-body {
  color: var(--bs-body-color) !important;
}

/* Fix contrast for debug panel headings */
.debug-panel h6 {
  color: var(--bs-body-color) !important;
}

/* --- General Component Styles --- */
.profile-img-lg {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border: 2px solid var(--bs-border-color-translucent);
}

.modal-show {
    display: block;
}

/* ========================================
   AI Search Results - Theme-Aware Styling
   ======================================== */

/* Debug panel styling */
.search-debug-panel {
    background-color: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
}

/* Search result badges */
.search-badge {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
    padding: 0.25rem 0.5rem;
    border-radius: var(--bs-border-radius-sm);
    font-size: 0.875rem;
}

/* Ensure proper contrast in dark mode */
[data-bs-theme="dark"] .search-badge {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Search result card hover state */
.search-result-card:hover {
    background-color: var(--bs-tertiary-bg);
    transition: background-color 0.15s ease-in-out;
}

/* ========================================
   NETWORK ANALYSIS CHAT COMPONENT STYLES
   ======================================== */

/* Main chat container */
.network-chat-container {
    display: flex;
    flex-direction: column;
    height: 600px;
    max-height: 80vh;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    overflow: hidden;
}

/* Chat header */
.network-chat-header {
    padding: 1rem;
    background-color: var(--bs-primary);
    color: var(--bs-white);
    border-bottom: 1px solid var(--bs-border-color);
    flex-shrink: 0;
}

.network-chat-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Message list container */
.network-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: var(--bs-body-bg);
    scroll-behavior: smooth;
}

/* Mobile-first: reduce padding on small screens */
@media (max-width: 768px) {
    .network-chat-messages {
        padding: 0.5rem;
    }
}

/* Individual message wrapper */
.chat-message {
    display: flex;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* User messages aligned right */
.chat-message.user {
    justify-content: flex-end;
}

/* Assistant messages aligned left */
.chat-message.assistant {
    justify-content: flex-start;
}

/* Message avatar */
.chat-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    margin: 0 0.5rem;
    flex-shrink: 0;
}

/* Mobile: Smaller avatars */
@media (max-width: 768px) {
    .chat-avatar {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 0.75rem;
    }
}

/* User avatar styling */
.chat-message.user .chat-avatar {
    background-color: var(--bs-primary);
    color: var(--bs-white);
    order: 2;
}

/* Assistant avatar styling */
.chat-message.assistant .chat-avatar {
    background-color: var(--bs-secondary);
    color: var(--bs-white);
    order: 1;
}

/* Message bubble */
.chat-bubble {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: var(--bs-border-radius-lg);
    word-wrap: break-word;
    position: relative;
}

/* Mobile: Allow bubbles to take more width */
@media (max-width: 768px) {
    .chat-bubble {
        max-width: 85%;
        padding: 0.625rem 0.875rem;
        font-size: 0.9375rem;
    }
}

/* User message bubble */
.chat-message.user .chat-bubble {
    background-color: var(--bs-primary);
    color: var(--bs-white);
    order: 1;
    border-bottom-right-radius: 0.25rem;
}

/* Assistant message bubble */
.chat-message.assistant .chat-bubble {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
    order: 2;
    border-bottom-left-radius: 0.25rem;
}

/* Message timestamp */
.chat-timestamp {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    opacity: 0.8;
    margin-top: 0.25rem;
}

/* Message metadata (query type, processing time) */
.chat-metadata {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--bs-border-color);
    opacity: 0.9;
}

.chat-metadata-item {
    display: inline-block;
    margin-right: 1rem;
}

/* Markdown content within messages */
.chat-bubble h1,
.chat-bubble h2,
.chat-bubble h3 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: inherit;
}

.chat-bubble ul,
.chat-bubble ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.chat-bubble li {
    margin-bottom: 0.25rem;
}

.chat-bubble code {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875em;
}

[data-bs-theme="dark"] .chat-bubble code {
    background-color: rgba(255, 255, 255, 0.1);
}

.chat-bubble strong {
    font-weight: 600;
}

.chat-bubble p {
    margin-bottom: 0.5rem;
}

.chat-bubble p:last-child {
    margin-bottom: 0;
}

/* Chat input area */
.network-chat-input {
    padding: 1rem;
    background-color: var(--bs-body-bg);
    border-top: 1px solid var(--bs-border-color);
    flex-shrink: 0;
}

/* Mobile: Reduce padding */
@media (max-width: 768px) {
    .network-chat-input {
        padding: 0.75rem;
    }
}

/* Input group styling */
.chat-input-group {
    display: flex;
    gap: 0.5rem;
}

/* Text input */
.chat-input-field {
    flex: 1;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-size: 0.9375rem;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    overflow-y: auto;
}

.chat-input-field:focus {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 128, 128, 0.25);
}

/* Send button */
.chat-send-button {
    min-width: 44px;
    min-height: 44px;
    padding: 0.625rem 1.25rem;
    background-color: var(--bs-primary);
    color: var(--bs-white);
    border: none;
    border-radius: var(--bs-border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    flex-shrink: 0;
}

.chat-send-button:hover:not(:disabled) {
    background-color: var(--color-teal-dark);
}

.chat-send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-send-button:active:not(:disabled) {
    transform: scale(0.98);
}

/* Mobile: Icon-only button */
@media (max-width: 768px) {
    .chat-send-button .button-text {
        display: none;
    }
}

/* Desktop: Show full button text */
@media (min-width: 769px) {
    .chat-send-button .button-icon {
        margin-right: 0.375rem;
    }
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.typing-indicator .chat-avatar {
    margin-right: 0.5rem;
}

.typing-dots {
    background-color: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    padding: 0.75rem 1rem;
    border-radius: var(--bs-border-radius-lg);
    border-bottom-left-radius: 0.25rem;
    display: flex;
    gap: 0.375rem;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--bs-secondary-color);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-10px);
    }
}

/* Error message styling */
.chat-error-message {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--bs-danger);
    color: var(--bs-danger);
    padding: 0.75rem 1rem;
    border-radius: var(--bs-border-radius);
    margin-bottom: 1rem;
}

[data-bs-theme="dark"] .chat-error-message {
    background-color: rgba(220, 53, 69, 0.2);
}

/* Empty state message */
.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--bs-secondary-color);
    text-align: center;
    padding: 2rem;
}

.chat-empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.chat-empty-state-text {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.chat-empty-state-subtext {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Data sources badge (shows which databases were queried) */
.data-sources-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.data-source-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-pill);
    font-size: 0.75rem;
    color: var(--bs-body-color);
}

/* Accessibility: Ensure minimum touch target size */
.chat-send-button,
.chat-input-field {
    min-height: var(--mobile-touch-target-min, 44px);
}

/* Loading state */
.chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--bs-secondary-color);
}

/* Desktop: Larger container */
@media (min-width: 1024px) {
    .network-chat-container {
        height: 700px;
    }
    
    .chat-bubble {
        max-width: 60%;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .network-chat-container {
        height: 650px;
    }
}

/* Pro Member upgrade prompt (for free users who try to access) */
.chat-upgrade-prompt {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--color-teal-dark) 100%);
    color: var(--bs-white);
    padding: 2rem;
    border-radius: var(--bs-border-radius);
    text-align: center;
    margin: 2rem auto;
    max-width: 500px;
}

.chat-upgrade-prompt h4 {
    margin-bottom: 1rem;
    font-weight: 600;
}

.chat-upgrade-prompt p {
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.chat-upgrade-button {
    background-color: var(--bs-white);
    color: var(--bs-primary);
    padding: 0.75rem 2rem;
    border: none;
    border-radius: var(--bs-border-radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: var(--mobile-touch-target-min, 44px);
}

.chat-upgrade-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Scrollbar styling for chat messages */
.network-chat-messages::-webkit-scrollbar {
    width: 8px;
}

.network-chat-messages::-webkit-scrollbar-track {
    background-color: var(--bs-tertiary-bg);
    border-radius: 4px;
}

.network-chat-messages::-webkit-scrollbar-thumb {
    background-color: var(--bs-secondary-color);
    border-radius: 4px;
}

.network-chat-messages::-webkit-scrollbar-thumb:hover {
    background-color: var(--bs-primary);
}

/* Dark theme overrides */
[data-bs-theme="dark"] .network-chat-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .chat-message.assistant .chat-bubble {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .chat-input-field {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .chat-input-field:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 128, 128, 0.4);
}

/* ==================== Network Intelligence Components (Phase 6-7) ==================== */

/* Connection Path Visualization */
.connection-path-container {
    display: flex;
    align-items: center;
    overflow-x: auto;
    padding: 20px 10px;
}

.path-node {
    text-align: center;
    min-width: 100px;
}

.node-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 10px;
}

.node-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.node-self {
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-primary));
    border: 3px solid var(--bs-primary);
}

.node-intermediary {
    background: linear-gradient(135deg, var(--bs-secondary), var(--bs-secondary));
    border: 3px solid var(--bs-secondary);
}

.node-target {
    background: linear-gradient(135deg, var(--bs-success), var(--bs-success));
    border: 3px solid var(--bs-success);
}

.node-initials {
    font-size: 24px;
    font-weight: bold;
    color: white;
}

.node-name {
    font-size: 0.85rem;
    color: var(--bs-body-color);
}

.path-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 15px;
    min-width: 80px;
}

.connector-line {
    height: 4px;
    width: 80px;
    margin-bottom: 5px;
    border-radius: 2px;
}

.connector-info {
    text-align: center;
}

/* Network Stats Card */
.stat-box {
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    margin-right: 10px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .connection-path-container {
        flex-direction: column;
    }
    
    .path-connector {
        transform: rotate(90deg);
        margin: 15px 0;
    }
    
    .connector-info {
        transform: rotate(-90deg);
    }
}

/* ==================== AI Dashboard UI Rework (Nov 2025) ==================== */
/*
 * Responsive AI Dashboard styles following CSS Style Guide
 * - Uses CSS variables (Rule #1)
 * - Bootstrap utilities for layout (Rule #2)
 * - Mobile-first responsive design (Rule #8)
 * - Touch target accessibility 44px minimum (Rule #9)
 * - Breakpoint consistency: 768px, 1024px (Rule #11)
 */

/* AI Dashboard Tab Navigation - Compact */
.ai-dashboard-tabs {
    background-color: var(--bs-body-bg);
    border-radius: 0.375rem;
    padding: 0.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 0.75rem;
}

.ai-dashboard-tabs .nav-link {
    border-radius: 0.25rem;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    color: var(--bs-body-color);
    background-color: transparent;
    font-size: 0.875rem;
}

.ai-dashboard-tabs .nav-link:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    border-color: rgba(var(--bs-primary-rgb), 0.2);
}

.ai-dashboard-tabs .nav-link.active {
    background-color: var(--bs-primary);
    color: white;
    box-shadow: 0 2px 4px rgba(var(--bs-primary-rgb), 0.25);
}

.ai-dashboard-tabs .nav-link i {
    transition: transform 0.2s ease;
}

.ai-dashboard-tabs .nav-link:hover i {
    transform: scale(1.05);
}

/* AI Dashboard Container - Full width, no constraints */
.ai-dashboard-container {
    width: 100%;
    margin: 0;
}

.ai-dashboard-header-compact {
    margin-bottom: 0.5rem;
    padding: 0.375rem 0;
}

.ai-dashboard-header-compact h1 {
    font-weight: 600;
    font-size: 1rem;
    color: var(--bs-body-color);
}

.ai-dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
}

.ai-tab-icon {
    font-size: 1.25rem;
}

.ai-main-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 20rem;
}

.ai-main-panel-header {
    flex: 0 0 auto;
    padding: 0.75rem 1rem !important;
}

.ai-main-panel-header h3 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.ai-main-panel-header p {
    font-size: 0.875rem;
    margin-bottom: 0;
}

.ai-panel-divider {
    height: 1px;
    background-color: var(--bs-border-color);
    opacity: 0.6;
}

.ai-main-panel-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ai-results-shell {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    overflow-y: auto;
}

.ai-panel-heading {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ai-panel-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    background-color: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--bs-primary);
    font-size: 1.375rem;
}

[data-bs-theme="dark"] .ai-panel-icon {
    background-color: rgba(var(--bs-primary-rgb), 0.24);
}

.ai-panel-stat .badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
}

.ai-summary-card {
    background-color: rgba(var(--bs-primary-rgb), 0.08);
    border-left: 0.25rem solid var(--bs-primary);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

[data-bs-theme="dark"] .ai-summary-card {
    background-color: rgba(var(--bs-primary-rgb), 0.14);
}

.ai-sidebar-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ai-sidebar-scroll {
    max-height: 18rem;
    overflow-y: auto;
}

.ai-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ai-pill-group .badge {
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
}

.ai-recent-mini {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8125rem;
}

.ai-metadata-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.ai-metadata-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--bs-body-secondary);
}

.ai-metadata-list li span:first-child {
    color: var(--bs-body-secondary);
    font-weight: 500;
}

.ai-metadata-list li span:last-child {
    color: var(--bs-body-color);
    font-weight: 600;
    text-align: right;
    flex: 1 1 45%;
    min-width: 6rem;
}

/* Semantic Search Card */
.semantic-search-card {
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    transition: box-shadow 0.2s ease;
    padding: 0.75rem;
}

.semantic-search-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Search Results List */
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-results-list .card {
    transition: all 0.2s ease;
    border: 1px solid var(--bs-border-color);
    padding: 0.75rem;
}

.search-results-list .card:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.search-results-list .card .card-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.search-results-list .card .card-text {
    font-size: 0.875rem;
}

/* Collapsible Section Buttons */
.collapsible-toggle {
    transition: all 0.2s ease;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.collapsible-toggle:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    transform: translateX(2px);
}

.collapsible-toggle i {
    transition: transform 0.2s ease;
}

.collapsible-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* Mobile Touch Targets - 44px minimum per Style Guide Rule #9 */
.mobile-touch-target {
    min-height: 44px;
    min-width: 44px;
    padding: 0.75rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   6.3 Mobile-Specific Components - Cancellation Banner
   ======================================== */

/* Mobile touch target enforcement for action buttons */
.btn-touch-target {
  min-height: var(--mobile-touch-target-min);
  min-width: var(--mobile-touch-target-min);
}

/* Desktop can use default button sizing */
@media (min-width: 1024px) {
  .btn-touch-target {
    min-height: auto;
    min-width: auto;
  }
}

/* Result Card Expansion */
.result-expand-btn {
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
}

.result-expand-btn:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.result-expand-btn i {
    transition: transform 0.2s ease;
}

.result-expand-btn[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* Load More Button */
.load-more-btn {
    transition: all 0.3s ease;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(var(--bs-primary-rgb), 0.3);
}

/* Compact Alert Styling */
.compact-alert {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

/* Metadata Badges */
.metadata-badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.metadata-badge-group .badge {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
}

/* Dark Theme Overrides for AI Dashboard */
[data-bs-theme="dark"] .ai-dashboard-tabs {
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .ai-dashboard-tabs .nav-link:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.15);
}

[data-bs-theme="dark"] .semantic-search-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .semantic-search-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .search-results-list .card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* ==================== Responsive Breakpoints (Mobile-First) ==================== */

/* Mobile: < 768px (Style Guide Rule #11) */
@media (max-width: 768px) {
    .ai-dashboard-tabs {
        padding: 0.25rem;
    }

    .ai-dashboard-tabs .nav-link {
        padding: 0.5rem 0.5rem;
        font-size: 0.8125rem;
    }

    .ai-dashboard-tabs .nav-link i {
        font-size: 1.125rem;
    }

    .ai-dashboard-header-compact h1 {
        font-size: 0.9rem;
    }

    .ai-main-panel-header {
        padding: 0.5rem 0.75rem !important;
    }

    .ai-main-panel-header h3 {
        font-size: 1rem;
    }

    .ai-main-panel-header p {
        font-size: 0.8125rem;
    }

    /* Enhanced touch targets for mobile (48px) */
    .mobile-touch-target {
        min-height: 48px;
        min-width: 48px;
    }

    .search-results-list {
        gap: 0.375rem;
    }

    .load-more-btn {
        width: 100%;
    }

    /* Compact spacing for mobile */
    .semantic-search-card {
        padding: 0.625rem;
    }

    .metadata-badge-group {
        gap: 0.25rem;
    }

    .metadata-badge-group .badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (min-width: 768px) {
    .ai-dashboard-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .ai-main-panel {
        min-height: 32rem;
    }

    .ai-results-shell {
        padding-right: 0.25rem;
    }

    .ai-panel-heading {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* Tablet: 769px - 1024px (Style Guide Rule #11) */
@media (min-width: 769px) and (max-width: 1024px) {
    .ai-dashboard-tabs .nav-link {
        padding: 0.875rem 1rem;
    }

    .search-results-list {
        gap: 0.625rem;
    }
}

/* Desktop: ≥ 1024px */
@media (min-width: 1024px) {

    .search-results-list .card {
        transition: all 0.3s ease;
    }

    /* Enhanced hover effects for desktop */
    .ai-dashboard-tabs .nav-link:hover {
        transform: translateY(-3px);
    }

    .load-more-btn:hover {
        transform: translateY(-3px);
    }

    .ai-main-panel {
        min-height: 36rem;
    }
}

/* Sidebar Styles */
.ai-sidebar-card {
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.ai-sidebar-card h6 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--bs-body-color);
}

.ai-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bs-border-color);
}

.ai-stat-item:last-child {
    border-bottom: none;
}

.ai-stat-label {
    font-size: 0.813rem;
    color: var(--bs-body-secondary);
}

.ai-stat-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bs-primary);
}

.ai-tip-item {
    padding: 0.75rem;
    background-color: rgba(var(--bs-primary-rgb), 0.05);
    border-left: 3px solid var(--bs-primary);
    border-radius: 0.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.813rem;
    line-height: 1.4;
}

.ai-tip-item:last-child {
    margin-bottom: 0;
}

.ai-recent-activity-item {
    display: flex;
    align-items: start;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--bs-border-color);
}

.ai-recent-activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ai-activity-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    margin-right: 0.75rem;
    font-size: 0.875rem;
}

.ai-activity-content {
    flex-grow: 1;
    min-width: 0;
}

.ai-activity-text {
    font-size: 0.813rem;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.ai-activity-time {
    font-size: 0.75rem;
    color: var(--bs-body-secondary);
}

/* Dark theme overrides for sidebar */
[data-bs-theme="dark"] .ai-sidebar-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .ai-tip-item {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

/* =========================================================================
   CONNECTION HUB DASHBOARD STYLES (Sprint 2-3)
   Mobile-first responsive design for connection management
   ========================================================================= */

/* Connection Hub Container */
.connection-hub {
  padding: 1rem;
  max-width: 100%;
}

.connection-hub-header {
  margin-bottom: 1.5rem;
}

.connection-hub-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--bs-body-color);
  margin-bottom: 0.5rem;
}

/* Quick Stats Panel - Mobile First */
.connection-stats-panel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background-color: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.stat-card-primary {
  background-color: var(--bs-primary-bg-subtle);
  border-color: var(--bs-primary);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--bs-body-color);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Token Widget Styles */
.token-widget-button-admin {
  background: linear-gradient(135deg, var(--bs-primary) 0%, var(--accent-primary, var(--bs-primary)) 100%);
  border: 2px solid var(--bs-primary);
  color: var(--bs-body-bg);
  min-height: var(--mobile-touch-target-min);
  min-width: var(--mobile-touch-target-min);
  transition: transform var(--mobile-transition-speed), box-shadow var(--mobile-transition-speed);
}

.token-widget-button-admin:hover,
.token-widget-button-admin:focus {
  transform: scale(1.05);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.15);
  color: var(--bs-body-bg);
}

.token-widget-icon {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
}

/* Tab Navigation - Mobile First (Horizontal Scroll) */
.connection-tabs {
  display: flex;
  overflow-x: auto;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--bs-border-color);
  padding-bottom: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.connection-tabs::-webkit-scrollbar {
  display: none;
}

.connection-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.75rem 1rem;
  cursor: pointer;
  color: var(--bs-secondary-color);
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  transition: all 0.2s ease;
}

.connection-tab:hover {
  color: var(--bs-body-color);
  background-color: var(--bs-tertiary-bg);
  border-radius: 8px 8px 0 0;
}

.connection-tab.active {
  color: var(--bs-primary);
  border-bottom-color: var(--bs-primary);
  font-weight: 600;
}

.tab-badge {
  background-color: var(--bs-primary);
  color: white;
  border-radius: 12px;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

/* Connection Grid - Mobile First */
.connection-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* Connection Request Card */
.connection-request-card {
  background-color: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.2s ease;
}

.connection-request-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: var(--bs-primary);
}

.connection-request-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.connection-request-card .card-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--bs-body-color);
  margin: 0;
}

.connection-request-card .request-time {
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
}

.connection-request-card .card-actions {
  display: flex;
  gap: 0.75rem;
}

.connection-request-card .card-actions button {
  flex: 1;
  min-height: 44px;
  font-weight: 600;
  border-radius: 6px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--bs-secondary-color);
}

/* Loading State */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}

/* Tablet: 768px+ */
@media (min-width: 768px) {
  .connection-hub {
    padding: 1.5rem;
  }
  
  .connection-stats-panel {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .connection-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
  .connection-hub {
    padding: 2rem;
    /* max-width: 1200px; */ /* Full width layout */
    /* margin: 0 auto; */
  }
  
  .connection-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .connection-request-card:hover {
    transform: translateY(-2px);
  }
}

/* =========================================================================
   TOAST NOTIFICATIONS (Sprint 2-3)
   ========================================================================= */

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast-notification {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  padding: 1rem;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  pointer-events: auto;
  cursor: pointer;
  animation: slideIn 0.3s ease-out;
  transition: all 0.2s ease;
}

.toast-notification:hover {
  transform: translateX(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-message {
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--bs-body-color);
}

.toast-close {
  background: none;
  border: none;
  color: var(--bs-secondary-color);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
  opacity: 0.7;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.toast-close:hover {
  opacity: 1;
}

/* Toast Types */
.toast-success {
  border-left: 4px solid #28a745;
}

.toast-success .toast-icon {
  color: #28a745;
}

.toast-error {
  border-left: 4px solid #dc3545;
}

.toast-error .toast-icon {
  color: #dc3545;
}

.toast-info {
  border-left: 4px solid var(--bs-primary);
}

.toast-info .toast-icon {
  color: var(--bs-primary);
}

.toast-warning {
  border-left: 4px solid #ffc107;
}

.toast-warning .toast-icon {
  color: #ffc107;
}

/* Mobile: Adjust toast for smaller screens */
@media (max-width: 767px) {
  .toast-container {
    right: 0.5rem;
    left: 0.5rem;
    top: 0.5rem;
  }
  
  .toast-notification {
    min-width: unset;
    max-width: unset;
  }
}

/* =========================================================================
   CONNECTION STRENGTH BAR (Sprint 2-3)
   ========================================================================= */

.connection-strength {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.connection-strength small {
  font-size: 0.8125rem;
  color: var(--bs-secondary-color);
  flex-shrink: 0;
}

.strength-bar {
  flex: 1;
  height: 8px;
  background-color: var(--bs-border-color);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.strength-fill {
  height: 100%;
  background: linear-gradient(90deg, #dc3545 0%, #ffc107 50%, #28a745 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.connection-request-card .badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.connection-request-card .card-body i.fas {
  margin-right: 0.25rem;
  color: var(--bs-secondary-color);
}

 / *   C l i c k a b l e   s t a t   c a r d s   * / 
 
 . s t a t - c a r d . c l i c k a b l e   {   c u r s o r :   p o i n t e r ;   } 
 
 . s t a t - c a r d . c l i c k a b l e : h o v e r   {   t r a n s f o r m :   t r a n s l a t e Y ( - 2 p x ) ;   b o x - s h a d o w :   0   4 p x   8 p x   r g b a ( 0 ,   0 ,   0 ,   0 . 1 ) ;   b o r d e r - c o l o r :   v a r ( - - b s - p r i m a r y ) ;   } 
 
 . s t a t - c a r d . c l i c k a b l e : a c t i v e   {   t r a n s f o r m :   t r a n s l a t e Y ( 0 ) ;   } 
 
 . s t a t - c a r d - p r i m a r y . c l i c k a b l e : h o v e r   {   b o x - s h a d o w :   0   4 p x   1 2 p x   r g b a ( v a r ( - - b s - p r i m a r y - r g b ) ,   0 . 3 ) ;   } 
 
 
/* Analytics Section - ConnectionHub */
.analytics-section {
  background-color: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  padding: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background-color: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 6px;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
  margin-top: 0.25rem;
}

.recommendations-section {
  margin-top: 2rem;
}

.recommendation-card {
  background-color: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease-in-out;
}

.recommendation-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.recommendation-card .card-header {
  background-color: var(--bs-tertiary-bg);
  padding: 1rem;
  border-bottom: 1px solid var(--bs-border-color);
  display: flex;
  justify-content-between;
  align-items: center;
}

.recommendation-card .card-header h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--bs-body-color);
  margin: 0;
}

.recommendation-card .card-body {
  padding: 1rem;
}

.recommendation-card .card-actions {
  padding: 1rem;
  border-top: 1px solid var(--bs-border-color);
  display: flex;
  gap: 0.75rem;
}

/* Bulk Operations UI - ConnectionHub */
.bulk-actions-toolbar {
  background-color: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.bulk-select {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bulk-select input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.bulk-select label {
  margin: 0;
  font-weight: 600;
  color: var(--bs-body-color);
  cursor: pointer;
  user-select: none;
}

.bulk-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.card-checkbox {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 10;
}

.card-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.connection-request-card {
  position: relative;
  padding-left: 3rem;
}

.connection-request-card.selected {
  border-color: var(--bs-primary);
  background-color: var(--bs-primary-bg-subtle);
  box-shadow: 0 2px 8px rgba(var(--bs-primary-rgb), 0.2);
}

@media (max-width: 767px) {
  .bulk-actions-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .bulk-select {
    justify-content: center;
  }
  
  .bulk-actions {
    width: 100%;
  }
  
  .bulk-actions button {
    flex: 1;
  }
}

/* Upgrade Page Styles */
.upgrade-page {
  background: linear-gradient(to bottom, var(--bs-body-bg) 0%, #ffffff 100%);
}

.upgrade-hero {
  background: linear-gradient(135deg, var(--bs-primary) 0%, var(--accent-primary, var(--bs-primary)) 100%);
}

.pricing-card .card,
.pricing-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border-radius: 1rem;
}

.pricing-card .card:hover,
.pricing-card.featured .card {
  box-shadow: 0 1rem 3rem rgba(15, 23, 42, 0.15);
}

.pricing-card .card:hover {
  transform: translateY(-6px);
}

.pricing-card.featured .card {
  transform: scale(1.02);
}

.pricing-card.featured .card:hover {
  transform: scale(1.02) translateY(-6px);
}

.features-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.features-list li {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.5rem 0;
}

.features-list i {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.feature-card {
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  background-color: var(--bs-body-bg);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 1rem 2.5rem rgba(var(--bs-body-color-rgb, 15, 23, 42), 0.08);
}

.token-packs .card {
  border-radius: 0.75rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.token-packs .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 1rem 2rem rgba(15, 23, 42, 0.1);
}

@media (max-width: 768px) {
  .upgrade-hero h1 {
    font-size: 2rem;
  }

  .pricing-card.featured .card {
    transform: scale(1);
  }

  .pricing-card .display-4 {
    font-size: 2.5rem;
  }
}

/* ========================================
   Mobile Bottom Sheet System
   ======================================== */

/* Backdrop */
.bottom-sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, var(--mobile-backdrop-opacity));
    z-index: 1055; /* Between backdrop (1040) and bottom-sheet (1060) */
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--mobile-transition-speed) ease-in-out,
                visibility var(--mobile-transition-speed) ease-in-out;
}

.bottom-sheet-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Bottom Sheet Container */
.bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bs-body-bg);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1060; /* Higher than sidebar z-index to ensure it's on top */
    transform: translateY(100%);
    transition: transform var(--mobile-transition-speed) ease-in-out;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom); /* iOS safe area */
}

.bottom-sheet.collapsed {
    transform: translateY(0);
    height: 50vh;
    min-height: 300px;
}

.bottom-sheet.expanded {
    transform: translateY(0);
    height: 85vh;
    max-height: 85vh;
}

/* Drag Handle */
.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background-color: var(--bs-border-color);
    border-radius: 2px;
    margin: 12px auto 8px;
    cursor: grab;
    touch-action: pan-y; /* Allow vertical swipes only */
    -webkit-touch-callout: none;
    user-select: none;
}

.bottom-sheet-handle:active {
    cursor: grabbing;
}

/* Content Area */
.bottom-sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 1rem 1rem;
    -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
}

/* Entity Preview Styles */
.entity-preview {
    padding: 1rem 0;
}

.preview-avatar {
    margin-bottom: 1rem;
}

.preview-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.preview-headline {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.preview-stats {
    margin-bottom: 1.5rem;
}

.stat-item {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--bs-body-color);
}

.stat-label {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.preview-actions {
    margin-top: 1rem;
}

/* Bottom Sheet - Expanded Content */
.expanded-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.mode-tabs {
    flex-shrink: 0;
    padding: 0;
    margin: 0;
}

.mode-tabs .btn {
    border-radius: 0;
    border: none;
    padding: 0.75rem 1rem;
    text-decoration: none;
}

.mode-tabs .btn.active {
    font-weight: 600;
    color: var(--bs-primary) !important;
}

.mode-tabs .btn:not(.active) {
    color: var(--bs-secondary);
}

.mode-tabs .btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.mode-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Auth Prompt Styles */
.auth-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, var(--bs-body-bg) 0%, var(--bs-secondary-bg) 100%);
}

.auth-prompt-content {
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.auth-prompt-icon {
    color: var(--bs-primary);
    opacity: 0.8;
}

.auth-prompt-title {
    color: var(--bs-body-color);
    font-weight: 600;
    font-size: 1.5rem;
}

.auth-prompt-message {
    color: var(--bs-secondary-color);
    font-size: 1rem;
    line-height: 1.5;
}

.auth-prompt-actions {
    margin-top: 1.5rem;
}

.auth-prompt-actions .btn {
    width: 100%;
    font-weight: 500;
}

/* Dark theme adjustments for auth prompt */
[data-bs-theme="dark"] .auth-prompt {
    background: linear-gradient(135deg, var(--bs-body-bg) 0%, var(--bs-tertiary-bg) 100%);
}

/* Mobile Only - Hide on tablet+ */
@media (min-width: 768px) {
    .bottom-sheet,
    .bottom-sheet-backdrop {
        display: none !important;
    }
}

/* -------------------------------------------------- */
/* RECOMMENDATION PAGES STYLING                       */
/* -------------------------------------------------- */

/* Recommendations Page */
.recommendation-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border-color);
}

.recommendation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.recommendation-reason {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0;
}

/* -------------------------------------------------- */
/* ACTIVITY PAGE STYLING                              */
/* -------------------------------------------------- */

/* Activity Page Container */
.activity-page {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bs-body-bg);
}

/* Activity Page Placeholders (temporary - will be replaced by components) */
.activity-feed-placeholder,
.activity-sidebar-placeholder {
    background-color: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    padding: var(--spacing-desktop);
    text-align: center;
}

.activity-feed-placeholder h3,
.activity-sidebar-placeholder h4 {
    color: var(--bs-body-color);
    margin-bottom: 0.5rem;
}

.activity-feed-placeholder p,
.activity-sidebar-placeholder p {
    color: var(--bs-secondary-color);
    margin-bottom: 0;
}

/* Activity Feed Styles (will be populated when components are built) */
.activity-feed {
    max-width: 680px;
    margin: 0 auto;
    padding: var(--spacing-desktop);
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .activity-feed {
        padding: var(--spacing-mobile);
    }

    .activity-feed-placeholder,
    .activity-sidebar-placeholder {
        padding: var(--spacing-mobile);
    }
}

/* Tablet Responsive */
@media (min-width: 768px) and (max-width: 1023px) {
    .activity-feed {
        padding: var(--spacing-tablet);
    }
}

/* Activity Feed Component Styles */
.feed-header {
    margin-bottom: 1.5rem;
}

.feed-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.feed-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bs-body-color);
    margin: 0;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--bs-success);
    font-size: 0.875rem;
    font-weight: 500;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--bs-success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Feed Filter Tabs */
.feed-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--bs-tertiary-bg);
    padding: 0.25rem;
    border-radius: 8px;
}

.feed-tabs .tab {
    padding: 0.5rem 1rem;
    color: var(--bs-secondary-color);
    border-radius: 6px;
    font-weight: 500;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feed-tabs .tab:hover {
    color: var(--bs-body-color);
}

.feed-tabs .tab.active {
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* New Updates Toast */
.new-updates-toast {
    position: sticky;
    top: 5rem;
    z-index: var(--z-index-notification);
    background: var(--bs-primary);
    color: var(--bs-white);
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    text-align: center;
    cursor: pointer;
    margin: 0 auto 1rem;
    width: fit-content;
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.3);
    animation: slideDown 0.3s ease-out;
    transition: transform 0.2s ease;
}

.new-updates-toast:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(var(--bs-primary-rgb), 0.4);
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Feed Items Container */
.feed-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Individual Activity Item */
.activity-item {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.activity-item:hover {
    background: var(--bs-secondary-bg);
    border-color: var(--bs-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.activity-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.activity-header strong {
    color: var(--bs-body-color);
    font-weight: 600;
}

.timestamp {
    margin-left: auto;
    font-size: 0.8125rem;
    color: var(--bs-secondary-color);
}

.activity-body {
    color: var(--bs-body-color);
    line-height: 1.6;
}

.activity-body p {
    margin: 0;
}

/* No Activities Message */
.no-activities {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--bs-secondary-color);
}

/* End of Feed Message */
.end-of-feed {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
}

/* SignUp Gate Placeholder */
.signup-gate-placeholder {
    background: linear-gradient(135deg, var(--bs-primary-bg-subtle), var(--bs-tertiary-bg));
    border: 1px solid var(--bs-primary);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin: 1rem 0;
}

.signup-gate-placeholder h3 {
    color: var(--bs-body-color);
    margin-bottom: 0.5rem;
}

.signup-gate-placeholder p {
    color: var(--bs-secondary-color);
    margin: 0;
}

/* ===== SKELETON LOADING STATES ===== */
.activity-item.skeleton {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    pointer-events: none;
}

.skeleton-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--bs-secondary-bg) 25%, var(--bs-tertiary-bg) 50%, var(--bs-secondary-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-text-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.skeleton-text {
    height: 12px;
    background: linear-gradient(90deg, var(--bs-secondary-bg) 25%, var(--bs-tertiary-bg) 50%, var(--bs-secondary-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text-name {
    width: 140px;
    height: 14px;
}

.skeleton-text-meta {
    width: 100px;
    height: 12px;
}

.skeleton-timestamp {
    width: 60px;
    height: 12px;
    background: linear-gradient(90deg, var(--bs-secondary-bg) 25%, var(--bs-tertiary-bg) 50%, var(--bs-secondary-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.skeleton-actions {
    display: flex;
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--bs-border-color);
}

.skeleton-button {
    width: 60px;
    height: 32px;
    background: linear-gradient(90deg, var(--bs-secondary-bg) 25%, var(--bs-tertiary-bg) 50%, var(--bs-secondary-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Mobile Responsive for Feed Components */
@media (max-width: 767px) {
    .feed-title h1 {
        font-size: 1.25rem;
    }

    .feed-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .feed-tabs::-webkit-scrollbar {
        display: none;
    }

    .activity-item {
        padding: 1rem;
    }

    .new-updates-toast {
        width: calc(100% - 2rem);
        max-width: 400px;
    }
}

/* ===== ACTIVITY ITEM COMPONENTS ===== */

/* Common Avatar Styles */
.avatar-container {
    flex-shrink: 0;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar.avatar-sm {
    width: 40px;
    height: 40px;
}

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-primary);
    color: var(--bs-white);
    font-weight: 600;
    font-size: 1rem;
}

.avatar-placeholder.avatar-sm {
    font-size: 0.875rem;
}

/* User Info Section */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1;
}

.user-name {
    color: var(--bs-body-color);
    font-weight: 600;
    font-size: 0.9375rem;
}

.user-headline {
    color: var(--bs-secondary-color);
    font-size: 0.8125rem;
    margin: 0;
}

.action-text {
    color: var(--bs-secondary-color);
    font-size: 0.8125rem;
    margin: 0;
}

/* === CONNECTION ACTIVITY === */
.activity-connection .dual-avatars {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.connection-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
    border-radius: 50%;
    font-size: 1.25rem;
}

.connection-text {
    font-size: 0.9375rem;
    color: var(--bs-body-color);
    margin: 0;
}

.connection-text .action-text {
    color: var(--bs-secondary-color);
    font-weight: normal;
}

.mutual-connection {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--bs-secondary-color);
    font-size: 0.8125rem;
    margin: 0.5rem 0 0;
}

/* === POST ACTIVITY === */
.post-content {
    color: var(--bs-body-color);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0 0 0.75rem 0;
    white-space: pre-wrap;
}

.post-image {
    margin: 0.75rem 0;
    border-radius: 8px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Link Preview Card */
.link-preview {
    display: block;
    margin: 0.75rem 0;
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.2s ease;
}

.link-preview:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.link-preview-image {
    width: 100%;
    aspect-ratio: 2 / 1;
    background: var(--bs-tertiary-bg);
}

.link-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.link-preview-content {
    padding: 1rem;
}

.link-preview-title {
    display: block;
    color: var(--bs-body-color);
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.link-preview-description {
    color: var(--bs-secondary-color);
    font-size: 0.8125rem;
    line-height: 1.4;
    margin: 0 0 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-domain {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
}

/* === GROUP ACTIVITY === */
.group-card {
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.75rem 0;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.group-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
    border-radius: 8px;
    font-size: 1.5rem;
}

.group-icon img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.group-details {
    flex: 1;
}

.group-name {
    display: block;
    color: var(--bs-body-color);
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.group-members {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--bs-secondary-color);
    font-size: 0.8125rem;
    margin: 0;
}

.group-summary {
    color: var(--bs-body-color);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0 0 0.75rem 0;
}

.latest-discussion {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--bs-secondary-color);
    font-size: 0.8125rem;
    padding: 0.5rem;
    background: var(--bs-tertiary-bg);
    border-radius: 4px;
}

/* === ENTITY ACTIVITY === */
.entity-card {
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.75rem 0;
}

.entity-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.entity-logo {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    font-size: 1.5rem;
    color: var(--bs-secondary-color);
}

.entity-logo img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: contain;
    padding: 0.25rem;
}

.entity-details {
    flex: 1;
}

.entity-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.entity-name {
    color: var(--bs-body-color);
    font-size: 0.9375rem;
    font-weight: 600;
}

.verified-badge {
    color: var(--bs-primary);
    font-size: 1.125rem;
}

.entity-type {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--bs-secondary-color);
    font-size: 0.8125rem;
    margin: 0;
}

.entity-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--bs-secondary-color);
    font-size: 0.8125rem;
}

.entity-description {
    color: var(--bs-body-color);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

/* === MILESTONE ACTIVITY === */
.activity-milestone {
    background: linear-gradient(135deg, var(--bs-primary-bg-subtle), var(--bs-tertiary-bg));
    text-align: center;
}

.milestone-icon-header {
    margin-bottom: 1rem;
}

.milestone-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-primary);
    color: var(--bs-white);
    border-radius: 50%;
    font-size: 2rem;
}

.milestone-title {
    color: var(--bs-body-color);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
}

.milestone-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    margin: 1rem 0;
}

.milestone-user-details {
    text-align: left;
}

.milestone-description {
    color: var(--bs-body-color);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0.75rem 0;
}

.milestone-rank {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bs-warning-bg-subtle);
    color: var(--bs-warning);
    border-radius: 9999px;
    font-weight: 600;
    margin: 0.75rem 0;
}

.milestone-cta {
    margin-top: 1rem;
}

.activity-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--bs-border-color);
}

/* === ACTIVITY ACTIONS === */
.activity-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--bs-border-color);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 44px;
    min-height: 44px;
}

.action-btn:hover:not(:disabled) {
    background: var(--bs-secondary-bg);
    color: var(--bs-body-color);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn.liked {
    color: var(--bs-danger);
}

.action-btn.liked:hover {
    color: var(--bs-danger);
}

.action-btn.saved {
    color: var(--bs-primary);
}

.action-btn.saved:hover {
    color: var(--bs-primary);
}

.action-btn .count {
    font-size: 0.8125rem;
}

.action-btn-save {
    margin-left: auto;
}

/* Mobile Responsive for Activity Items */
@media (max-width: 767px) {
    .avatar {
        width: 40px;
        height: 40px;
    }

    .avatar.avatar-sm {
        width: 32px;
        height: 32px;
    }

    .user-name {
        font-size: 0.875rem;
    }

    .user-headline,
    .action-text {
        font-size: 0.75rem;
    }

    .activity-actions {
        gap: 0.25rem;
    }

    .action-btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.8125rem;
    }

    .action-btn .count {
        font-size: 0.75rem;
    }

    .group-card,
    .entity-card {
        padding: 0.75rem;
    }

    .milestone-title {
        font-size: 1.125rem;
    }

    .milestone-icon {
        width: 56px;
        height: 56px;
        font-size: 1.75rem;
    }
}

/* ===== SIGNUP GATE COMPONENT ===== */
.signup-gate {
    background: linear-gradient(135deg, var(--bs-primary-bg-subtle) 0%, var(--bs-tertiary-bg) 100%);
    border: 2px solid var(--bs-primary);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    margin: 1.5rem 0;
    text-align: center;
    box-shadow: 0 4px 20px rgba(var(--bs-primary-rgb), 0.15);
}

.signup-gate-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-primary);
    color: var(--bs-white);
    border-radius: 50%;
    font-size: 2.5rem;
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.3);
}

.signup-gate-heading {
    color: var(--bs-body-color);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.signup-gate-subheading {
    color: var(--bs-secondary-color);
    font-size: 1.125rem;
    line-height: 1.6;
    margin: 0 0 2rem 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Feature List */
.signup-gate-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 0 0 2rem 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--bs-body-color);
    font-size: 0.9375rem;
}

.feature-item i {
    color: var(--bs-primary);
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Action Buttons */
.signup-gate-actions {
    max-width: 400px;
    margin: 0 auto;
}

.signup-btn {
    width: 100%;
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.3);
    transition: all 0.2s ease;
}

.signup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(var(--bs-primary-rgb), 0.4);
}

.signup-btn i {
    font-size: 1.25rem;
}

/* OAuth Divider */
.oauth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0 1rem 0;
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
}

.oauth-divider::before,
.oauth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--bs-border-color);
}

.oauth-divider span {
    padding: 0 1rem;
}

/* OAuth Buttons */
.oauth-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.oauth-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 0.875rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.oauth-btn i {
    font-size: 1.5rem;
}

.oauth-btn:hover {
    background: var(--bs-tertiary-bg);
    border-color: var(--bs-primary);
    transform: translateY(-2px);
}

/* Login Link */
.login-link {
    color: var(--bs-secondary-color);
    font-size: 0.9375rem;
    margin: 0;
}

.login-link a {
    color: var(--bs-primary);
    font-weight: 600;
    text-decoration: none;
}

.login-link a:hover {
    text-decoration: underline;
}

/* Privacy Notice */
.signup-gate-privacy {
    color: var(--bs-secondary-color);
    font-size: 0.8125rem;
    margin: 1.5rem 0 0 0;
    line-height: 1.5;
}

.signup-gate-privacy a {
    color: var(--bs-secondary-color);
    text-decoration: underline;
}

.signup-gate-privacy a:hover {
    color: var(--bs-body-color);
}

/* Mobile Responsive for SignUp Gate */
@media (max-width: 767px) {
    .signup-gate {
        padding: 2rem 1.5rem;
        border-radius: 12px;
    }

    .signup-gate-icon {
        width: 64px;
        height: 64px;
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .signup-gate-heading {
        font-size: 1.5rem;
    }

    .signup-gate-subheading {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .signup-gate-features {
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .feature-item {
        font-size: 0.875rem;
    }

    .feature-item i {
        font-size: 1.125rem;
    }

    .signup-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .oauth-buttons {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .oauth-btn {
        flex-direction: row;
        justify-content: center;
        padding: 0.75rem 1rem;
    }

    .oauth-btn i {
        font-size: 1.25rem;
    }
}

/* Tablet Responsive for SignUp Gate */
@media (min-width: 768px) and (max-width: 1023px) {
    .signup-gate {
        padding: 2.25rem 1.75rem;
    }

    .signup-gate-heading {
        font-size: 1.75rem;
    }

    .oauth-buttons {
        gap: 0.5rem;
    }
}

/* Notification Preferences Page */
.form-check-input:checked {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.form-select:focus,
.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 0.25rem rgba(0, 128, 128, 0.25);
}

/* Mobile Responsive for Recommendations */
@media (max-width: 767px) {
    .recommendation-card {
        margin-bottom: 1rem;
    }
    
    .recommendation-card .card-body {
        padding: 1rem;
    }
    
    .recommendation-card img {
        width: 50px !important;
        height: 50px !important;
    }
}

/* ========================================
   MEMBER DASHBOARD STYLES
   ======================================== */

/* Dashboard Container */
.dashboard-container {
    padding: 0;
}

/* Dashboard Header */
.dashboard-header h1 {
    font-size: 1.5rem;
    color: var(--bs-body-color);
}

/* Dashboard Grid Layout */
.dashboard-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

/* Stats Row - Mobile First */
.dashboard-stats-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Stat Card */
.stat-card {
    background-color: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    padding: 1rem 0.25rem; /* Minimal horizontal padding to prevent wrapping */
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Reduced gap between icon and content */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
    min-height: 80px;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2rem;
    color: var(--bs-primary);
    opacity: 0.8;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-title {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--bs-body-color);
    line-height: 1.2;
}

.stat-subtitle {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    margin-top: 0.25rem;
}

/* Quick Action Bar */
.quick-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    color: var(--bs-body-color);
    font-weight: 500;
    min-height: 44px;
    transition: all 0.2s ease;
    cursor: pointer;
    flex: 1;
    min-width: 150px;
    justify-content: center;
}

.quick-action-btn:hover {
    background-color: var(--bs-tertiary-bg);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quick-action-btn.primary {
    background-color: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
}

.quick-action-btn.primary:hover {
    background-color: var(--bs-primary);
    opacity: 0.9;
}

.quick-action-btn i {
    font-size: 1.1rem;
}

/* Level Up Checklist */
.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checklist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-height: 44px;
}

.checklist-item:hover {
    background-color: var(--bs-secondary-bg);
}

.checklist-item.completed {
    opacity: 0.6;
}

.checklist-item .form-check {
    flex: 1;
    margin-bottom: 0;
}

.checklist-item .form-check-label {
    cursor: pointer;
    width: 100%;
}

/* Weekly Wins Card */
.wins-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.win-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    min-height: 44px;
}

.win-item.clickable {
    cursor: pointer;
}

.win-item.clickable:hover {
    background-color: var(--bs-secondary-bg);
}

.win-icon {
    font-size: 1.5rem;
    color: var(--bs-primary);
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bs-tertiary-bg);
    border-radius: 50%;
}

.win-content {
    flex: 1;
    min-width: 0;
}

.win-title {
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 0.25rem;
}

.win-description {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.win-time {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item-simple {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.activity-item-simple:hover {
    background-color: var(--bs-secondary-bg);
}

.activity-icon {
    font-size: 1.25rem;
    color: var(--bs-primary);
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bs-tertiary-bg);
    border-radius: 50%;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-weight: 500;
    color: var(--bs-body-color);
    margin-bottom: 0.125rem;
}

.activity-time {
    font-size: 0.75rem;
}

/* Tablet Breakpoint (768px+) */
@media (min-width: 768px) {
    .dashboard-header h1 {
        font-size: 2rem;
    }

    .dashboard-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem 0.25rem; /* Minimal horizontal padding */
    }

    .quick-action-btn {
        flex: 0 1 auto;
        min-width: auto;
    }
}

/* Desktop Breakpoint (1024px+) */
@media (min-width: 1024px) {
    .dashboard-content-grid {
        grid-template-columns: 2fr 1fr;
        gap: 1.5rem;
    }

    .dashboard-stats-row {
        grid-template-columns: repeat(5, 1fr);
    }

    .stat-card {
        padding: 1rem 0.25rem; /* Minimal horizontal padding */
    }

    .stat-icon {
        font-size: 2.5rem;
    }

    .stat-value {
        font-size: 2rem;
    }
}

/* Dark Mode Compatibility - using CSS variables ensures automatic theme support */

/* Activity Item Card - Enhanced */
.activity-item-card {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.1s ease, opacity 0.2s ease;
    position: relative;
    border: 1px solid transparent;
}

/* Clickable activity items */
.activity-item-card.clickable {
    cursor: pointer;
}

.activity-item-card.clickable:hover {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
    transform: translateY(-1px);
}

.activity-item-card.clickable:active {
    transform: translateY(0);
}

/* Non-clickable activity items */
.activity-item-card.non-clickable {
    cursor: default;
    opacity: 0.7;
}

.activity-item-card.non-clickable:hover {
    background-color: transparent;
}

.activity-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
}

.activity-avatar .profile-image-container {
    width: 40px !important;
    height: 40px !important;
}

.activity-avatar .profile-image-container img {
    width: 40px !important;
    height: 40px !important;
}

.activity-avatar .avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.activity-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--bs-tertiary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-secondary-color);
    font-size: 1.5rem;
}

.activity-body {
    flex: 1;
    min-width: 0;
}

.activity-header {
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.activity-user-name {
    font-weight: 600;
    color: var(--bs-body-color);
    margin-right: 0.25rem;
}

.activity-action {
    color: var(--bs-secondary-color);
    margin-right: 0.25rem;
}

.activity-target {
    font-weight: 600;
    color: var(--bs-body-color);
}

.activity-content {
    color: var(--bs-body-color);
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.activity-metadata {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--bs-secondary-color);
}

.activity-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.activity-engagement {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.engagement-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.activity-type-badge {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--bs-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .activity-item-card {
        padding: 0.75rem;
    }

    .activity-avatar {
        width: 36px;
        height: 36px;
    }

    .activity-avatar .profile-image-container {
        width: 36px !important;
        height: 36px !important;
    }

    .activity-avatar .profile-image-container img {
        width: 36px !important;
        height: 36px !important;
    }

    .activity-type-badge {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
}

/* Top Ranked Tabs */
.top-ranked-tabs {
    position: sticky;
    top: 1rem;
}

.top-ranked-tabs .nav-tabs {
    border-bottom: 1px solid var(--bs-border-color);
}

.top-ranked-tabs .nav-tabs .nav-link {
    color: var(--bs-secondary-color);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.75rem 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: visible;
    font-size: 0.875rem;
}

.top-ranked-tabs .nav-tabs .nav-link:hover {
    color: var(--bs-body-color);
    border-bottom-color: var(--bs-border-color);
}

.top-ranked-tabs .nav-tabs .nav-link.active {
    color: var(--bs-primary);
    background-color: transparent;
    border-bottom-color: var(--bs-primary);
    font-weight: 600;
}

.ranked-list {
    padding: 1rem;
    min-height: 300px;
}

.ranked-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.ranked-item:hover {
    background-color: var(--bs-secondary-bg);
}

.ranked-item-rank {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--bs-secondary-color);
    min-width: 30px;
    text-align: center;
}

.ranked-item-rank.top-3 {
    color: var(--bs-warning);
}

.ranked-item-info {
    flex: 1;
    min-width: 0;
}

.ranked-item-name {
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 0.125rem;
}

.ranked-item-meta {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
}

.ranked-item-placeholder {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--bs-secondary-color);
}

/* ========================================
   Progressive Profiling & Assessment System
   ======================================== */

/* Profile Question Widget */
.profile-question-widget {
    background-color: var(--bs-tertiary-bg);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.widget-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--bs-secondary-color);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.widget-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--bs-body-color);
}

.widget-title i {
    color: var(--bs-primary);
}

.streak-badge {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

.streak-badge i {
    animation: flicker 2s infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.question-content {
    margin-bottom: 1.25rem;
}

.question-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--bs-body-color);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.option-button {
    background-color: var(--bs-body-bg);
    border: 2px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    color: var(--bs-body-color);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.option-button:hover {
    border-color: var(--bs-primary);
    background-color: var(--bs-tertiary-bg);
}

.option-button.selected {
    background-color: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
    font-weight: 600;
}

.likert-scale {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.scale-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bs-secondary-color);
    text-align: center;
}

.scale-options {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.scale-button {
    flex: 1;
    background-color: var(--bs-body-bg);
    border: 2px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--bs-body-color);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 44px;
    min-height: 44px;
}

.scale-button:hover {
    border-color: var(--bs-primary);
    background-color: var(--bs-tertiary-bg);
}

.scale-button.selected {
    background-color: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
}

.answer-textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 2px solid var(--bs-border-color);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    resize: vertical;
    transition: border-color 0.2s ease;
}

.answer-textarea:focus {
    outline: none;
    border-color: var(--bs-primary);
}

.widget-actions {
    display: flex;
    gap: 0.625rem;
    justify-content: flex-end;
}

.no-questions,
.already-answered {
    text-align: center;
    padding: 2rem 1rem;
}

.no-questions i,
.already-answered i {
    font-size: 3rem;
    color: var(--bs-secondary-color);
    margin-bottom: 1rem;
    display: block;
}

.no-questions p,
.already-answered p {
    margin-bottom: 0.5rem;
    color: var(--bs-body-color);
}

.progress-summary {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.progress-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bs-primary);
}

/* Badge Showcase */
.badge-showcase {
    background-color: var(--bs-tertiary-bg);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.showcase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.showcase-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin: 0;
}

.showcase-header h4 i {
    color: var(--bs-warning);
}

.badge-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    background-color: var(--bs-body-bg);
    padding: 0.375rem 0.75rem;
    border-radius: 2rem;
}

.badge-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--bs-border-color);
}

.tab-button {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--bs-secondary-color);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -2px;
    min-height: 44px;
}

.tab-button:hover {
    color: var(--bs-body-color);
}

.tab-button.active {
    color: var(--bs-primary);
    border-bottom-color: var(--bs-primary);
    font-weight: 600;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.badge-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background-color: var(--bs-body-bg);
    border: 2px solid var(--bs-border-color);
    border-radius: 0.75rem;
    text-align: center;
    transition: all 0.3s ease;
}

.badge-card.earned {
    border-color: var(--bs-success);
    background: linear-gradient(135deg, var(--bs-body-bg) 0%, var(--bs-tertiary-bg) 100%);
}

.badge-card.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.badge-card.earned:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.badge-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 0.625rem;
    font-size: 1.75rem;
}

.badge-icon.rarity-common {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
}

.badge-icon.rarity-uncommon {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.badge-icon.rarity-rare {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.badge-icon.rarity-epic {
    background: linear-gradient(135deg, #6f42c1, #9b59b6);
    color: white;
}

.badge-icon.rarity-legendary {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: white;
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.5);
}

.badge-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 0.25rem;
}

.badge-date {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
}

.badge-locked {
    font-size: 1.25rem;
    color: var(--bs-secondary-color);
}

.no-badges {
    text-align: center;
    padding: 2rem 1rem;
}

.no-badges i {
    font-size: 3rem;
    color: var(--bs-secondary-color);
    margin-bottom: 1rem;
    display: block;
}

.no-badges p {
    margin-bottom: 0.5rem;
    color: var(--bs-body-color);
}

/* Person Skills Manager */
.skills-manager {
    background-color: var(--bs-tertiary-bg);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.manager-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin: 0;
}

.manager-header h4 i {
    color: var(--bs-info);
}

.add-skill-form {
    background-color: var(--bs-body-bg);
    border: 2px solid var(--bs-border-color);
    border-radius: 0.625rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 0.5rem;
    display: block;
}

.proficiency-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.proficiency-btn {
    flex: 1;
    min-width: 80px;
    background-color: var(--bs-tertiary-bg);
    border: 2px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bs-body-color);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 44px;
}

.proficiency-btn:hover {
    border-color: var(--bs-primary);
    background-color: var(--bs-body-bg);
}

.proficiency-btn.selected {
    background-color: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
    font-weight: 600;
}

.form-actions {
    display: flex;
    gap: 0.625rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.skill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bs-body-bg);
    border: 2px solid var(--bs-border-color);
    border-radius: 0.625rem;
    padding: 0.875rem;
    transition: all 0.2s ease;
}

.skill-item:hover {
    border-color: var(--bs-info);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.skill-item.primary-skill {
    border-color: var(--bs-primary);
    background: linear-gradient(135deg, var(--bs-body-bg) 0%, var(--bs-tertiary-bg) 100%);
}

.skill-info {
    flex: 1;
    min-width: 0;
}

.skill-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.skill-proficiency {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.375rem;
}

.proficiency-stars {
    display: flex;
    gap: 0.25rem;
}

.proficiency-stars i {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
}

.proficiency-stars i.filled {
    color: var(--bs-warning);
}

.proficiency-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bs-body-color);
}

.skill-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
}

.skill-source,
.skill-years {
    display: inline-block;
}

.delete-btn {
    min-width: 44px;
    min-height: 44px;
}

.skills-summary {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 2px solid var(--bs-border-color);
    flex-wrap: wrap;
}

.summary-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--bs-body-color);
}

.summary-stat i {
    color: var(--bs-info);
}

.no-skills {
    text-align: center;
    padding: 2rem 1rem;
}

.no-skills i {
    font-size: 3rem;
    color: var(--bs-secondary-color);
    margin-bottom: 1rem;
    display: block;
}

.no-skills p {
    margin-bottom: 0.5rem;
    color: var(--bs-body-color);
}

/* Tablet breakpoint (768px) */
@media (min-width: 768px) {
    .profile-question-widget,
    .badge-showcase,
    .skills-manager {
        padding: 1.5rem;
    }

    .widget-title,
    .showcase-header h4,
    .manager-header h4 {
        font-size: 1.25rem;
    }

    .question-text {
        font-size: 1.125rem;
    }

    .answer-options {
        gap: 0.75rem;
    }

    .option-button {
        padding: 1rem 1.25rem;
    }

    .scale-options {
        gap: 0.75rem;
    }

    .badges-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1.25rem;
    }

    .badge-icon {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }

    .badge-name {
        font-size: 0.9375rem;
    }

    .skill-item {
        padding: 1rem 1.25rem;
    }

    .skill-name {
        font-size: 1.0625rem;
    }

    .proficiency-btn {
        min-width: 100px;
        padding: 0.75rem 1rem;
    }
}

/* Desktop breakpoint (1024px) */
@media (min-width: 1024px) {
    .profile-question-widget,
    .badge-showcase,
    .skills-manager {
        padding: 2rem;
    }

    .answer-options {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .option-button {
        flex: 0 1 calc(50% - 0.375rem);
    }

    .likert-scale {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }

    .scale-label {
        flex-shrink: 0;
        width: 100px;
        text-align: left;
    }

    .scale-label:last-child {
        text-align: right;
    }

    .scale-options {
        flex: 1;
    }

    .badges-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1.5rem;
    }

    .badge-icon {
        width: 80px;
        height: 80px;
        font-size: 2.25rem;
    }

    .proficiency-selector {
        max-width: 600px;
    }
}
