:root {
  overflow-y: hidden;
  --realtime-active: #28a745;
  --realtime-error: #dc3545;
  --realtime-warning: #ffc107;
  --realtime-info: #17a2b8;
  --pulse-duration: 1s;
}

body {
  display: block;
  overflow-x: hidden !important;
  overflow-y: hidden;
  height: 100vh;
  margin: 0;
}

li .dropdown-header {
  padding: 10px 15px;
  background-color: #f8f9fa; /* Light background for user info */
}

li .dropdown-header.user-full {
  margin-bottom: 0;
  font-size: 14px;

}

li .dropdown-header.user-email {
  font-size: 12px;
  color: #6c757d; /* Muted color for email */
  padding-top: 0;
}

.dropdown-divider.user-div {
  margin: 0;
  border: none;
  border-top: 1px solid #e9ecef;  /* Adjust color as needed */
  width: 100%;
}

.dropdown-item {
  padding: 5px 10px; /* Adjusted padding */
  -webkit-transition: background-color 0.2s ease;
  transition: background-color 0.2s ease; /* Smooth transition for hover effect */
}

.dropdown-item:first-child {
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
}

.dropdown-item:last-child {
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
}

.dropdown-item:hover {
  background-color: #f8f9fa; /* Lighter background on hover */
}

 .navbar-nav .nav-link.active {
      font-weight: bold;
      color: #fff !important;
      position: relative;
    }

    .navbar-nav .nav-link.active::after {
      content: '';
      display: block;
      width: 100%;
      height: 4px;
      position: absolute;
      bottom: -10px;
      left: 0;
    }

    .navbar-nav .nav-link.active.commitment::after {
      background-color: #e9fd61;
    }

    .navbar-nav .nav-link.active.impact::after {
      background-color: #06d863;
    }

    .navbar {
  background-color: #f5f5f5 !important;
  width: calc(100% - 185px);
  padding-right: 0;
  padding: 0.25rem;
  -webkit-transition: left 0.3s, width 0.3s;
  transition: left 0.3s, width 0.3s;
  left: 185px;
  z-index: 1050;
}

    .navbar.com-tab-bg {
      background-color: #111b17 !important;
    }

    .navbar .nav-item .nav-link {
      color: #9d9d9d;
    }

    .navbar .nav-item .nav-link:hover {
      color: #fff;
    }
    

#sidebar {
  width: 185px;
  -ms-flex-negative: 0;
  flex-shrink: 0;
  -webkit-transition: all 0.3s;
  transition: all 0.3s;
  background-color: #f8f9fa;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  border-right: 1px solid #dee2e6;
  z-index: 1100;
}

/* Hide the AI sidebar while reviews modals are open (prevents click/opacity conflicts). */
body.reviews-modal-open #sidebar {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

#sidebar.collapsed {
  width: 50px;
}

#main-content {
  -webkit-box-flex: 1;
  -ms-flex-positive: 1;
  flex-grow: 1;
  margin-left: 185px;
  padding-top: 60px;
  overflow-x: hidden !important;
  -webkit-transition: margin-left 0.3s;
  transition: margin-left 0.3s;
  overflow-y: auto;
  height: 100vh;
  width: calc(100% - 185px);
}

#page-footer {
    padding: 15px 0 10px;
    font-size: 12px;
}

.bugfooter {
  -webkit-box-flex: 1;
  -ms-flex-positive: 1;
  flex-grow: 1;
  margin-left: 185px;
  -webkit-transition: margin-left 0.3s;
  transition: margin-left 0.3s;
  overflow-y: auto;
  height: 100vh;
  width: calc(100% - 185px);
  margin-top: 0;
}

#sidebar.collapsed + #main-content {
  margin-left: 50px;
  width: calc(100% - 50px); /* Add this line */
}

.sidebar-logo {
  padding: 10px 10px;
  text-align: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  height: 50px;
}

.logo-expanded {
  max-width: 100%;
  -webkit-transition: max-width 0.3s, height 0.3s;
  transition: max-width 0.3s, height 0.3s;
}

.logo-collapsed {
  max-width: 30px;
  height: auto;
  display: none;
  margin-left: 0px;
}

.collapse-button {
  margin-left: 5px;
  margin-right: -5px;
  background: none;
  border: none;
  padding: 1px;
  border-radius: 4px;
  cursor: pointer;
  -webkit-transition: background-color 0.3s;
  transition: background-color 0.3s;
  position: relative;
}

.expand-button {
  margin-left: auto;
  background: none;
  border: none;
  padding: 1px;
  border-radius: 4px;
  cursor: pointer;
  -webkit-transition: background-color 0.3s;
  transition: background-color 0.3s;
  display: none;
  position: absolute;
  bottom: 20px;
  left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
}

.expand-button:hover, .collapse-button:hover {
  background-color: #e5e5e5;
}

.collapse-button::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 115%;
  left: 40%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 3px;
  border-radius: 5px;
  white-space: nowrap;
  opacity: 0;
  -webkit-transition: opacity 0.3s;
  transition: opacity 0.3s;
  pointer-events: none;
  font-size: 10px;
}

.expand-button::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 130%;
  left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 3px;
  border-radius: 5px;
  white-space: nowrap;
  opacity: 0;
  -webkit-transition: opacity 0.3s;
  transition: opacity 0.3s;
  pointer-events: none;
  font-size: 10px;
}

.collapse-button:hover::after, .expand-button:hover::after {
  opacity: 1;
}

#sidebar {
  padding-top: 8px;
  padding-bottom: 8px;
}

.sidebar-item {
  padding: 4px 20px; /* Further reduced vertical padding */
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  color: #333;
  -webkit-transition: background-color 0.2s ease;
  transition: background-color 0.2s ease;
}

.sidebar-item a {
  color: #333;
  text-decoration: none;
  width: 100%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  padding: 8px 15px;
  border-radius: 10px;
  -webkit-transition: background-color 0.2s ease;
  transition: background-color 0.2s ease;
}

.sidebar-item a:hover {
  background-color: #f8f9fa;
  margin: 0 3px;
}

/* Adjust the collapsed sidebar item styles */
.sidebar-item.collapsed {
  text-align: center;
  padding: 4px 5px; /* Reduced padding */
}

.sidebar-item.collapsed a {
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  padding: 6px;
}

.sidebar-item.collapsed a:hover {
  background-color: #f8f9fa;
  border-radius: 50%;
  margin: 0;
}

/* Adjust the sidebar icon size and spacing */
.sidebar-item .sidebar-icon {
  margin-right: 8px;
  font-size: 16px;
}

/* Add a small gap between groups of sidebar items if needed */
.sidebar-item + .sidebar-item {
  margin-top: 2px;
}

.sidebar-item.collapsed .sidebar-icon {
  margin-right: 0;
  margin-left: auto;
  margin-right: auto;
}

.sidebar-item.collapsed .sidebar-text {
  display: none;
}

.sidebar-profile {
  position: absolute;
  bottom: 60px;
  width: 100%;
  text-align: center;
}

/* When sidebar is collapsed, adjust navbar that's inside main-content */
#sidebar.collapsed ~ #main-content .navbar {
  left: 50px;
  width: calc(100% - 50px);
  margin-left: 0;
}

.navbar-brand {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.nav-write {
  background-color: #e5e5e5 !important;
  padding: 0.25rem;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: end;
      -ms-flex-pack: end;
          justify-content: flex-end;
  border-radius: 30px !important;
  font-size: 16px !important;
}

.nav-write .nav-link,
.nav-write .btn {
  color: #333;
  margin-left: 10px;
}



.nav-write .btn-light {
  background-color: #e5e5e5;
  -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
          box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  border-radius: 30px;
}


.profile-thumbnail {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-left: 10px;
  vertical-align: middle;
}

.navbar-light .navbar-nav .nav-link {
  color: #333;
}

.navbar-light .navbar-nav .nav-link:hover {
  color: #2ac8c8;
}

.navbar-nav {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.nav-pill {
  border-radius: 30px;
  padding: 2px 10px;
  margin-top: 0px !important;
  background-color: #e5e5e5;
  -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  margin-right: -5px;
  margin-left: auto !important;
  margin-bottom: 0.5rem !important;
  margin-bottom: 0 !important;
}

.nav-pill .nav-link {
  color: #333;
  font-size: 14px; /* Adjusted font size */
  margin-top: 0px;
  padding: 2px 5px !important;
  border-radius: 50px;
  background-color: #f8f9fa;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  font-size: 14px; /* Adjust font size */
}

.hover-effect:hover {
    background-color: #cecece !important;
    border-radius: 30px;
}

.nav-pill .nav-link:hover {
  color: #2ac8c8;
}

.nav-item .nav-chevron-down {
  margin-left: 10px;
  color: #9d9d9d;

}

.nav-item .nav-link {
  color: #333;
}

.nav-item .nav-link:hover {
  color: #2ac8c8;
}

.nav-item .dropdown-menu.profile-dropdown-menu {
  position: absolute;
  right: 0;
  left: auto;
  -webkit-transform: translateX(-3%);
          transform: translateX(-3%); /* Adjust this value as needed */
  top: 100%; /* Ensures it appears below the nav pill */
  margin-top: 0.5rem; /* Adds a small gap between the nav pill and dropdown */
  width: 210px;
  border-radius: 15px;
  overflow: hidden;
  -webkit-box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
          box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 10100 !important; /* Above all tooltips and editor elements (max: 10000) */
}

.nav-item .dropdown-toggle::after {
  display: none;
}

.card-deck {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
  -ms-flex-direction: row;
  flex-direction: row;
  gap: 20px;
}

.card {
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
}

.profile-dropdown {
  position: relative;
}

.profile-dropdown-menu {
  border-radius: 15px;
  overflow: hidden;
  padding: 8px 0;
}

.profile-dropdown-menu .dropdown-item,
.profile-dropdown-menu .sign-out {
  padding: 8px 15px;
  margin: 0;
}

.profile-dropdown-menu .dropdown-divider {
  margin: 8px 0;
  border-top: .5px solid rgba(0,0,0,0.1);
}

.profile-dropdown-menu .dropdown-item.settings-item {
  margin-bottom: 8px !important;
}

/* Style for the user divider */
.profile-dropdown-menu .dropdown-divider.user-div {
  margin: 0;
  border-top: 0.5px solid #e0e0e0;
  width: 100%;
}

.profile-dropdown-menu .user-info {
  background-color: #f8f9fa; /* Light gray background for both sections */
  padding: 8px 15px;
}+

.profile-dropdown-menu .user-full {
  font-weight: bold;
  margin-bottom: 0;
}

.profile-dropdown-menu .user-email {
  font-size: 0.9em;
  color: #6c757d;

}

.profile-dropdown-menu .sign-out-wrapper {
  margin: -8px; /* Add a small gap above the sign-out option */
  background-color: #ffffff;
  padding-left: 8px;
}

.profile-dropdown-menu .sign-out {
  border-radius: 0 0 15px 15px; /* Remove top radius, keep bottom radius */
  background-color: #ffffff; /* White background initially */
  -webkit-transition: background-color 0.2s ease;
  transition: background-color 0.2s ease; /* Smooth transition for hover effect */
  display: block; /* Ensure it takes full width */
  width: 100%; /* Make sure it spans the full width */
}

.profile-dropdown-menu .sign-out:hover,
.profile-dropdown-menu .sign-out:focus {
  background-color: #f8f9fa; /* Matches user info background on hover/focus */
  color: #212529;
}

.profile-dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: #fff;
  -webkit-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 1;
  width: 250px;
}

.profile-dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}

.profile-dropdown-content a:hover {
  background-color: #e5e5e5;
}

.profile-dropdown:hover .profile-dropdown-content {
  display: block;
}

.profile-summary {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  padding: 10px;
}

.profile-summary img {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  margin-right: 10px;
}


.collapse-thumbnail {
  width: 30px;
  height: 30px;
  margin-right: -5px;
}

/* Show collapsed logo when sidebar is collapsed */
#sidebar.collapsed .logo-collapsed {
  display: inline-block !important;
}

/* Hide collapsed logo when sidebar is expanded */
#sidebar:not(.collapsed) .logo-collapsed {
  display: none;
}

/* Hide expanded logo when sidebar is collapsed */
#sidebar.collapsed .logo-expanded {
  display: none !important;
}

/* Show expanded logo when sidebar is expanded */
#sidebar:not(.collapsed) .logo-expanded {
  display: block;
}

#sidebar.collapsed .expand-button {
  display: block;
}

.shrink-button {
  display: block;
}

#sidebar.collapsed .shrink-button {
  display: none;
}

.dropdown-divider {
  margin: 15px 0;
  border-color: transparent;
}

.main-header {
  margin-top: 0;
}

.content-area {
  padding-top: 5px;
}

#write_new_story {
  padding: 5px 10px;
  background-color: #e5e5e5;
  border: none;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  font-size: 16px;
}

#write_new_story svg {
  width: 16px;
  height: 16px;
  margin-right: 5px;
}

/* Scroll chaining design - editor fills viewport, scrollbar aligned with page scrollbar */
.note-editor .note-editing-area .note-editable {
  height: calc(100vh - 210px) !important;
  overflow-y: auto !important;
  overscroll-behavior: auto !important;

  /* Extend editor to viewport edge so scrollbar is adjacent to page scrollbar */
  position: fixed !important;
  left: 191px !important; /* Match container left edge (expanded sidebar) */
  right: 0 !important;
  /* width is calculated automatically by left + right */
  padding-left: 51px !important; /* 191 + 51 = 242px (match title text position) */
  padding-top: 24px !important; /* Default gap aligns first line with + button when toolbar is closed */
  padding-right: 50px !important;
  box-sizing: border-box !important;
}

/* When toolbar is open, remove the gap so text sits directly under it */
.note-editor.toolbar-open .note-editing-area .note-editable {
  padding-top: 0 !important;
}

/* Adjust left offset when sidebar is collapsed to match title alignment */
body.sidebar-collapsed .note-editor .note-editing-area .note-editable {
  left: 56px !important; /* Match container left edge (collapsed sidebar) */
  padding-left: 51px !important; /* 56 + 51 = 107px (match title text position) */
}

/* Custom minimal dot-style scrollbar - intentionally unique design */
.note-editor .note-editing-area .note-editable::-webkit-scrollbar {
  width: 8px;
}

.note-editor .note-editing-area .note-editable::-webkit-scrollbar-track {
  background: transparent;
}

.note-editor .note-editing-area .note-editable::-webkit-scrollbar-thumb {
  background: #2ac8c8; /* Company teal color */
  border-radius: 10px;
  min-height: 3px !important; /* Smallest possible height */
  max-height: 3px !important;
  animation: scrollbar-pulse 2s ease-in-out infinite;
}

.note-editor .note-editing-area .note-editable::-webkit-scrollbar-thumb:hover {
  background: #24b0b0; /* Slightly darker on hover */
  animation: none; /* Stop pulsing on hover */
}

/* Subtle pulse animation for the scrollbar */
@keyframes scrollbar-pulse {
  0%, 100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}

/* Hide scrollbar when content doesn't overflow */
.note-editor .note-editing-area .note-editable.no-overflow::-webkit-scrollbar {
  display: none;
}

/* Hide main content scrollbar when Summernote editor is present - editor handles all scrolling */
#main-content.has-fixed-editor {
  overflow-y: hidden !important;
}

/* Hide Summernote toolbar by default - user clicks + button to reveal it */
.note-toolbar {
  display: none;
}

@media (max-width: 767px) {
  #sidebar {
    width: 50px;
  }

  #main-content {
    margin-left: 50px;
    width: calc(100% - 50px); /* Add this line */
  }

  .logo-expanded {
    display: none;
  }

  .logo-collapsed {
    display: block;
  }

  .navbar {
    width: calc(100% - 50px);
    margin-left: 50px;
  }

  .collapse-button {
    display: none;
  }

  .expand-button {
    display: block;
  }
}

/* iPad specific media queries */
@media (min-width: 768px) and (max-width: 1024px) {
  #sidebar.collapsed ~ #main-content .navbar {
    left: 50px !important;
    width: calc(100% - 50px) !important;
  }
}

@media (max-width: 575.98px) {
  #sidebar {
    width: 50px;
  }

  #main-content {
    margin-left: 50px;
    width: calc(100% - 50px); /* Add this line */
  }

  .logo-expanded {
    display: none;
  }

  .logo-collapsed {
    display: block;
  }

  .navbar {
    width: calc(100% - 50px);
    margin-left: 50px;
  }

  .navbar-nav.nav-pill {
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    width: 100%;
    margin: 0 auto;
  }
}

/* ===== DOCKER REAL-TIME FEATURES ===== */

/* WebSocket Connection Status */
.websocket-status {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  transition: all 0.3s ease;
}

.websocket-status.connected {
  background-color: var(--realtime-active);
  box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
}

.websocket-status.disconnected {
  background-color: var(--realtime-error);
  box-shadow: 0 0 8px rgba(220, 53, 69, 0.5);
}

.websocket-status.error {
  background-color: var(--realtime-warning);
  box-shadow: 0 0 8px rgba(255, 193, 7, 0.5);
}

/* Real-time Pulse Animation */
.realtime-indicator {
  position: relative;
  display: inline-block;
}

.realtime-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background-color: var(--realtime-active);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: pulse-fade var(--pulse-duration) ease-out;
}

.realtime-indicator.pulse::after {
  animation: pulse-grow var(--pulse-duration) ease-out;
}

@keyframes pulse-grow {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(3);
    opacity: 0;
  }
}

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

/* Log Stream Status Indicators */
.log-stream-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.log-stream-status.streaming {
  background-color: rgba(40, 167, 69, 0.1);
  color: var(--realtime-active);
  border: 1px solid rgba(40, 167, 69, 0.3);
}

.log-stream-status.stopped {
  background-color: rgba(108, 117, 125, 0.1);
  color: #6c757d;
  border: 1px solid rgba(108, 117, 125, 0.3);
}

.log-stream-status.ended {
  background-color: rgba(255, 193, 7, 0.1);
  color: var(--realtime-warning);
  border: 1px solid rgba(255, 193, 7, 0.3);
}

/* Log Display Container */
.log-container {
  background-color: #1e1e1e;
  color: #f8f9fa;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.4;
  padding: 15px;
  border-radius: 8px;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #444;
  position: relative;
}

.log-line {
  display: flex;
  margin-bottom: 2px;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.log-line.initial {
  opacity: 0.8;
}

.log-line.stream {
  animation: log-fade-in 0.3s ease-in;
}

.log-timestamp {
  color: #6c757d;
  margin-right: 12px;
  flex-shrink: 0;
  font-size: 12px;
}

.log-text {
  flex: 1;
  color: #f8f9fa;
}

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

/* Container Cards Real-time Updates */
.container-card {
  transition: all 0.3s ease;
  position: relative;
}

.container-card.realtime-update {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.container-card .realtime-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
}

/* Health Metrics Display */
.health-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-bottom: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  border-left: 4px solid var(--realtime-active);
  transition: all 0.3s ease;
}

.health-metric.warning {
  border-left-color: var(--realtime-warning);
}

.health-metric.error {
  border-left-color: var(--realtime-error);
}

.health-metric-label {
  font-weight: 500;
  color: #495057;
}

.health-metric-value {
  font-weight: 600;
  color: #212529;
}

/* Real-time Controls */
.realtime-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 15px;
}

.realtime-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.realtime-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.realtime-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 24px;
}

.realtime-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .realtime-slider {
  background-color: var(--realtime-active);
}

input:checked + .realtime-slider:before {
  transform: translateX(20px);
}

/* Mobile Optimizations for Real-time Features */
@media (max-width: 768px) {
  .log-container {
    max-height: 250px;
    font-size: 11px;
    padding: 10px;
  }
  
  .realtime-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .health-metric {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .websocket-status {
    width: 10px;
    height: 10px;
  }
  
  .log-timestamp {
    display: none;
  }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) and (prefers-color-scheme: light) {
  .health-metric {
    background-color: rgba(255, 255, 255, 0.1);
  }

  .health-metric-label {
    color: #adb5bd;
  }

  .health-metric-value {
    color: #f8f9fa;
  }
}

/* ===== MOBILE BOTTOM NAVIGATION (Airbnb-style) ===== */

/* Hide mobile bottom nav on desktop by default */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  border-top: 1px solid #e9ecef;
  z-index: 1000;
  padding: 8px 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Bottom nav item links */
.mobile-bottom-nav .bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 4px 8px;
  color: #6c757d;
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.mobile-bottom-nav .bottom-nav-item:hover,
.mobile-bottom-nav .bottom-nav-item.active {
  color: #289a96;
}

/* Bottom nav icon container */
.mobile-bottom-nav .bottom-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-bottom: 2px;
}

/* Constrain icon sizes - CRITICAL to prevent SVG explosion */
.mobile-bottom-nav .bottom-nav-icon img,
.mobile-bottom-nav .bottom-nav-icon svg,
.mobile-bottom-nav .nav-icon-default {
  width: 22px !important;
  height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  object-fit: contain;
}

.mobile-bottom-nav .bottom-nav-icon i {
  font-size: 20px;
}

/* Avatar in bottom nav */
.mobile-bottom-nav .bottom-nav-avatar {
  width: 24px !important;
  height: 24px !important;
  border-radius: 50%;
  object-fit: cover;
}

/* Bottom nav label text */
.mobile-bottom-nav .bottom-nav-label {
  font-size: 10px;
  line-height: 1.2;
  margin-top: 2px;
}

/* Only show mobile bottom nav on small screens when needed */
@media (max-width: 767px) {
  .mobile-bottom-nav {
    display: flex;
    justify-content: space-around;
  }

  /* Add padding to content area to account for bottom nav */
  .content-area {
    padding-bottom: 80px;
  }
}

/* ===== MOBILE SCROLL BEHAVIOR (Airbnb-style) ===== */
/* These classes are toggled by JavaScript in ai.ejs based on scroll position */

/* Initially hide mobile bottom nav (JavaScript adds .visible when scrolled) */
@media (max-width: 767px) {
  .mobile-bottom-nav {
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
  }

  /* Show bottom nav when .visible class is added by JavaScript */
  .mobile-bottom-nav.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  /* Hide sidebar when .mobile-hidden class is added by JavaScript */
  #sidebar.mobile-hidden {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  /* Ensure sidebar is visible when NOT hidden */
  #sidebar:not(.mobile-hidden) {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  /* Adjust main content when sidebar is hidden - must expand to fill full width */
  body.sidebar-hidden #main-content {
    margin-left: 0 !important;
    width: 100% !important;
    transition: margin-left 0.3s ease, width 0.3s ease;
  }

  /* Also adjust the navbar when sidebar is hidden */
  body.sidebar-hidden .navbar {
    margin-left: 0 !important;
    width: 100% !important;
    left: 0 !important;
    transition: margin-left 0.3s ease, width 0.3s ease, left 0.3s ease;
  }

  /* Ensure smooth transition when sidebar comes back */
  #main-content {
    transition: margin-left 0.3s ease, width 0.3s ease;
  }

  .navbar {
    transition: margin-left 0.3s ease, width 0.3s ease, left 0.3s ease;
  }
}
