.ai {
    width: 90%;
    margin-right: 1%;
    margin-left: 9%;
    margin-top: 5px;
    margin-bottom: 5px;
}

.human {
    width: 90%;
    margin-right: 9%;
    margin-left: 1%;
    margin-top: 5px;
    margin-bottom: 5px;
}

#selections {
    width: 100%;
    height: 600px;
    margin-bottom: 5px;
}

#idMessage {
    width: 100%;
    height: 600px;
    margin-bottom: 5px;
}

#inputBox {
    margin-bottom: 5px;
}


.reccy-header {
    font-family: "Montserrat", sans-serif;
    font-optical-sizing: auto;
    font-weight: bold;
    font-style: normal;
    color: #004d66;
}

.updating-insights {
    color: #177494;
}

.btn-primary {
    color: #222321;
    background-color: #4aab32;
    padding: 5px 20px;
    border-radius: 6px;
    border: none;
}


.btn-primary:focus {
    color: #222321;
    background-color: #4aab32;
}

.btn-primary:hover {
    background-color: #4aab32;
    color: #222321;
}

.btn-primary:active {
    background-color: #4aab32;
    color: #222321;
}

.btn-secondary {
    color: #212121;
    background: white;
    padding: 5px 20px;
    border-radius: 6px;
    border: none;
}

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

.btn-secondary:active {
    color: #212121;
    background: white;
}

.modal-content {
    border-radius: 6px;
    border: none;
    background-color: #d8e2e5;
}

.modal-title {
    color: white;
    text-align: center;
}

.modal-header {
    background-color: #4aab32;
}

/* Ask modal loading indicator */
#ask-spinner {
    display: none;
    align-items: center;
    color: #177494;
    font-weight: 500;
}

#ask-spinner.htmx-request {
    display: flex;
}

/* Hide buttons while request is in progress */
.modal-footer:has(.htmx-request) button {
    display: none;
}

/* Disable form while loading */
form.htmx-request textarea {
    opacity: 0.6;
    pointer-events: none;
}

h1, h2, h3, h4, h5, h6 {
    color: #177494;
}

.disclaimer {
    font-weight: bold;
}

.questionSet {
    padding-bottom: 20px;
}

.questionSet h2 {
    padding-bottom: 12px;
}

#exportInsights {
    padding-bottom: 12px;
    padding-top: 12px;
}

.toc {
    color: #177494;
}

.toc a {
    color: #4aab32
}

.fileErrors h2 {
    padding-top: 12px;
    padding-bottom: 12px;
}

.fileErrors li {
    padding-bottom: 8px;
}

.fileErrors i {
    padding-right: 8px;
}

/* Hide mobile-specific elements by default (desktop view) */
.mobile-show {
  display: none;
}

.mobile-only {
  display: none;
}

.new-room.top-room {
  display: none;
}

/* ===== MOBILE RESPONSIVENESS FOR INSIGHTS CATEGORIES ===== */

/* Mobile-specific styles for category button scrolling */
@media screen and (max-width: 767px) {
  
  /* Ensure parent container allows overflow */
  .tab-mb-1 {
    overflow: visible !important;
    width: 100% !important;
    position: relative !important;
  }
  
  /* Enable horizontal scrolling for mobile category tabs */
  #mobileSelections .tab,
  .tab-mb-1 .tab {
    display: block !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
    -ms-overflow-style: auto !important;
    padding-bottom: 10px !important;
    background: transparent !important;
    border-radius: 0 !important;
    padding: 8px 0 !important;
    margin-bottom: 10px !important;
  }
  
  /* Webkit scrollbar styling for better mobile experience */
  #mobileSelections .tab::-webkit-scrollbar {
    height: 6px !important;
    width: 6px !important;
  }
  
  #mobileSelections .tab::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 3px !important;
  }
  
  #mobileSelections .tab::-webkit-scrollbar-thumb {
    background: #888 !important;
    border-radius: 4px !important;
  }
  
  /* Category button styling for mobile */
  #mobileSelections .tab .tablinks,
  .tab-mb-1 .tab .tablinks {
    display: inline-block !important;
    white-space: nowrap !important;
    margin-right: 12px !important;
    vertical-align: top !important;
    float: none !important;
    flex: none !important;
    min-width: 100px !important;
    padding: 12px 18px !important;
    background: white !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #177494 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
    transition: all 0.2s ease !important;
  }
  
  /* Button hover and active states */
  #mobileSelections .tab .tablinks:hover,
  .tab-mb-1 .tab .tablinks:hover {
    background: #f8f9fa !important;
    border-color: #4aab32 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12) !important;
  }
  
  #mobileSelections .tab .tablinks.active,
  #mobileSelections .tab .tablinks:active,
  .tab-mb-1 .tab .tablinks.active,
  .tab-mb-1 .tab .tablinks:active {
    background: #4aab32 !important;
    border-color: #4aab32 !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(74, 171, 50, 0.3) !important;
  }
  
  /* Add padding at end to ensure last button is fully visible */
  #mobileSelections .tab::after,
  .tab-mb-1 .tab::after {
    content: "" !important;
    display: inline-block !important;
    width: 100px !important;
    height: 1px !important;
  }
  
  /* Subtle scroll indicator - fade gradient on right edge */
  .tab-mb-1::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 20px !important;
    height: 100% !important;
    background: linear-gradient(to left, rgba(255,255,255,0.9) 0%, transparent 100%) !important;
    pointer-events: none !important;
    z-index: 10 !important;
    opacity: 0.8 !important;
  }
  
  /* Optional: Add a subtle arrow hint */
  .tab-mb-1::after {
    content: "→" !important;
    position: absolute !important;
    top: 50% !important;
    right: 5px !important;
    transform: translateY(-50%) !important;
    color: #177494 !important;
    font-size: 14px !important;
    pointer-events: none !important;
    z-index: 11 !important;
    opacity: 0.6 !important;
    animation: pulseHint 2s ease-in-out infinite !important;
  }
  
  /* Pulse animation for the arrow hint */
  @keyframes pulseHint {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
  }
  
  /* Ensure main content area scrolls properly */
  .top-scroll-1 {
    position: relative !important;
    height: auto !important;
    overflow: visible !important;
  }
  
  .top-scroll {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  
  /* Optimize content scrolling */
  #ReccyMain {
    overflow-y: auto !important;
    max-height: none !important;
  }
  
  /* Fix Documents page search results visibility on mobile */
  
  /* Ensure main content area is visible and properly positioned */
  .top-scroll-1 {
    display: block !important;
    width: 100% !important;
    padding: 0 20px !important;
  }
  
  /* Fix room-top-2 positioning - remove excessive margin on mobile */
  .room-top-2 {
    margin-top: 0px !important;
    padding-left: 0px !important;
  }
  
  /* Ensure search results container is visible */
  #files {
    display: block !important;
    width: 100% !important;
    padding: 10px 0 !important;
    min-height: 50px !important;
  }
  
  /* Remove excess spacing in Documents search area on mobile */
  #ReccyMain h4 {
    margin-top: 5px !important;
    margin-bottom: 10px !important;
  }
  
  /* Fix excessive form height in Documents search on mobile */
  #chatForm {
    height: auto !important;
    min-height: auto !important;
    margin-bottom: 10px !important;
  }
  
  #chatForm .row {
    height: auto !important;
    min-height: auto !important;
    margin-bottom: 0px !important;
  }
  
  #chatForm .mb-3 {
    margin-bottom: 10px !important;
  }
  
  /* Make mobile logo bigger in top right corner */
  .mobile-right-top .img-fluid {
    max-width: 28% !important;
    height: auto !important;
  }
  
  /* Hide desktop "Add a New Room" buttons on mobile */
  .new-room.add-room,
  .new-room.bottom-room {
    display: none !important;
  }
  
  /* Show top "Add a New Room" button on mobile (below "Choose a Room") */
  .new-room.top-room {
    display: block !important;
    margin-bottom: 15px !important;
  }
  
  /* Make remaining "Add a New Room" button bigger and more touch-friendly on mobile */
  .new-room .btn {
    font-size: 16px !important;
    padding: 12px 20px !important;
    min-height: 44px !important;
    width: auto !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
  }
  
  /* Reduce space below "Choose a Room" heading on mobile */
  .room-top {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
  }
  
  .choose-room h4 {
    margin-bottom: 8px !important;
  }
  
  /* Fix alignment of "Request Docs" and "+ Add Files" buttons on mobile */
  .submit-file .mobile-view-2 {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 50% !important;
  }
  
  .submit-file .btn.add-file,
  .submit-file .btn.request-docs {
    float: none !important;
    margin: 0 5px !important;
    flex: 1 !important;
    text-align: center !important;
    max-width: 120px !important;
  }
  
  /* Reorder AI chat: move question input to top on mobile */
  #ReccyMain .row {
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* Question input form at top */
  #ReccyMain .form-group {
    order: 1 !important;
    margin-bottom: 15px !important;
  }
  
  /* Chat messages below */
  #ReccyMain .col-md-10 {
    display: flex !important;
    flex-direction: column !important;
  }
  
  #ReccyMain #idMessage {
    order: 2 !important;
    min-height: 60vh !important;
    max-height: 60vh !important;
  }
  
  /* Adjust overall container height */
  #ReccyMain .row {
    height: auto !important;
    min-height: 70vh !important;
  }
  
  /* NOTE: Cannot safely hide document filters without affecting Insights */
  /* The .documnet-top-mb-1 class is used on ALL pages including Insights */
  /* Leaving document filters visible on mobile for now to preserve Insights functionality */
  /* TODO: Backend needs to add page-specific classes to differentiate Chat/Documents from Insights */
  
  /* Fix floppy disk icon alignment - add same padding as other icons */
  .profile-setting .bi-floppy::before {
    padding-top: 10px !important;
  }
  
  /* Fix top-right mobile logo alignment - reduce padding to align with icons */
  .mobile-right-top {
    padding-top: 0px !important;
  }
  
  /* Show mobile-specific welcome message */
  .mobile-show {
    display: block !important;
  }
  
  /* Hide desktop welcome message on mobile */
  .mobile-hide {
    display: none !important;
  }
  
  /* Make welcome message same size as disclaimer text on mobile */
  #questionSetWelcome h3,
  #questionSetWelcome h4 {
    font-size: inherit !important;
    line-height: inherit !important;
  }
  
  /* Show mobile-only export/refresh buttons on mobile */
  .mobile-only {
    display: block !important;
  }
  
  /* Style mobile export/refresh buttons at bottom of insights */
  #ReccyMain #exportInsights {
    padding: 12px 0 !important;
    margin-top: 20px !important;
    margin-bottom: 10px !important;
    border-top: 1px solid #e0e0e0 !important;
    padding-top: 15px !important;
  }
  
  #ReccyMain #exportInsights h6 {
    font-size: 14px !important;
    margin-bottom: 8px !important;
    color: #177494 !important;
  }
  
  #ReccyMain #exportInsights h6 a {
    color: #4aab32 !important;
    text-decoration: none !important;
  }
  
  #ReccyMain #exportInsights h6 a:hover {
    color: #177494 !important;
  }
  
  /* Show mobile terms and conditions at bottom of Insights pages */
  .mobile-terms {
    margin-top: 0px !important;
    padding-top: 15px !important;
    border-top: 1px solid #e0e0e0 !important;
  }

  /* Fix modal visibility in mobile view */
  .modal {
    z-index: 9999 !important;
    position: fixed !important;
    overflow-y: auto !important;
  }

  .modal-backdrop {
    z-index: 9998 !important;
  }

  .modal-dialog {
    position: relative !important;
    margin: 20px auto !important;
    max-width: 90% !important;
    width: auto !important;
  }

  .modal-dialog-centered {
    display: flex !important;
    align-items: center !important;
    min-height: calc(100% - 40px) !important;
  }

  .modal-content {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    pointer-events: auto !important;
  }
}

/* Style disclaimer at bottom of Insights page */
.disclaimer {
  margin-top: 20px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  font-size: inherit !important;
  font-weight: normal !important;
  color: #177494 !important;
  line-height: inherit !important;
}

/* Style room action buttons */
.ask-btn .button {
  color: #177494 !important;
}

/* Style room title link */
.peppermill h4 a {
  color: #177494 !important;
  text-decoration: none;
}

.peppermill h4 a:hover {
  color: #177494 !important;
  text-decoration: underline;
}

/* Center gear icon in profile circle - match home icon styling */
.profile-top {
  width: 50px !important;
  height: 50px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-top: 0 !important;
  padding: 0 !important;
}

.profile-top a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  width: 50px;
  font-size: 30px;
}

/* Center house and book icons in profile-setting */
.profile-setting ul li {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

.profile-setting ul li a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  width: 50px;
}

/* Align button bottom with title bottom */
.room-top {
  display: flex !important;
  align-items: flex-end !important;
}

.room-top .choose-room h4 {
  margin-bottom: 0 !important;
}

/* ==================== Insights Drill-Down Styles ==================== */

.insight-section {
    margin-bottom: 20px;
}

.section-actions {
    float: right;
    font-size: 0.8em;
}

.action-btn {
    cursor: pointer;
    margin-left: 8px;
    color: #177494;
    transition: color 0.2s ease;
}

.action-btn:hover {
    color: #0d4a5f;
}

.drilldown-container {
    margin-left: 20px;
    margin-top: 10px;
}

.drilldown-container:not(:empty) {
    border-left: 3px solid #177494;
    padding-left: 15px;
}

.sources-content {
    background-color: #f8f9fa;
    padding: 10px 15px;
    border-radius: 5px;
    margin-top: 10px;
}

.sources-content h6 {
    color: #177494;
    margin-bottom: 10px;
}

.source-item {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.source-item:last-child {
    border-bottom: none;
}

.source-link {
    color: #177494;
    text-decoration: none;
}

.source-link:hover {
    text-decoration: underline;
}

.source-excerpt {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
    margin: 8px 0 0 20px;
    padding: 8px 12px;
    background-color: #fff;
    border-left: 2px solid #ccc;
    border-radius: 0 4px 4px 0;
}

.expansion-content {
    background-color: #e8f4f8;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
}

.expansion-content h6 {
    color: #177494;
    margin-bottom: 10px;
}

.followup-item {
    background-color: #f0f7fa;
    padding: 12px 15px;
    border-radius: 5px;
    margin-top: 10px;
}

.followup-question {
    color: #333;
    margin-bottom: 8px;
}

.followup-answer {
    color: #555;
    margin-left: 15px;
    margin-bottom: 0;
}

.followup-response {
    margin-left: 30px;
    color: #555;
}

.consolidate-btn {
    color: #4aab32;
}

.consolidate-btn:hover {
    color: #3a8b28;
}

/* Progress bar for loading states */
.section-progress {
    width: 100%;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar-indeterminate {
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, #177494, #4aab32, #177494);
    background-size: 200% 100%;
    border-radius: 2px;
    animation: progress-animation 1.5s ease-in-out infinite;
}

@keyframes progress-animation {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(250%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Markdown content styling */
.markdown-content {
    line-height: 1.6;
}

.markdown-content h1 {
    font-size: 1.5em;
    color: #177494;
    margin-top: 1em;
    margin-bottom: 0.5em;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 0.3em;
}

.markdown-content h2 {
    font-size: 1.3em;
    color: #177494;
    margin-top: 0.8em;
    margin-bottom: 0.4em;
}

.markdown-content h3 {
    font-size: 1.15em;
    color: #333;
    margin-top: 0.6em;
    margin-bottom: 0.3em;
}

.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    font-size: 1em;
    color: #333;
    margin-top: 0.5em;
    margin-bottom: 0.3em;
}

.markdown-content strong {
    font-weight: 600;
    color: #222;
}

.markdown-content em {
    font-style: italic;
}

.markdown-content ul,
.markdown-content ol {
    margin-left: 1.5em;
    margin-bottom: 0.8em;
}

.markdown-content li {
    margin-bottom: 0.3em;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.95em;
}

.markdown-content th {
    background-color: #177494;
    color: white;
    font-weight: 600;
    padding: 10px 12px;
    text-align: left;
    border: 1px solid #146680;
}

.markdown-content td {
    padding: 8px 12px;
    border: 1px solid #ddd;
}

.markdown-content tr:nth-child(even) {
    background-color: #f8f9fa;
}

.markdown-content tr:hover {
    background-color: #e9f5f8;
}

.markdown-content code {
    background-color: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

.markdown-content pre {
    background-color: #f4f4f4;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1em 0;
}

.markdown-content pre code {
    padding: 0;
    background: none;
}

.markdown-content blockquote {
    border-left: 4px solid #177494;
    padding-left: 1em;
    margin: 1em 0;
    color: #555;
    font-style: italic;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 1.5em 0;
}

.markdown-content a {
    color: #177494;
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.insight-hidden {
    opacity: 0.5;
}

.insight-hidden h5 {
    color: #6c757d !important;
}
