/* Base styles - Moved from live_diarization.css */
.body-with-sidebar {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f5f5f5;
  color: #333333;
  line-height: 1.6;
  display: flex; /* CRITICAL: Enables flex layout for sidebar push */
  min-height: 100vh; /* Ensure body takes full height */
  padding-left: 0; /* Explicitly set base padding, JS will add specific left padding */
  padding-right: 20px; /* Added for symmetrical spacing on the right */
  transition: padding-left 0.3s ease-in-out; /* REMOVED !important */
  overflow-x: hidden; /* Prevent horizontal scrollbars during transition */
  box-sizing: border-box; /* Ensure padding is included in width calculation */
}

/* Utility class to temporarily disable transitions */
.no-transition {
  transition: none !important;
}

/* Apply base styles to body even without sidebar */
body:not(.body-with-sidebar) {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f5f5f5;
  color: #333333;
  line-height: 1.6;
  min-height: 100vh;
}

/* Grammar correction icon styles (admin only) */
.grammar-correction-icon {
  background: transparent;
  border: none;
  color: #ffc107;
  font-size: 0.8rem;
  padding: 0.25rem;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0.8;
  transition: all 0.2s ease;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.grammar-correction-icon:hover {
  opacity: 1;
  background-color: rgba(255, 193, 7, 0.1);
  transform: scale(1.1);
}

.grammar-correction-icon:active {
  transform: scale(0.95);
}

.main-content {
  flex-grow: 1;
  position: relative; /* For footer positioning */
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 2rem; /* Restore padding for content */
  box-sizing: border-box;
  transition:
    margin-left 0.3s ease-in-out,
    width 0.3s ease-in-out; /* Smooth transition */
  display: flex; /* Use flexbox to manage layout */
  flex-direction: column; /* Stack content and footer vertically */
  min-height: calc(100vh - 120px); /* Ensure minimum height fills most of viewport */

  /* Default state (sidebar closed) */
  margin-top: 2rem;
  margin-bottom: 2rem;
  margin-left: 0; /* Rely on body padding for left positioning */
  margin-right: 0; /* Rely on body padding for right positioning */
  width: auto; /* Allow margins to dictate effective width */
  max-width: none; /* Override previous fixed max-width */
}

/* When sidebar is open, body gets padding-left: 370px (350px sidebar + 20px gap) */
/* .main-content doesn't need a special margin-left here, as body's padding handles the shift.*/
/* It will naturally flow after the body's left padding. */
/* We just ensure its right margin is maintained. */

/* Ensure footer stays at bottom of main-content */
.main-content > footer {
  margin-top: auto; /* Push footer to bottom */
  padding: 1rem 0 0 0; /* Add some top padding for spacing */
  width: auto; /* Let text-align center it */
  text-align: center;
  z-index: 1; /* Keep footer below todos panel */
  flex-shrink: 0; /* Don't shrink footer */
}

/* Styles moved from _footer.html */
.logo-container {
  /* Remove size constraints from container, let it wrap the image */
  display: inline-block !important; /* Keep if needed */
  /* max-width: 200px; */ /* Removed */
}

.footer-logo-img {
  /* Apply both max constraints directly to the image */
  max-height: 100px !important;
  max-width: 200px !important; /* Re-apply max-width here, add !important */
  /* Let the browser scale based on constraints */
  width: auto;
  height: auto;
  display: block;
}

/* Styles moved from annotations_overview.html */

/* Styles moved from _sidebar.html */
.sidebar-nav-icon {
  width: 20px !important; /* Use important if needed to override fa default */
  text-align: center;
  flex-shrink: 0; /* Prevent icon from shrinking */
  display: inline-block; /* Or flex align-items center on parent */
}

/* Core Layout Styles (Ensure these are active) */
.navbar-brand {
  font-weight: 600;
}

.alert {
  margin-bottom: 1rem;
}

/* END Styles moved from _sidebar.html */

/* Styles originally from settings.html (now potentially global) */
/* Removed .settings-page-content scoping */
.main-content {
  /* Apply general main content styling */
  background-color: #ffffff;
  padding: 2rem;
  border-radius: 12px;
}

/* Floating Labels Style */
.form-floating > .input-style-3 {
  border: 1px solid #ced4da;
  border-radius: 4px;
}

.form-floating > .input-style-3:focus,
.form-floating > .input-style-3:not(:placeholder-shown) {
  padding-top: 1.625rem;
  padding-bottom: 0.625rem;
}

.form-floating > .input-style-3:focus ~ label,
.form-floating > .input-style-3:not(:placeholder-shown) ~ label {
  opacity: 0.65;
  transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

.form-floating > .input-style-3:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Form text styling */
.form-text {
  font-size: 0.875rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

/* Button styling (General Primary Button) */
/* Consider if this should be more specific */
/* .settings-page-content .btn-primary { ... } */

/* Update button styling */
.update-btn {
  /* Keep specific class */
  border-radius: 4px;
  font-weight: 500;
  min-width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* End styles originally from settings.html */

/* Styles originally from auth/login.html (now global) */
.login-content {
  /* Specific layout for login card area */
  margin-top: -12vh; /* Adjust as needed */
}

.login-content .card {
  min-width: 300px;
}

.login-logo-img {
  max-width: 300px !important; /* Add !important */
  height: auto; /* Ensure aspect ratio is maintained */
  display: inline-block; /* Or block, depending on centering */
}

.kenni-login-icon {
  height: 20px;
  margin-right: 8px;
  vertical-align: middle;
}

/* Media query for login page specifics */
@media (max-width: 576px) {
  /* Apply padding adjustments if needed based on overall layout */
  /* .main-content might handle this now */
  /* .login-content or specific containers might need padding */

  .login-logo-img {
    max-width: 250px !important;
  }
}
/* End styles originally from auth/login.html */

/* Production Kenni Login Button Style */
.btn-careflux-blue {
  background-color: #2c7fb8; /* Careflux blue (adjust if needed) */
  border-color: #2c7fb8;
  color: white;
  padding: 0.75rem 1.5rem; /* Adjust padding for btn-lg feel */
  font-size: 1.1rem; /* Adjust size */
  font-weight: 500;
  transition: all 0.2s ease-in-out;
  display: inline-flex; /* Align icon and text */
  align-items: center;
  justify-content: center;
}

.btn-careflux-blue:hover {
  background-color: #2471a3; /* Darker blue */
  border-color: #2471a3;
  color: white;
  text-decoration: none;
}

.btn-careflux-blue .kenni-login-icon {
  /* Inherits styles, ensure no color conflict if needed */
}

/* REMOVED Global form select styling */
/* The rule below was too broad and affected other selects negatively */
/* .form-select { ... } */

.user-dropdown-button {
  min-width: 160px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.02);
  color: #495057;
  appearance: none;
  text-align: left;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
  /* Remove background image since we'll use CSS arrow */
  background-image: none;
}

.user-dropdown-button:hover {
  background-color: rgba(0, 123, 255, 0.05);
  border-color: rgba(0, 123, 255, 0.15);
  transform: translateY(-0.5px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.user-dropdown-button[aria-expanded="true"] {
  background-color: rgba(0, 123, 255, 0.1);
  border-color: rgba(0, 123, 255, 0.2);
  box-shadow: inset 0 1px 2px rgba(0, 123, 255, 0.1);
}

.user-dropdown-button::after {
  content: "";
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid #6c757d;
  transition: transform 0.2s ease;
}

.user-dropdown-button[aria-expanded="true"]::after {
  transform: translateY(-50%) rotate(180deg);
}

/* Enhanced user dropdown menu styling */
.dropdown .dropdown-menu {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 4px 8px rgba(0, 0, 0, 0.08);
  margin-top: 6px;
  padding: 0.5rem 0;
  backdrop-filter: blur(8px);
  /* Fix positioning issues - prevent Popper.js conflicts */
  position: absolute !important;
  top: 100% !important;
  left: auto !important;
  right: 0 !important;
  transform: none !important;
  will-change: auto !important;
  /* Disable animation initially to prevent flicker */
  animation: none;
  /* Ensure proper initial positioning */
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.15s ease-out,
    visibility 0.15s ease-out;
}

.dropdown .dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  animation: userDropdownFadeIn 0.15s ease-out;
}

@keyframes userDropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown .dropdown-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #495057;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dropdown .dropdown-item:hover,
.dropdown .dropdown-item:focus {
  background-color: rgba(0, 123, 255, 0.08);
  color: #007bff;
}

.dropdown .dropdown-item i {
  font-size: 0.9rem;
  width: 1rem;
  text-align: center;
}

/* Ensure dropdown container has proper positioning */
.dropdown {
  position: relative;
}

/* Override any conflicting Bootstrap positioning */
.dropdown-menu-end {
  --bs-position: end;
  right: 0 !important;
  left: auto !important;
}

/* ==========================
   Clinical Note Templates
   ========================== */

/* ==========================
   Button Standardization
   ========================== */

/* Optional: Add overrides to .btn if needed for padding, border-radius etc. */
/* .btn {
    padding: 0.5rem 1rem;
    border-radius: 0.3rem; 
    transition: all 0.2s ease-in-out; 
} */

/* Base hover effect for solid buttons */
.btn-action-primary:hover,
.btn-action-secondary:hover,
.btn-action-destructive:hover {
  filter: brightness(90%);
}

/* Primary Action (Save, Update, Create, Start Recording) */
.btn-action-primary {
  background-color: var(--bs-primary); /* Use Bootstrap primary color */
  border-color: var(--bs-primary);
  color: white;
}

/* Secondary Action (Copy, Cancel, Info, Pause/Processing) */
.btn-action-secondary {
  background-color: var(--bs-secondary); /* Use Bootstrap secondary color */
  border-color: var(--bs-secondary);
  color: white;
}

/* Destructive Action (Delete, Stop Recording) */
.btn-action-destructive {
  background-color: var(--bs-danger); /* Use Bootstrap danger color */
  border-color: var(--bs-danger);
  color: white;
}

/* Neutral/Alternative Action (New Item, Upload Outline) */
.btn-action-neutral {
  background-color: white;
  border-color: var(--bs-gray-400); /* Lighter gray border */
  color: var(--bs-gray-700);
}
.btn-action-neutral:hover {
  background-color: var(--bs-gray-100); /* Slight gray on hover */
  color: var(--bs-gray-800);
  border-color: var(--bs-gray-500);
}

/* Warning Action (e.g., Streamed button if needed) */
.btn-action-warning {
  background-color: var(--bs-warning);
  border-color: var(--bs-warning);
  color: black; /* Warning usually needs dark text */
}
.btn-action-warning:hover {
  filter: brightness(95%);
}

/* Info Action */
.btn-action-info {
  background-color: var(--bs-info);
  border-color: var(--bs-info);
  color: white;
}
.btn-action-info:hover {
  filter: brightness(90%);
}

/* Toast container z-index */
.toast-container {
  z-index: 1090; /* Ensure toasts are above most elements, Bootstrap modals are usually 1050+ */
}

/* Notification Styles */
.notifications-container {
  position: fixed;
  top: 20px;
  right: 20px;
  max-width: 350px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notification {
  padding: 15px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-bottom: 10px;
  animation: slideIn 0.3s ease;
  position: relative;
  background-color: #fff;
  border-left: 4px solid #ccc;
  max-width: 100%;
}

.notification-info {
  background-color: #f0f7ff;
  border-left-color: #4285f4;
  color: #0a3977;
}

.notification-warning {
  background-color: #fffbeb;
  border-left-color: #f6b93b;
  color: #73510d;
}

.notification-error {
  background-color: #fff0f0;
  border-left-color: #e74c3c;
  color: #7c0b02;
}

.notification-success {
  background-color: #f0fff4;
  border-left-color: #34d399;
  color: #065f46;
}

.notification-close {
  position: absolute;
  top: 5px;
  right: 5px;
  background: transparent;
  border: none;
  color: #666;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.notification-close:hover {
  opacity: 1;
}

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

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Bootstrap Toast Overrides and Customizations */
.toast.custom-toast {
  background-color: #fff; /* Ensure white background */
  border: 1px solid rgba(0, 0, 0, 0.1); /* Standard toast border */
  border-left-width: 4px; /* Make left border thicker for accent */
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15); /* Standard toast shadow */
}

.custom-toast .toast-header {
  background-color: transparent; /* Ensure header is transparent to show toast background */
  border-bottom: 1px solid rgba(0, 0, 0, 0.05); /* Subtle separator */
  color: #212529; /* Default text color for header if not overridden by type */
}

/* Accent colors for left border and header text/icon */
.toast.toast-success-accent {
  border-left-color: var(--bs-success, #198754);
}
.toast-success-accent .toast-header .fas,
.toast-success-accent .toast-header .me-auto {
  /* Targeting the strong tag */
  color: var(--bs-success, #198754);
}

.toast.toast-danger-accent {
  border-left-color: var(--bs-danger, #dc3545);
}
.toast-danger-accent .toast-header .fas,
.toast-danger-accent .toast-header .me-auto {
  color: var(--bs-danger, #dc3545);
}

.toast.toast-warning-accent {
  border-left-color: var(--bs-warning, #ffc107);
}
.toast-warning-accent .toast-header .fas,
.toast-warning-accent .toast-header .me-auto {
  color: var(--bs-warning, #ffc107);
}
/* For warning, ensure close button is visible if header text becomes light */
.toast-warning-accent .toast-header .btn-close {
  /* filter: invert(1) grayscale(100%) brightness(200%); */
  /* Example for dark close button on light bg */
}

.toast.toast-info-accent {
  border-left-color: var(--bs-info, #0dcaf0);
}
.toast-info-accent .toast-header .fas,
.toast-info-accent .toast-header .me-auto {
  color: var(--bs-info, #0dcaf0);
}

/* Ensure toast body text is readable */
.custom-toast .toast-body {
  color: #212529; /* Standard dark text for readability on white background */
}

/* Timeout Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.modal-content.session-timeout-modal {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  max-width: 500px;
  width: 90%;
  overflow: hidden;
}

.session-timeout-modal .modal-header {
  background-color: #f8d7da;
  color: #721c24;
  padding: 15px 20px;
  border-bottom: 1px solid #f5c6cb;
}

.session-timeout-modal .modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.session-timeout-modal .modal-body {
  padding: 20px;
  text-align: center;
}

.warning-icon {
  font-size: 48px;
  color: #dc3545;
  margin-bottom: 15px;
}

.timeout-message {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.countdown-timer {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: #dc3545;
}

.action-message {
  margin-bottom: 20px;
}

.extend-session-btn {
  font-size: 1.1rem;
  padding: 10px 20px;
}

/* Styles for 403 Forbidden page image */
.forbidden-image {
  max-width: 200px;
}

/* Tutorial Modal Icon */
.tutorial-modal-icon {
  font-size: 3rem;
}

/* Onboarding Toast Positioning */
.onboarding-toast {
  top: 20px;
  right: 20px;
  z-index: 1055;
  max-width: 350px;
}

.onboarding-toast-wide {
  top: 20px;
  right: 20px;
  z-index: 1055;
  max-width: 400px;
}

/* ===== CSP-COMPLIANT UTILITY CLASSES ===== */
/* Replace inline styles with these utility classes to comply with CSP */

/* Display utilities */
.csp-display-block {
  display: block !important;
}
.csp-display-none {
  display: none !important;
}
.csp-display-flex {
  display: flex !important;
}
.csp-display-inline {
  display: inline !important;
}
.csp-display-inline-block {
  display: inline-block !important;
}
.csp-display-inline-flex {
  display: inline-flex !important;
}

/* Visibility utilities */
.csp-visible {
  visibility: visible !important;
}
.csp-hidden {
  visibility: hidden !important;
}

/* Position utilities */
.csp-position-relative {
  position: relative !important;
}
.csp-position-absolute {
  position: absolute !important;
}
.csp-position-fixed {
  position: fixed !important;
}

/* Cursor utilities */
.csp-cursor-pointer {
  cursor: pointer !important;
}
.csp-cursor-auto {
  cursor: auto !important;
}

/* Pointer events utilities */
.csp-pointer-events-none {
  pointer-events: none !important;
}
.csp-pointer-events-auto {
  pointer-events: auto !important;
}

/* Alignment utilities */
.csp-align-items-center {
  align-items: center !important;
}
.csp-justify-content-center {
  justify-content: center !important;
}

/* Gap utilities */
.csp-gap-8px {
  gap: 8px !important;
}

/* Margin utilities */
.csp-margin-left-8px {
  margin-left: 8px !important;
}
.csp-margin-bottom-5px {
  margin-bottom: 5px !important;
}

/* Border utilities */
.csp-border-green {
  border-color: #28a745 !important;
}
.csp-border-reset {
  border-color: initial !important;
}

/* Opacity utilities */
.csp-opacity-0 {
  opacity: 0 !important;
}
.csp-opacity-1 {
  opacity: 1 !important;
}

/* Transform utilities */
.csp-transform-translate-y-negative-100 {
  transform: translateY(-100%) !important;
}
.csp-transform-translate-x-negative-50 {
  transform: translateX(-50%) !important;
}
.csp-transform-none {
  transform: none !important;
}

/* Z-index utilities */
.csp-z-index-1100 {
  z-index: 1100 !important;
}
.csp-z-index-9999 {
  z-index: 9999 !important;
}

/* Transition utilities */
.csp-transition-none {
  transition: none !important;
}
.csp-transition-opacity {
  transition: opacity 0.5s ease-out 1.5s !important;
}
.csp-transition-all-400ms {
  transition: all 0.4s ease-out !important;
}

/* Background color utilities */
.csp-bg-success {
  background-color: #4caf50 !important;
}
.csp-bg-error {
  background-color: #f44336 !important;
}

/* Text color utilities */
.csp-text-white {
  color: white !important;
}

/* Font weight utilities */
.csp-font-bold {
  font-weight: bold !important;
}

/* Padding utilities */
.csp-padding-10-20 {
  padding: 10px 20px !important;
}

/* Border radius utilities */
.csp-border-radius-4px {
  border-radius: 4px !important;
}

/* Fixed positioning for feedback messages */
.csp-feedback-fixed {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  padding: 10px 20px !important;
  border-radius: 4px !important;
  color: white !important;
  z-index: 1100 !important;
  opacity: 1 !important;
  transition: opacity 0.5s ease-out 1.5s !important;
}

/* Progress bar width classes - generated dynamically if needed */
.csp-width-0 {
  width: 0% !important;
}
.csp-width-10 {
  width: 10% !important;
}
.csp-width-20 {
  width: 20% !important;
}
.csp-width-30 {
  width: 30% !important;
}
.csp-width-40 {
  width: 40% !important;
}
.csp-width-50 {
  width: 50% !important;
}
.csp-width-60 {
  width: 60% !important;
}
.csp-width-70 {
  width: 70% !important;
}
.csp-width-80 {
  width: 80% !important;
}
.csp-width-90 {
  width: 90% !important;
}
.csp-width-100 {
  width: 100% !important;
}

/* Timeline-specific utility classes */
.csp-timeline-position {
  position: absolute !important;
  bottom: 10px !important;
  transform: translateX(-50%) !important;
}

.csp-timeline-tick-major {
  height: 15px !important;
}

.csp-timeline-tick-minor {
  height: 10px !important;
}

/* Dynamic positioning helper classes - these will be set via JavaScript with specific values */
.csp-dynamic-left {
  /* left will be set via CSS custom properties */
}
.csp-dynamic-width {
  /* width will be set via CSS custom properties */
}
.csp-dynamic-height {
  /* height will be set via CSS custom properties */
}
