/* =============================================================================
   CSS VARIABLES - DESIGN TOKENS
   Change these to control the entire design system
   ============================================================================= */
:root {
  /* =========================
     BRAND COLORS - Main Theme
     ========================= */
  --brand-primary: #4b8bf4;           /* Main blue - buttons, links, active states */
  --brand-primary-hover: #3a7ae4;     /* Darker blue for hover states */
  --brand-secondary: #d1d5db;         /* Secondary gray */
  --brand-accent: #0b233c;            /* Dark blue for headers/nav */
  
  /* Legacy variable aliases for compatibility */
  --btn-primary-bg: var(--brand-primary);
  --btn-primary-text: #ffffff;
  --btn-secondary-bg: var(--brand-secondary);
  --btn-secondary-text: var(--text-primary);
  --blue-nav-bg: var(--brand-accent);
  --border-color: var(--border-primary);
  --bg-card: var(--bg-surface);
  --bg-card-alt: var(--bg-surface-alt);
  --bg-secondary: var(--bg-surface-alt);
  --input-text: var(--text-primary);
  --badges-border: var(--border-secondary);

  /* =========================
     BACKGROUNDS 
     ========================= */
  --bg-primary: #f5f6fa;              /* Main page background */
  --bg-surface: #ffffff;              /* Cards, modals, dropdowns */
  --bg-surface-alt: #f0f2f5;          /* Alternative surface */
  --bg-sidebar: #f7f8fa;              /* Sidebar background */
  --bg-hero: #eceef3;                 /* Hero/header sections */
  --bg-nav: var(--brand-accent);      /* Navigation background */

  /* =========================
     TEXT COLORS 
     ========================= */
  --text-primary: #1e1f24;            /* Main text */
  --text-secondary: #4b4c51;          /* Secondary text, captions */
  --text-on-dark: #f5f6fa;            /* Text on dark backgrounds */
  --text-on-dark-muted: #d1d5db;      /* Muted text on dark backgrounds */

  /* =========================
     BORDERS & LINES 
     ========================= */
  --border-primary: #d1d5dbcc;        /* Main borders */
  --border-secondary: #c6c8cd;        /* Secondary borders, badges */
  --border-radius: 8px;               /* Standard border radius */
  --border-radius-large: 10px;        /* Large border radius for cards */

  /* =========================
     INTERACTIVE ELEMENTS 
     ========================= */
  --btn-height: 40px;                 /* Standard button height */
  --input-bg: var(--bg-surface);      /* Input backgrounds */
  --dropdown-bg: var(--bg-surface);   /* Dropdown backgrounds */
  
  /* =========================
     FEEDBACK COLORS 
     ========================= */
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #17a2b8;

  /* =========================
     TABLE SPECIFIC 
     ========================= */
  --table-hover: rgba(75, 139, 244, 0.2);      /* Table row hover */
  --table-stripe-odd: rgba(240, 242, 247, 0.9); /* Odd row stripes */
  --table-stripe-even: rgba(255, 255, 255, 0.9); /* Even row stripes */

  /* =========================
     JUDGMENT/STATUS COLORS 
     ========================= */
  --status-adhered-high: #6fa035;
  --status-adhered-low: #a3b354;
  --status-violated-high: #c0392b;
  --status-violated-low: #e67e22;
  --status-not-applicable: #9a9a9a;
  --status-neutral: #ffc107;
  --status-resolved: #3498db;
  --status-not-rated: rgba(0, 0, 0, 0.2);

  /* =========================
     SCROLLBARS 
     ========================= */
  --scroll-thumb: #c1c2c8;
  --scroll-track: #f0f2f5;

  /* =========================
     SHADOWS & EFFECTS 
     ========================= */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 10px 50px rgba(0, 0, 0, 0.1);

  /* =========================
     TRANSITIONS 
     ========================= */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* =============================================================================
   RESET & BASE STYLES
   ============================================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  margin: 0;
  color: var(--text-primary);
}

p { text-wrap: pretty; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; }

ul, li {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* =============================================================================
   TYPOGRAPHY SCALE
   ============================================================================= */
h1 { font-size: clamp(1.6rem, 2.7vw, 2.1rem); font-weight: 400; line-height: 1.4; }
h2 { font-size: clamp(1.35rem, 2.3vw, 1.6rem); font-weight: 400; line-height: 1.4; }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.35rem); font-weight: 400; line-height: 1.4; }
h4 { font-size: clamp(1rem, 1.6vw, 1.15rem); font-weight: 400; line-height: 1.4; }
h5 { font-size: clamp(0.9rem, 1.4vw, 1rem); font-weight: 400; line-height: 1.4; }
h6 { font-size: clamp(0.8rem, 1.1vw, 0.9rem); font-weight: 400; line-height: 1.4; }

p { font-size: 0.9375rem; }

/* Typography utilities */
.txt-small { font-size: 0.8125rem; color: var(--text-secondary); }
.txt-xsmall { font-size: 0.6875rem; color: var(--text-secondary); }
.txt-light { font-weight: 200; }
.txt-normal { font-weight: 400; }
.txt-medium { font-weight: 500; }
.txt-bold { font-weight: 700; }
.txt-xbold { font-weight: 900; }
.italic { font-style: italic; }
.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.underline { text-decoration: underline; }

/* =============================================================================
   BUTTON SYSTEM
   Control all button styles from here
   ============================================================================= */
.btn {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-height);
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
  color: white;
}

.btn-secondary {
  background-color: var(--brand-secondary);
  border-color: var(--brand-secondary);
  color: var(--text-primary);
}

.btn-outline {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
  background-color: transparent;
}

/* Specialized button styles */
.btn-sm.guideline {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  border-radius: 6px;
  padding: .2rem .4rem;
  color: white;
  height: auto;
  text-decoration: none;
}

.btn-sm.gemini {
  padding: .2rem .4rem;
  color: var(--text-secondary);
  border-radius: 6px;
  height: auto;
  background: transparent;
  text-decoration: none;
}

.btn-sm.admin {
  padding: .2rem .4rem;
  color: var(--text-secondary);
  border-radius: 6px;
  background-color: rgba(0, 123, 255, 0.1);
  border: 1px solid rgba(0, 123, 255, 0.3);
  height: auto;
  text-decoration: none;
}

/* =============================================================================
   NAVIGATION SYSTEM
   ============================================================================= */
.navbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-md);
  background-color: var(--bg-nav);
}

.navbar-brand {
  font-size: 1.25rem;
  letter-spacing: 0.5px;
  color: var(--text-on-dark);
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 6px;
  transition: all var(--transition-fast);
  white-space: nowrap;
  display: flex;
  align-items: center;
  color: var(--text-on-dark-muted);
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
  color: var(--text-on-dark);
}

.nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
  font-weight: 600;
  color: var(--text-on-dark);
}

/* =============================================================================
   LAYOUT COMPONENTS
   ============================================================================= */

/* Main structural elements */
main { flex: 1; }

.dashboard-wrapper {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 80px);
}

.main-content {
  display: flex;
  flex: 1;
  background-color: var(--bg-primary);
}

/* Header/Overview section */
.overview {
  overflow: hidden;
  text-transform: capitalize;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border-primary);
  background-color: var(--bg-nav);
  padding: 2rem 1rem;
}

.overview > .section-title {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.overview > .section-title > .project-details {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2rem;
}

.overview h2, .overview h6 {
  color: var(--text-on-dark);
}

.overview p {
  color: var(--text-on-dark-muted);
}

/* Cards */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-large);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* =============================================================================
   TABLE SYSTEM
   Comprehensive table styling
   ============================================================================= */
.table-container {
  background-color: var(--bg-primary);
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  min-width: 0;
  padding: 1rem;
  width: 100%;
  min-height: 500px;
}

.dtable-container {
  flex: 1;
  height: 100vh;
  border-radius: 0px;
  width: calc(100% - 300px);
  overflow: hidden;
}

.table {
  color: var(--text-primary);
  border-color: var(--border-primary);
  font-size: .9rem;
  width: 100%;
  table-layout: fixed;
}

.table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
  vertical-align: middle;
  transition: background-color var(--transition-fast);
}

.table th {
  vertical-align: middle;
  font-weight: 600;
}

.table tr {
  border-color: var(--border-primary);
}

/* Table hover effects */
.table tbody tr:hover > td {
  background-color: var(--table-hover) !important;
}

/* Citation-based row grouping */
.table tbody tr[data-group="0"] > td {
  background-color: var(--table-stripe-odd) !important;
  box-shadow: none !important;
  color: var(--text-primary) !important;
}

.table tbody tr[data-group="1"] > td {
  background-color: var(--table-stripe-even) !important;
  box-shadow: none !important;
  color: var(--text-primary) !important;
}

.table tbody tr[data-group="0"]:hover > td,
.table tbody tr[data-group="1"]:hover > td {
  background-color: var(--table-hover) !important;
}

/* DataTables specific styling */
#guidelines-table {
  width: 100% !important;
  table-layout: fixed;
  visibility: visible !important;
  opacity: 1;
  transition: opacity var(--transition-normal);
}

#guidelines-table.dt-processing { opacity: 0.7; }
#guidelines-table.dt-ready { opacity: 1; }

#guidelines-table th,
#guidelines-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dt-info {
  color: var(--text-secondary);
  font-size: clamp(0.8rem, 1.1vw, 0.9rem);
}

/* Table controls */
#column-toggles-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  min-height: 50px;
}

.toggle-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-right {
  display: flex;
  align-items: center;
  min-height: 40px;
}

/* =============================================================================
   STATUS & BADGE SYSTEM
   ============================================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Judgment/Status badges */
.judgment-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  color: white !important;
  font-weight: bold;
}

.judgment-adhered_high { background-color: var(--status-adhered-high); }
.judgment-adhered_low { background-color: var(--status-adhered-low); }
.judgment-violated_high { background-color: var(--status-violated-high); }
.judgment-violated_low { background-color: var(--status-violated-low); }
.judgment-not_applicable { background-color: var(--status-not-applicable); }
.judgment-neutral { background-color: var(--status-neutral); }
.judgment-issue_resolved { background-color: var(--status-resolved); }
.judgment-not_rated { background-color: var(--status-not-rated); }

/* Case study badges */
.case-study-badge {
  border-radius: var(--border-radius-large);
  background-color: var(--bg-surface-alt);
  padding: 6px 12px;
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  text-decoration: none;
  font-size: .875rem;
  transition: all var(--transition-fast);
}

.case-study-badge.active {
  border: 2px solid var(--brand-primary) !important;
  color: var(--brand-primary) !important;
  font-weight: 600;
}

/* =============================================================================
   DROPDOWN & FORM CONTROLS
   ============================================================================= */
.dropdown-menu {
  background-color: var(--dropdown-bg);
  border-color: var(--border-primary);
  box-shadow: var(--shadow-lg);
}

.dropdown-item {
  color: var(--text-primary);
  transition: background-color var(--transition-fast);
}

.dropdown-item:hover {
  background-color: var(--bg-surface-alt);
}

/* Form controls */
.form-control {
  background-color: var(--input-bg);
  border-color: var(--border-primary);
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 0.2rem rgba(75, 139, 244, 0.25);
}

/* =============================================================================
   DOWNLOAD/EXPORT SECTION
   ============================================================================= */
.downloads {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem 1rem;
  background-color: var(--bg-nav);
}

.downloads .section-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.downloads .section-header .header-title h2 {
  color: var(--text-on-dark);
}

.downloads .section-header .header-title p {
  color: var(--text-on-dark-muted);
}

.dataset-link {
  border-radius: var(--border-radius);
  background-color: rgba(255, 255, 255, 0.08);
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-on-dark-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  gap: .5rem;
  opacity: 0.7;
}

.dataset-link:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-on-dark);
  opacity: 1;
  transform: translateY(-1px);
}

.dataset-link.active {
  background-color: var(--bg-surface) !important;
  border: 2px solid var(--brand-primary);
  color: var(--text-primary);
  opacity: 1;
  transform: none;
  box-shadow: 0 2px 8px rgba(75, 139, 244, 0.15);
}

/* =============================================================================
   ICON SYSTEM
   ============================================================================= */
i {
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.badge i {
  font-size: 0.8em;
  line-height: 1;
}

.nav-link i {
  line-height: 1;
  margin-right: 5px;
}

.table th i {
  vertical-align: middle;
  margin-right: 0.2rem;
  font-size: .8rem !important;
}

/* =============================================================================
   SCROLLBARS
   ============================================================================= */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-primary);
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

/* Mobile-friendly table responsiveness for sessions landing */
@media (max-width: 1322px) {
  .table-responsive .table th:nth-child(2),
  .table-responsive .table td:nth-child(2) {
    display: none;
  }
}

@media (max-width: 1000px) {
  .table-responsive .table th:nth-child(4),
  .table-responsive .table td:nth-child(4) {
    display: none;
  }
}

@media (max-width: 1199.98px) {
  .overview,
  .main-content {
    flex-direction: column;
  }

  .filters-sidebar {
    display: none !important;
  }

  .dtable-container {
    overflow-x: auto;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .table-responsive .table th:nth-child(3),
  .table-responsive .table td:nth-child(3) {
    display: none;
  }
}

@media (max-width: 768px) {
  .table {
    font-size: 0.8rem;
  }

  .dtable-container {
    flex: 1;
    overflow-y: auto;
  }

  .navbar-brand {
    font-size: 1.1rem;
  }
  
  .nav-link {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
  }
}

/* =============================================================================
   UTILITY CLASSES & OVERRIDES
   ============================================================================= */

/* Remove Bootstrap defaults that conflict */
.table > :not(caption) > * > * {
  box-shadow: none !important;
}

.list-group-flush > .list-group-item {
  border-width: 0px;
  padding: 0;
  background-color: transparent;
}

/* DataTables wrapper adjustments */
#guidelines-table_wrapper > div:nth-child(1) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 1rem;
}

div.dataTables_wrapper div.dataTables_info {
  padding-top: 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_paginate {
  margin-top: 1.5rem !important;
}

.dataTables_wrapper .dataTables_paginate {
  margin-top: 0 !important;
}

/* Fixed columns styling (if used) */
.dtfc-fixed-left,
.dtfc-fixed-right {
  background-color: var(--bg-surface) !important;
  border-right: 2px solid var(--border-primary) !important;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1001 !important;
}

.dtfc-fixed-right {
  border-right: none !important;
  border-left: 2px solid var(--border-primary) !important;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15), -4px 0 16px rgba(0, 0, 0, 0.1);
}

/* Fixed columns hover states - add blur to prevent seeing content below */
.table tbody tr:hover .dtfc-fixed-left,
.table tbody tr:hover .dtfc-fixed-right {
  background-color: var(--table-hover) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

/* Single year button styling - full border radius when alone */
.btn-group:has(> :only-child) > span,
.btn-group:has(> :only-child) > a {
  border-radius: 4px !important;
}

/* Image styling */
.main-image-container #main-image {
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
  border-radius: var(--border-radius);
  transition: all var(--transition-normal);
}

.main-image-container #main-image:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

/* Download preview */
.download-preview {
  background-color: transparent;
}

.download-preview .card {
  box-shadow: var(--shadow-xl);
  border-radius: 0px;
}

.download-preview .card-header {
  background-color: var(--bg-hero);
  padding: 1rem;
  border: 0px;
}

.download-preview .card-body {
  padding: 0px;
}

#data-table_wrapper > div:nth-child(1) {
  background-color: var(--bg-primary);
  margin-top: 0rem !important;
  padding: 1rem;
  font-size: clamp(0.8rem, 1.1vw, 0.9rem);
  color: var(--text-secondary);
}

#data-table_wrapper .dataTables_scroll {
  padding: 0 1rem;
}

/* Column toggles interface */
.column-toggles-wrapper {
  margin-top: 1rem;
}

.toggle-columns-btn {
  border-color: var(--border-primary);
  color: var(--text-primary);
  background-color: var(--bg-surface);
  transition: all var(--transition-fast);
}

.toggle-columns-btn:hover {
  background-color: var(--bg-surface-alt);
  border-color: var(--brand-primary);
  color: var(--text-primary);
}

.toggle-columns-btn i {
  font-size: 1rem;
  margin-right: 0.5rem;
}

#columnTogglesCollapse .card {
  border: 1px solid var(--border-primary);
  background-color: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

#columnTogglesCollapse .form-check {
  margin-bottom: 0.25rem;
}

#columnTogglesCollapse .form-check-input {
  background-color: var(--bg-surface);
  border-color: var(--border-primary);
}

#columnTogglesCollapse .form-check-input:checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

#columnTogglesCollapse .form-check-label {
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
}

#columnTogglesCollapse .form-check-label:hover {
  color: var(--brand-primary);
}

/* Upload history button */
.upload-history-btn {
  text-decoration: none;
  background-color: var(--brand-primary);
  border: 1px solid var(--brand-primary);
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: .5rem 1rem;
  line-height: 1;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.upload-history-btn:hover {
  background-color: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
  color: white;
}

/* Section specific styling */
.section-table {
  padding: 0 2rem;
}

.section-table .card {
  border-radius: 20px;
}

.section.table-section {
  background-color: transparent;
  min-height: 100vh;
}

.section.table-section .card {
  height: 100vh;
  border-radius: 0px;
  border: none;
}

/* =============================================================================
   SIDEBAR SYSTEMS - Filters & Guidelines
   ============================================================================= */

/* =========================
   FILTERS SIDEBAR
   ========================= */
.filters-sidebar {
  width: 300px;
  min-width: 300px;
  padding: 1rem;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-primary);
  height: 100vh;
  transition: transform var(--transition-normal);
}

/* Mobile responsive styles - now handled by Bootstrap offcanvas */

/* Filter grouping */
.default-filters-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.responsive-filter-wrapper {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

/* Platform filter buttons */
.filter-by-platform-wrapper .btn-group label {
  font-size: 0.8125rem;
}

/* Section title */
.section-header {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

/* Form labels and controls */
.form-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

/* Website case study badges in filters */
.case-studies-list a.case-study-badge {
  border-radius: var(--border-radius-large);
  background-color: var(--bg-surface);
  padding: 6px 12px;
  border: 1px solid var(--border-secondary);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background-color var(--transition-fast);
}

.case-study-badge.active {
  background-color: var(--brand-primary);
  color: white;
}

/* Filter checkboxes */
.form-check-input {
  margin-right: 0.5rem;
  background-color: var(--bg-surface);
  border-color: var(--border-primary);
}

.form-check-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Reset button in filters */
.filter-actions .btn-secondary {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  background-color: var(--brand-secondary);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
}

/* Disabled filters */
.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.disabled input, 
.disabled select, 
input:disabled, 
select:disabled {
  background-color: #f2f2f2 !important;
  cursor: not-allowed;
  opacity: 0.7;
}

.disabled .btn-group label {
  opacity: 0.6;
  pointer-events: none;
}

.disabled .case-studies-list a {
  opacity: 0.6;
  pointer-events: none;
}

.disabled .form-check-input {
  pointer-events: none;
}

/* =========================
   GUIDELINE SIDEBAR
   ========================= */

/* Layout structure */
.wrapper {
  width: 100%;
}

.sidebar {
  width: 350px;
  min-width: 350px;
  border-right: 1px solid var(--border-primary);
  background-color: var(--bg-surface);
  height: calc(100vh - 60px);
  overflow-y: auto;
  position: sticky;
  top: 60px;
}

/* Override Bootstrap list-group base styles */
.sidebar .list-group-item {
  background-color: var(--bg-surface) !important;
  border-color: var(--border-primary) !important;
  color: var(--text-primary) !important;
  padding: 0 !important;
  border: none !important;
  border-bottom: 1px solid var(--border-primary) !important;
}

/* UNIFIED GUIDELINE ITEM STYLING */
.sidebar .guideline-item {
  border-left: 3px solid var(--border-primary) !important;
  background-color: var(--bg-surface) !important;
  transition: all var(--transition-fast) !important;
  display: block !important;
  padding: 0.5rem !important;
  border-bottom: 1px solid var(--border-primary) !important;
  color: var(--text-primary) !important;
  text-decoration: none !important;
  cursor: pointer !important;
}

.sidebar .guideline-item:hover {
  background-color: var(--table-hover) !important;
  border-left-color: var(--brand-primary) !important;
}

.sidebar .guideline-item.active-item {
  background-color: var(--brand-primary) !important;
  border-left-color: var(--brand-primary) !important;
}

.sidebar .guideline-content {
  padding: 0.25rem 0;
}

.sidebar .guideline-info {
  flex: 1;
  min-width: 0;
}

.sidebar .guideline-title {
  color: var(--text-primary) !important;
  font-weight: 500 !important;
  font-size: 0.9rem !important;
  display: block !important;
  line-height: 1.3 !important;
  text-decoration: none !important;
}

.sidebar .guideline-meta {
  font-size: 0.75rem;
  margin-top: 0.2rem;
  color: var(--text-secondary);
}

.sidebar .guideline-item.active-item .guideline-title, 
.sidebar .guideline-item.active-item .guideline-meta {
  color: white !important;
}

/* Platform badges */
.sidebar .platform-badge-small {
  min-width: 20px !important;
  font-size: 0.7rem !important;
  padding: 0.25rem 0.4rem !important;
  border-radius: 3px !important;
}

.sidebar .platform-badge-small i {
  font-size: 0.65rem !important;
}

.sidebar .platform-badges-wrapper {
  display: flex;
  gap: 0.25rem;
}

/* Filter input */
#guidelineFilter {
  border-radius: var(--border-radius);
  border: 1px solid var(--border-primary);
  padding: 0.4rem 1rem;
  background-color: var(--input-bg);
}

/* Filter content scrolling */
.filter-content {
  max-height: 600px;
  overflow-y: auto;
}

.filter-content::-webkit-scrollbar {
  width: 6px;
}

.filter-content::-webkit-scrollbar-track {
  background: var(--bg-surface);
}

.filter-content::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 3px;
}

.filter-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Accordion styling */
.sidebar .accordion-button {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: none;
  padding: 1.5rem 1rem;
  font-size: 0.9rem;
}

.sidebar .accordion-button:not(.collapsed) {
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  box-shadow: none;
}

.sidebar .accordion-button:focus {
  box-shadow: none;
  border-color: transparent;
}

.sidebar .accordion-item {
  border: none;
  border-bottom: 1px solid var(--border-primary);
}

.sidebar .accordion-body {
  background: var(--bg-surface-alt);
}

/* Focus states for accessibility */
.filter-content .list-group-item:focus,
.sidebar .list-group-item:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: -2px;
}

.sidebar .list-group-item.guideline-item:focus .guideline-meta {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* =============================================================================
   GUIDELINE DETAIL PAGE
   ============================================================================= */

/* Sticky navbar for guideline detail page */
.navbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 1030 !important;
}

/* Image gallery */
.thumbnail-container {
  display: block;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-normal);
  cursor: pointer;
}

.thumbnail-container:hover {
  transform: scale(1.05);
}

.main-image-container {
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  width: 100%;
}

.main-image-container.platform-mobile_app,
.main-image-container.platform-mobile_web {
  width: 60%;
  margin-left: auto;
  margin-right: auto;
}

.guideline-score {
  padding: .5rem 0;
  margin: 1rem 0;
}

/* Wrapper layout */
.wrapper.d-flex {
  display: flex;
  min-height: calc(100vh - 60px);
  margin-top: 0;
}

.guideline-detail {
  flex: 1;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.guideline-detail-wrapper {
  flex: 1;
  display: flex;
  padding: 2rem;
  gap: 2rem;
}

.left-section {
  width: 50%;
}

.right-section {
  width: 50%;
}

/* Image actions overlay */
.image-actions {
  opacity: 0;
  transition: opacity var(--transition-normal);
  background: rgba(0, 0, 0, 0.1);
  border-radius: var(--border-radius);
}

.main-image-container:hover .image-actions {
  opacity: 1;
}

/* Download button styling */
#download-main-image-btn {
  background: rgba(33, 37, 41, 0.9);
  border: none;
  backdrop-filter: blur(4px);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

#download-main-image-btn:hover {
  background: var(--brand-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(75, 139, 244, 0.3);
}

#download-main-image-btn i {
  font-size: 0.875rem;
}

/* =============================================================================
   RESPONSIVE ADJUSTMENTS FOR SIDEBARS
   ============================================================================= */

@media (max-width: 1200px) {
  .sidebar {
    width: 300px;
    min-width: 300px;
  }
  
  .guideline-meta {
    font-size: 0.7rem;
  }
}

@media (max-width: 992px) {
  .wrapper.d-flex {
    flex-direction: column;
    min-height: auto;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    top: 0;
  }

  .guideline-detail-wrapper {
    flex-direction: column;
    padding: 1rem;
  }

  .left-section, .right-section {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .image-actions {
    opacity: 1;
    background: rgba(0, 0, 0, 0.2);
  }
  
  #download-main-image-btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
}

/* =============================================================================
   FLASH MESSAGES SYSTEM
   ============================================================================= */
.flash-messages-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1055;
  max-width: 400px;
  pointer-events: none;
}

.flash-messages-container .alert {
  pointer-events: auto;
  margin-bottom: 10px;
  box-shadow: var(--shadow-lg);
  border: none;
  border-radius: var(--border-radius);
}

.flash-messages-container.empty {
  display: none;
}

/* Global transition for smooth theme changes */
body,
.card,
.table,
.navbar,
.btn,
.form-control,
.dropdown-menu {
  transition: background-color var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal);
}


