/* ==========================================================================
   STYLE.CSS - CORRECTED AND FINAL LAYOUT
   ========================================================================== */

/* #region    --- 2. Main Application Layout --- */
/* ========================================================================== */

/* The appWrapper is a vertical flex container for the header and main content */
#appWrapper {
    max-width: 1900px;
    width: 100%;
    height: 100vh;
    display: flex;
    /* flex-direction: column; */
    flex-direction: row;    /* Side-by-side: viewer + right panel */
    border-left: 1px solid var(--border-color-medium);
    border-right: 1px solid var(--border-color-medium);
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

#contentWrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: row; /* Aligns main content and side panel side-by-side */
    overflow: hidden;
}

#mainContent {
    flex-grow: 1; /* Fills available horizontal space */
    display: flex;
    position: relative;
    overflow: hidden;
    min-width: 0; /* Allow the viewer column to shrink beside the side panel */
}

/* #endregion */


/* #region    --- 3. Top Controls Bar --- */
/* ========================================================================== */

/* The header is now a normal block, not absolutely positioned */
#controlsContainer, #landingNavbar {
    flex-shrink: 0;
    position: relative; /* Resets from absolute */
}

#controlsContainer {
    height: 50px;
    padding: 0 var(--spacing-xl);
    z-index: 10;
    background-color: var(--light-bg);
    border-bottom: 1px solid var(--border-color-medium);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.controls-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    flex-shrink: 0;
}

.controls-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    flex-shrink: 0;
}

.zoom-controls {
    gap: 0.2rem;
    flex-shrink: 0;
    margin-left: auto;
}

#pdfZoomValue {
    min-width: 48px;
    text-align: center;
}

#fileNameDisplay {
    font-size: var(--font-size-small);
    color: var(--text-color-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.search-controls {
    display: flex;
    flex-grow: 1;
    justify-content: center;
    margin: 0 15%;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-long);
    pointer-events: none;
}
.search-controls.search-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.search-count-display {
    font-size: 0.8em;
    color: var(--text-color-muted);
    background-color: transparent;
    border-left: none;
    border-right: none;
    padding: 0 8px;
    min-width: 60px;
    text-align: center;
}


.dropdown-menu .form-switch {
    padding-left: 1rem;
    padding-right: 1rem;
}
.dropdown-menu > li.py-1 {
    cursor: default;
}
.dropdown-menu > li.py-1:hover {
    background-color: transparent;
}
/* #endregion */


/* #region    --- 4. Main Content Areas (PDF Viewer & Empty State) --- */
/* ========================================================================== */

/* viewerContainer grows to fill the space left by the side panel */
#viewerContainer {
    flex-grow: 1;
    overflow: auto;
    position: relative;
    background-color: var(--white-bg);
    min-width: 0; /* Prevent PDF canvas from forcing wider than available space */
}

#pdfViewerFrame {
    border: none;
    width: 100%;
    height: 100%;
}

/* emptyStateContainer is an overlay, so it doesn't disrupt the flex layout */
#emptyStateContainer {
    background-color: var(--white-bg);
    position: absolute;
    inset: 0;
    z-index: 5;
    overflow-y: auto;
}

.empty-state-content {
    max-width: 650px;
    width: 100%;
}

.empty-state-title {
    font-size: 2.5rem;
    color: var(--text-color-light);
    font-weight: 300;
}
.empty-state-title strong {
    color: var(--text-color-dark);
    font-weight: 600;
}

#contextualCopyBtn {
    position: absolute;
    display: none; /* Hidden by default */
    z-index: 1000;
    width: 32px;
    height: 32px;
    padding: 0;
}

.search-controls {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 40%; /* Or another percentage that you find visually appealing */
    
    /* These properties handle the fade-in/out effect */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Example PDF cards */
.u-font-serif {
    font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

.hover-shadow-sm {
    transition: box-shadow .15s ease, transform .15s ease;
}
.hover-shadow-sm:hover {
    box-shadow: var(--bs-box-shadow);
    transform: scale(1.02);
}

.example-card[data-example-id] .example-card-source,
.example-card[data-example-id] .example-card-authors {
    color: var(--bs-tertiary-color, #6c757d) !important;
}
.example-card[data-example-id]:hover .example-card-source,
.example-card[data-example-id]:hover .example-card-authors {
    color: var(--bs-secondary, #6c757d) !important;
}
.example-card[data-example-id]:hover .example-card-title {
    color: var(--bs-body-color) !important;
}

.example-card .example-card-title {
    color: var(--bs-secondary-color, #6c757d) !important;
}

.examples-carousel {
    overflow-y: visible !important; /* prevent hover scale from clipping top border */
    padding-top: 0.5rem;
}

.carousel-nav-btn {
    z-index: 2;
    background-color: rgba(255, 255, 255, 0.9);
}
.carousel-nav-btn:hover,
.carousel-nav-btn:focus-visible {
    background-color: #ffffff;
}

.example-card {
    background-color: var(--bs-light-bg-subtle, #f8f9fa) !important;
    transition: background-color .15s ease, border-color .15s ease;
}
.example-card:hover {
    background-color: #ffffff !important;
    border-color: var(--bs-secondary, #6c757d) !important;
}

.stored-review-card .example-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.25rem;
    margin-bottom: 0.35rem;
}

.example-card .example-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-rating-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.card-rating-row .rating-stars {
    color: var(--bs-tertiary-color, #adb5bd) !important;
    font-size: 0.95rem;
}

.example-card .card-header,
.stored-review-card .card-header {
    border-bottom: 0;
    background-color: transparent;
    padding-bottom: 0.25rem;
}

.example-card .card-footer,
.stored-review-card .card-footer {
    border-top: 0;
    background-color: transparent;
    padding-top: 0.25rem;
}

#overallAbsentAlert {
    box-shadow: var(--slab-shadow);
    border: var(--slab-border);
}

#overallAbsentAlert .icon-link {
    color: var(--bs-danger-text-emphasis, #842029);
    text-decoration-color: currentColor;
}

/* Shimmering Gradient Text Effect */
.shimmer-text {
    background-image: linear-gradient(
      -75deg,
      #6f42c1 0%,   /* Bootstrap Purple */
      #d63384 25%,  /* Bootstrap Pink */
      #fd7e14 50%,  /* Bootstrap Orange */
      #198754 75%,  /* Bootstrap Green */
      #6f42c1 100%
    );
    background-size: 200% auto;
  
    /* Clip the background to the text */
    -webkit-background-clip: text;
    background-clip: text;
  
    /* Make the text color transparent to show the gradient */
    color: transparent;
  
    /* Animate the gradient position */
    animation: shimmer 12s linear infinite;
  }
  
  @keyframes shimmer {
    to {
      background-position: 200% center;
    }
  }

#devProviderToggle .btn {
    padding-inline: 0.75rem;
}

/* Shimmering Gradient Text Effect (Original multicolor) */
/* .shimmer-text {
  background-image: linear-gradient(
    -75deg,
    #6f42c1 0%,
    #d63384 25%,
    #fd7e14 50%,
    #198754 75%,
    #6f42c1 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer-text-animation 3s linear infinite;
}

@keyframes shimmer-text-animation {
  to {
    background-position: 200% center;
  }
} */

/* Shimmering Gradient Button Effect (Seamless Subtle Blue) */
.shimmer-btn {
  background-image: none;
  background-color: #0d6efd;
  border: none;
  color: white !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  animation: none;
}

.verify-status.processing-shimmer {
    display: inline-block;
    background-image: linear-gradient(90deg, #495057 0%, #adb5bd 25%, #6c757d 50%, #adb5bd 75%, #495057 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    animation: shimmer-gray 3.5s linear infinite;
}

@keyframes shimmer-gray {
    from { background-position: 200% center; }
    to   { background-position: -200% center; }
}

/* Guide slider title as clickable link */
#guideSliderTitle.guide-slider-title-clickable {
    cursor: pointer;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
#guideSliderTitle.guide-slider-title-clickable:hover {
    color: var(--bs-primary);
    text-decoration: underline;
}

.shimmer-blue {
    display: inline-block;
    background: none;
    color: inherit !important;
    animation: none;
}

.chartjs-tooltip {
    position: absolute;
    pointer-events: none;
    background-color: rgba(33, 37, 41, 0.92);
    color: #fff;
    padding: 0.35rem 0.5rem;
    border-radius: 0.35rem;
    font-size: 0.75rem;
    line-height: 1.2;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translate(-50%, -100%);
    transition: opacity 0.12s ease;
    z-index: 1080;
    min-width: 3.5rem;
    text-align: left;
}

.chartjs-tooltip-visible {
    opacity: 1;
}

.chartjs-tooltip-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.chartjs-tooltip-item {
    white-space: nowrap;
}

.chartjs-tooltip-color {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    margin-right: 0.35rem;
}

.badge-updating {
    animation: badge-fade 0.5s ease-in-out;
}

@keyframes badge-fade {
    0% { opacity: 0.3; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.03); }
    100% { opacity: 1; transform: scale(1); }
}
  
/* #endregion */


/* #region    --- 5. Side Panel --- */
/* ========================================================================== */

/* The side panel is a simple flex item with a fixed width, NOT absolutely positioned */
#sidePanelContainer {
    width: 525px;
    flex-shrink: 0;
    height: 100%;
    border-left: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    background-color: white;
    box-shadow: -3px 0px 6px -2px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}
/* Visibility of the side panel will be controlled by adding/removing 'd-none' in JS */

/* The Bootstrap 'nav' component is used for tabs. This makes it sticky. */
#sidePanelContainer > .nav {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 3;
    /* Use a variable for the background to ensure it matches */
    background-color: var(--bs-body-bg, #fff);
}

.side-panel-content {
    flex: 1 1 auto;
    min-height: 0;                 /* critical for flex children */
}

.tab-panel {
    /* This ensures the panel itself takes up the full height of its container */
    position: absolute;
    inset: 0;
    /* Inactive, fading-out panels are stacked, so they must not intercept mouse events. */
    pointer-events: none;
}

/*
 * Only the active, fully visible panel should be interactive.
 * Bootstrap's JS adds/removes .active and .show to manage transitions.
 */
.tab-panel.active.show {
    pointer-events: auto;
}

#overallScoreContainer.fade.show,
#recommendedGuidesContainer.fade.show,
#myGuidesContainer.fade.show {
  transition: opacity 1s ease-in-out !important;
}

:root {
  --slab-radius: 18px;
  --slab-shadow: 0 8px 30px rgba(15, 23, 42, 0.05);
  --slab-border: 1px solid rgba(0, 0, 0, 0.04);
  /* Use a flat hero background instead of a gradient */
  --bg-hero: #ffffff;
}

html, body {
  background: #ffffff !important;
  background-image: none !important;
}

.bg-hero,
#emptyStateContainer,
#emptyState {
  background: #ffffff !important;
  background-image: none !important;
}

.overall-score-content {
  width: 100%;
  max-width: 100%;
}

.overall-score-chart,
.overall-score-rating {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: none;
  background: transparent;
  box-shadow: var(--slab-shadow);
  box-sizing: border-box;
}

.overall-score-rating,
.overall-score-chart {
  flex: 1 1 0;
  width: 100%;
}

.overall-score-rating {
  min-height: 180px;
  padding: 1rem 1.25rem;
  flex-direction: column;
  gap: 0.75rem;
}

.overall-score-chart {
  padding: 1rem;
  flex-direction: column;
  gap: 0.75rem;
}

.overall-score-chart-visual {
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.overall-score-chart-visual canvas {
  width: 100% !important;
  height: 100% !important;
}

.overall-score-chart-status {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.rating-stars {
  line-height: 1;
}

.analyzed-item-summary {
  cursor: pointer;
}
.analyzed-item-summary:hover,
.analyzed-item-summary:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.absent-comment-toggle {
  cursor: pointer;
}
.absent-comment-toggle:hover,
.absent-comment-toggle:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.guide-edit-item-highlight {
  border-color: var(--bs-primary) !important;
  box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb, 13, 110, 253), 0.18);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.guide-card-chart-area .verify-status {
    padding-bottom: 2px;
}

.guide-group-body {
    padding: 0.75rem 1rem 0;
}

.guide-slider-title-disabled {
    pointer-events: none !important;
    text-decoration: none !important;
}

@media (max-width: 576px) {
  .overall-score-content {
    gap: 2rem !important;
  }

  .overall-score-rating {
    width: 164px;
    height: 164px;
  }
}

.overall-score-content.venue-slug-layout {
  gap: 2rem;
}

.overall-score-content.venue-slug-layout .overall-score-chart-visual {
  width: 130px;
  height: 130px;
}

.overall-score-content.venue-slug-layout .overall-score-chart-visual {
  width: 90px;
  height: 90px;
  margin: 0;
}


/* #endregion */


/* #region    --- 6. Notes Panel --- */
/* ========================================================================== */
.notes-list-scroll {
    max-height: none;
    overflow: visible;
    padding-bottom: 2rem;
}

#sidePanelTabs .guidesTabBtn i {
    font-size: 1.2rem;
}

#notesPanel {
    position: relative;
    background-color: #fff;
    overflow: visible;
}

#chatPanel {
    background-color: #fff;
}

#notesPanel .accordion {
    height: 100%;
    min-height: 0;
}

#notesListCollapse .accordion-body {
    max-height: 60vh;
    overflow-y: auto;
}

#notesListCollapse.show > .accordion-body {
    padding-bottom: 40px;
    min-height: calc(100% + 40px);
}

#reviewerGuidanceContainer .reviewer-guidance-link,
#reviewerGuidanceContainer .reviewer-guidance-link span,
#reviewerGuidanceContainer .reviewer-guidance-link i {
    color: var(--bs-primary-text-emphasis, var(--bs-primary)) !important;
    text-decoration: none;
    transition: color 0.2s ease;
}

#reviewerGuidanceContainer .reviewer-guidance-link:hover,
#reviewerGuidanceContainer .reviewer-guidance-link:focus,
#reviewerGuidanceContainer .reviewer-guidance-link:hover span,
#reviewerGuidanceContainer .reviewer-guidance-link:focus span,
#reviewerGuidanceContainer .reviewer-guidance-link:hover i,
#reviewerGuidanceContainer .reviewer-guidance-link:focus i {
    color: var(--bs-primary) !important;
    text-decoration: none;
}

#reviewerGuidanceCollapse .accordion-body {
    position: relative;
}

#notesNotepadContainer {
    flex: 0 0 60%;
    display: flex;
    flex-direction: column;
    min-height: 18rem;
    max-height: none;
}

#notesNotepadTextarea {
    flex: 1 1 auto;
    min-height: 0;
}

.guide-card-title-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.guide-card-icon-btn {
    border: none;
    background: transparent;
    padding: 0.25rem;
    line-height: 1;
    font-size: 1.05rem;
    color: var(--bs-primary);
}

.guide-card-icon-btn .guide-icon-default,
.guide-card-icon-btn .guide-icon-hover,
.guide-card-title {
    color: var(--bs-primary);
}

.guide-card-icon-btn .guide-icon-default {
    color: var(--bs-primary);
}

.guide-card-icon-btn.dropdown-toggle::after {
    display: none;
}

.guide-card-icon-btn:focus {
    outline: none;
    box-shadow: none;
}

.guide-card-chart-area > .p-2 {
    padding-left: 0;
    padding-right: 0;
}

.guide-card-chart-area {
    position: relative;
}

.run-matched-guide-btn,
.run-custom-guide-btn,
.run-basics-guide-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

.run-matched-guide-btn,
.run-basics-guide-btn {
    width: 1.7rem;
    height: 1.7rem;
    padding: 0 !important;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
}

#classificationLoadingState {
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#classificationLoadingState.active {
    opacity: 1;
}

.manuscript-scan-animation {
    width: 96px;
    height: 96px;
    flex: 0 0 96px;
}

.manuscript-scan-animation svg {
    width: 100%;
    height: 100%;
}

.manuscript-scan-animation .scan-file path,
.manuscript-scan-animation .scan-file line {
    stroke: var(--bs-primary, #0d6efd);
    stroke-width: 1.6;
}

.manuscript-scan-animation .scan-file .file-body {
    fill: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.12);
}

.manuscript-scan-animation .scan-file .file-fold {
    fill: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.2);
}

.manuscript-scan-animation .scan-lens circle,
.manuscript-scan-animation .scan-lens line {
    stroke: var(--bs-primary, #0d6efd);
    stroke-width: 2.4;
    fill: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.08);
}

.manuscript-scan-animation .scan-lens {
    animation: magnifySweep 4s ease-in-out infinite;
    transform-origin: center;
}

@keyframes magnifySweep {
    0% { transform: translate(-2px, -4px) rotate(0deg); }
    25% { transform: translate(10px, -8px) rotate(15deg); }
    50% { transform: translate(12px, 6px) rotate(-10deg); }
    75% { transform: translate(-6px, 10px) rotate(12deg); }
    100% { transform: translate(-2px, -4px) rotate(0deg); }
}


.note-snippet {
    border-top: 1px solid var(--border-color-light);
    padding: var(--spacing-xl) var(--spacing-xxl) var(--spacing-xl) 30px;
}
#notesPanel .note-snippet:first-child {
    border-top: none;
}

.note-header {
    min-height: 2.5em; 
    position: relative;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.note-text { 
    font-family: serif;
    cursor: pointer;
    flex-grow: 1;
    padding-right: 20px;
}
.free-text-content { 
    white-space: pre-wrap;
    word-wrap: break-word;
}
.note-reaction {
    font-size: 1.2em; 
    cursor: pointer;
}

/* Kebab Menu & Dropdown */
.kebab-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-color-muted);
    width: 1.8em;
    height: 1.8em;
    border-radius: var(--border-radius-medium);
    transition: background-color 0.15s ease-in-out;
}
.kebab-btn:hover {
    color: var(--text-color-dark);
    background-color: var(--medium-bg);
}
.note-actions .dropdown-menu {
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    z-index: 2000;
    position: absolute;
}
.note-actions .dropdown-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Custom Reaction Picker Panel */
.custom-reaction-picker {
    position: absolute;
    z-index: 1050;
    background-color: var(--white-bg);
    border: 1px solid var(--border-color-medium);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-strong);
    padding: 0.75rem;
    width: 280px;
  }

/* Tag interaction styles */
.tag-popover-content .tag-select-badge:hover {
    transform: translateY(-1px);
    filter: brightness(0.95);
}

/* Comment editing styles */
.comment-content-wrapper {
    margin-top: var(--spacing-sm);
    display: grid;
    grid-template-rows: auto 0fr; 
    transition: grid-template-rows var(--transition-long);
    overflow: hidden;
}
.note-snippet.comment-editing .comment-content-wrapper {
    grid-template-rows: 0fr auto; 
}
.comment-display { 
    white-space: pre-wrap;
    word-wrap: break-word;
    cursor: pointer;
    opacity: 1;
    transition: opacity var(--transition-medium);
}
.note-snippet.comment-editing .comment-display {
    opacity: 0;
    pointer-events: none;
}
.comment-area { 
    opacity: 0;
    pointer-events: none;
    overflow: hidden; 
}
.note-snippet.comment-editing .comment-area {
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
}
/* #endregion */


/* #region    --- 7. Chat Panel --- */
/* ========================================================================== */
#chatMessages {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chat-message {
    max-width: 80%;
    word-wrap: break-word;
}

.chat-bubble-assistant .citation-quote {
    font-family: Georgia, Times, 'Times New Roman', serif;
    color: #6c757d;
    font-size: 0.9em;
    margin-top: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-left: 2px solid #dee2e6;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.chat-bubble-assistant .citation-quote:hover {
    background-color: var(--bs-light-bg-subtle);
    color: var(--bs-body-color);
}

.chat-message.assistant .citation-quotes-container {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
}

.chat-message.assistant .citation-quote {
    font-family: Georgia, Times, 'Times New Roman', serif;
    color: #6c757d;
    font-size: 0.9em;
    margin-top: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-left: 2px solid #dee2e6;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.chat-message.assistant .citation-quote:hover {
    background-color: #f8f9fa;
}
/* #endregion */


/* #region    --- 8. Guides Panel & Slider --- */
/* ========================================================================== */
.bg-hero {
    background: var(--bg-hero);
}
.app-footer {
    background: #ffffff !important;
    background-image: none !important;
    position: relative; /* keep it above any lingering shadows/gradients */
    z-index: 1;
}

.slab-shadow {
    box-shadow: var(--slab-shadow) !important;
    border: var(--slab-border) !important;
}

.guide-cards-section {
    padding: var(--spacing-lg) 0;
}

.slab-panel {
    background: #ffffff;
    border-radius: var(--slab-radius);
    border: var(--slab-border);
    box-shadow: var(--slab-shadow);
    padding: 1.1rem 1.25rem 1.35rem;
}

.slab-panel .guide-group-body {
    padding: 0.35rem 0.35rem 0;
}

.guide-cards-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    align-content: stretch;
}

.guide-card-chart-area .guide-card-title {
    cursor: pointer;
}

.guide-card-chart-area .guide-card-title:hover,
.guide-card-chart-area .guide-card-title:focus {
    color: var(--bs-primary) !important;
    text-decoration: underline;
    text-underline-offset: 0.3em;
}

.guide-card-title .guide-card-info-icon {
    color: var(--bs-secondary);
    transition: color 0.2s ease;
}

.guide-card-title:hover .guide-card-info-icon,
.guide-card-title:focus .guide-card-info-icon {
    color: var(--bs-primary);
}

.guide-card-info-icon:hover {
    color: var(--bs-primary);
}

.guide-slider {
    position: absolute;
    inset: 0;
    background-color: var(--bs-body-bg, #fff);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.guide-slider.active {
    transform: translateX(0%);
}
.tab-panel > .guide-slider {
    flex-grow: 1;
}

.guide-slider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-xl);
    background-color: var(--light-bg);
    border-bottom: 1px solid var(--border-color-medium);
    flex-shrink: 0;
}
.guide-slider-header h3 {
    margin: 0;
    font-size: 1.2em;
}
.guide-slider-content {
    flex-grow: 1;
    overflow-y: auto;
    min-height: 0;
}

.accordion-button:not(.collapsed) {
    color: var(--bs-body-color);
    background-color: transparent;
    box-shadow: none;
}

.guide-slider-content .accordion-button.pending-section,
.guide-slider-content .accordion-button.pending-section:not(.collapsed),
.guide-slider-content .accordion-button.pending-section:disabled {
    background-color: var(--bs-gray-200, #e9ecef) !important;
    cursor: not-allowed;
}

.guide-slider-content .accordion-button.pending-section::after {
    opacity: 0.45;
}

.guide-slider-content .accordion-button.pending-section:hover,
.guide-slider-content .accordion-button.pending-section:focus {
    background-color: var(--bs-gray-200, #e9ecef) !important;
}


/* for the recommended guide container spinner, message and bar charts */
/* .fade-out {
    opacity: 0 !important;
    transition: opacity 0.4s ease-out;
}

.fade-in {
    opacity: 1 !important;
    transition: opacity 0.4s ease-in;
}

.initially-hidden {
    opacity: 0;
} */

/* Styling for the “Manage guides” button */

  :root{
    --guide-accent: var(--bs-purple, #6f42c1);
    --guide-accent-text: #4e2f8f;      /* readable purple for text */
    --guide-accent-light: #efe9fb;     /* light purple bg */
    --guide-accent-light-hover: #e3d6f9;
    --guide-accent-border: #4e2f8f;    /* same as text*/
  }
  
.manage-guides-btn{
    background-color: var(--guide-accent-light);
    color: var(--guide-accent-text);
    border: 1px solid var(--guide-accent-border);
    border-radius: .5rem;
  }
  .manage-guides-btn:hover,
  .manage-guides-btn:focus{
    background-color: var(--guide-accent-light-hover);
    color: var(--guide-accent-text);
  }
  .manage-guides-btn:focus-visible{
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(111, 66, 193, .2);
  }
  
  /* Subtle animation for the filter dropdown */
.dropdown-menu.dropdown-animate {
    transform: translateY(-4px);
    transition: opacity 120ms ease, transform 160ms ease;
    will-change: opacity, transform;
  }
  
  /* Bootstrap's .fade handles opacity; we add the slide */
  .dropdown-menu.fade { opacity: 0; }
  .dropdown-menu.fade.show {
    opacity: 1;
    transform: translateY(0);
  }
  
  /* Base size for all status icons (optional, if you want consistency) */
.guide-slider-content .analyzed-item-row .col-auto i.bi {
    font-size: 16px;
    line-height: 1;
  }
  
  /* Make only the "present" checkmark and "warning" question a tad larger for optical balance */
  .guide-slider-content .analyzed-item-row .col-auto.text-success .bi-check,
  .guide-slider-content .analyzed-item-row .col-auto.text-warning .bi-question {
    font-size: 24px;        /* increase size by about 50% */
    line-height: 1;
    display: inline-block;
  }
  

    /* Fix for Recommended Guides alignment */
    #recommendedGuideCardsContainer {
        display: block; /* Override grid layout to stack items vertically */
    }
  
/* #endregion */


/* #region    --- 9. Guideline Selector Modal --- */
/* ========================================================================== */
#selectGuidelineModal .modal-dialog {
    max-height: 80vh;
    min-height: 50vh;
    display: flex;
    flex-direction: column;
}

#selectGuidelineModal .modal-content {
    flex-grow: 1;
    height: auto;
    display: flex;
    flex-direction: column;
}

#selectGuidelineModal .modal-body {
    padding: 0;
    flex-grow: 1;
    display: flex;
    overflow: hidden;
}
.guideline-modal-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem;
}
#guidelineFacetColumn { 
    background-color: var(--light-bg);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

#guidelineCardContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    align-content: start;
    flex-grow: 1;
    overflow-y: auto;
}
.guideline-select-card {
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    min-height: 150px;
}
.guideline-select-card:hover {
    box-shadow: var(--bs-box-shadow) !important;
    transform: translateY(-3px);
}
.guideline-select-card .card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.guideline-select-card .card-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.guideline-select-card .card-text.guideline-description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 4;
}
.custom-guideline-card .card-text.guideline-description {
    -webkit-line-clamp: 2;
}
.custom-guideline-card .form-check {
    background-color: transparent !important;
}

.guideline-detail-slider {
    position: absolute;
    inset: 0;
    background-color: var(--white-bg);
    z-index: 10;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    will-change: transform, opacity;
}
.guideline-detail-slider.active {
    transform: translateX(0%);
    opacity: 1;
    pointer-events: auto;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
}
.guideline-detail-slider-content-wrapper {
    display: flex;
    flex-grow: 1;
    overflow-y: hidden;
}

#guideline-content-spacer {
    width: calc(32px + 1rem);
    flex-shrink: 0;
}

.guideline-detail-slider-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.guideline-detail-slider-header {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0.75rem 1.25rem;
    padding-top: 2rem;
}

#closeGuidelineDetailSliderBtn {
    flex-shrink: 0;
    width: 32px;
    margin-right: 1rem;
}

#guidelineDetailName {
    flex-grow: 1;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guideline-slider-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.reference-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

#guidelineFacetColumn .accordion-button {
    font-size: 0.9rem;
    padding: 0.8rem 1.25rem;
    background-color: transparent;
}
#guidelineFacetColumn .accordion-button:not(.collapsed) {
    background-color: var(--bs-accordion-btn-bg);
    box-shadow: none !important;
    color: var(--bs-accordion-active-color);
}
#guidelineFacetColumn .accordion-button:focus {
    box-shadow: none !important;
}
.accordion-button.collapsed {
    background-color: transparent;
}

.standalone-accordion-btn.active {
    z-index: 2;
    color: var(--bs-accordion-active-color);
    background-color: var(--bs-accordion-active-bg);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .125);
    font-weight: 600;
}
#guidelineFacetColumn .list-group-item {
    font-size: 0.85rem;
    border: 0;
    background-color: transparent;
}
#guidelineFacetColumn .list-group-item.active {
    background-color: transparent;
    font-weight: 600;
    color: var(--primary-color);
}
#guidelineFacetColumn .accordion-item {
    background-color: transparent;
    border: none;
}
#guidelineFacetColumn .accordion-item,
#guidelineFacetColumn .accordion-button {
    --bs-accordion-bg: transparent;
    background-color: transparent !important;
    border: none !important;
}
#guidelineFacetColumn .accordion-button:hover {
    background-color: rgba(0, 0, 0, 0.03) !important;
}
/* #endregion */


/* #region    --- 10. Responsive Adjustments --- */
/* ========================================================================== */
@media (max-width: 1280px) {
    #controlsContainer { padding-right: 35%; } 
    #sidePanelContainer { width: 40%; }
}
@media (max-width: 768px) { 
    #controlsContainer { padding-right: var(--spacing-xl); } 
    #sidePanelContainer {
        position: fixed; 
        top: 0;
        right: -85%; 
        width: 85%;
        max-width: 400px; 
        height: 100vh;
        z-index: 1005; 
        border-left: none; 
        box-shadow: -5px 0 15px rgba(0,0,0,0.2);
        transform: translateX(0) !important;
        opacity: 1; 
        visibility: visible;
        pointer-events: auto; 
    }
    
    #sidePanelContainer.sidebar-visible { 
        right: 0; 
    }
}
/* #endregion --- 10. Responsive Adjustments --- */


/* #region    --- 11. free text styles --- */
/* ========================================================================== */
.note-divider {
    height: 16px;
    position: relative;
    /* Adjusted transition duration */
    transition: all 0.35s ease-in-out; 
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.note-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background-color: transparent;
    /* Adjusted transition duration */
    transition: background-color 0.35s ease-in-out;
}

.note-divider:hover::before {
    background-color: var(--bs-primary);
    height: 2px; /* Make the line thicker on hover */
}

.note-divider .add-note-between-btn {
    width: 28px;
    height: 28px;
    position: relative;
    right: 1rem;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.35s ease-in-out;
    line-height: 1;
}

.note-divider:hover .add-note-between-btn {
    opacity: 1;
    transform: scale(1);
}

#notesNotepadContainer {
    background-color: var(--bs-body-bg);
}

#notesNotepadTextarea {
    min-height: 136px;
    resize: vertical;
}

#notesNotepadStatus {
    transition: color 0.2s ease, opacity 0.2s ease;
}

/* #endregion --- 11. free text styles --- */


/* #region Notes not showing as PDF is still loading */
.animated-ellipsis::after {
    display: inline-block;
    animation: ellipsis-animation 1.4s infinite;
    content: ".";
    width: 1em;
    text-align: left;
}
  
@keyframes ellipsis-animation {
    0% { content: "."; }
    33% { content: ".."; }
    66% { content: "..."; }
}
/* #endregion Notes not showing as PDF is still loading */
.guide-group-header .guides-panel-subheader {
    color: rgba(33, 37, 41, 0.75);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-group-container {
    overflow: hidden;
}

#overallScoreContainer {
    overflow: visible;
}

#overallScoreContainer .card {
    overflow: visible;
    background: transparent;
}

.guide-group-container .card {
    overflow: hidden;
    transition: padding 0.25s ease;
}

#guidesPanel {
    display: flex;
    flex-direction: column;
    min-height: 0; /* allow inner scroll containers to shrink */
}

#guidesResultsInner {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.guide-group-container .card > :not(:first-child) {
    display: block;
    opacity: 1;
    transform: scaleY(1);
    transform-origin: top;
    transition: opacity 0.25s ease, transform 0.25s ease, height 0.25s ease, padding 0.25s ease;
}

.guide-group-container.collapsed .card > :not(:first-child) {
    opacity: 0;
    transform: scaleY(0);
    height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 0 !important;
}

.guide-group-container.collapsed .card {
    padding-bottom: 0.5rem;
}

.guide-group-header-content {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.guide-collapse-btn {
    border: none;
    background: transparent;
    color: inherit;
    padding: 0.125rem 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease;
}
.guide-collapse-btn i {
    transition: transform 0.25s ease;
}

.guide-group-container.collapsed .guide-collapse-btn i {
    transform: rotate(180deg);
}

.guide-collapse-btn:focus {
    outline: none;
    box-shadow: none;
}

.guide-slider-content .analyzed-item-row {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.guide-slider-content .analyzed-item-row.is-filtered-out {
    opacity: 0;
    transform: translateX(12px);
}

.guide-slider-content .accordion-body {
    display: grid;
    grid-template-columns: 1fr;
    transition: grid-template-rows 0.25s ease;
}

.guide-slider-content .accordion-body > .analyzed-item-row {
    transition: opacity 0.2s ease, transform 0.2s ease, max-height 0.25s ease, margin 0.2s ease, padding 0.2s ease;
    max-height: 1200px;
}

.guide-slider-content .accordion-body > .analyzed-item-row.is-filtered-out {
    max-height: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}


.guide-followup-chat {
    display: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.guide-followup-chat.is-visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.guide-followup-chat .guide-followup-input {
    resize: none;
    min-height: auto;
}

.guide-followup-chat .guide-followup-status {
    transition: color 0.2s ease;
}

.guide-followup-icon {
    text-align: right;
}

.guide-followup-icon button {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.guide-followup-icon button:hover .bi,
.guide-followup-icon button:focus .bi {
    color: var(--bs-primary);
    transform: scale(1.05);
}

.guide-followup-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-followup-input-row .guide-followup-input {
    flex: 1 1 auto;
}

.guide-followup-input-row .guide-followup-submit {
    width: 2.25rem;
    min-width: 2.25rem;
}

.manuscript-stat-box {
    background-color: rgba(25,135,84,0.06);
    border: 1px solid var(--stat-border-color);
    border-radius: 0.6rem;
    padding: 0.45rem 0.35rem;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
    min-width: 90px;
}

.manuscript-stat-box .icon {
    font-size: 1.1rem;
}

.manuscript-stat-box .value {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.1;
}
.manuscript-stat-box .stat-label {
    font-size: 0.65rem;
    letter-spacing: 0.02em;
    margin-top: 0.1rem;
    color: rgba(25,135,84,0.85);
}

.manuscript-stat-box .stat-label {
    font-size: 0.65rem;
    letter-spacing: 0.02em;
    margin-top: 0.1rem;
    color: rgba(25,135,84,0.85);
}

.manuscript-details-list {
    padding-left: 1.2rem;
    margin-bottom: 0;
}

.manuscript-details-list > li::marker {
    color: rgba(25,135,84,0.75);
}
.classification-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin: 3rem auto 1.5rem;
    text-align: center;
}

.classification-loading-state .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.35rem;
}

#classificationEllipsis {
    display: inline-block;
    width: 1.5ch;
    text-align: left;
    white-space: pre;
}

#sidePanelContainer{--side-panel-width:360px;}
#reviewerGuidancePanel.guide-slider {
    inset: 0;
    background-color: var(--bs-body-bg, #fff);
    z-index: 5;
}
#overallFeedbackReportModal .modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  gap: 0.5rem;
}

#overallFeedbackReportModal .modal-footer .btn {
  min-height: 38px;
}

#overallFeedbackReportModal #exportResultsControl {
  display: inline-flex;
  align-items: stretch;
}
