/* =============================================
   Landing Page Boxes
   ============================================= */

.landing-box-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.landing-box-link:hover {
  color: inherit;
}

.landing-box {
  height: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg) !important;
  transition: var(--transition);
  overflow: hidden;
}

.landing-box:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-color);
}

.landing-box .card-content {
  padding: 2.5rem 2rem;
}

.landing-box-icon {
  display: block;
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1.25rem;
}

.landing-box .title {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.landing-box-description {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.landing-box-cta {
  display: inline-block;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
}

.landing-box-cta i {
  margin-left: 0.3rem;
  transition: var(--transition);
}

.landing-box:hover .landing-box-cta i {
  transform: translateX(4px);
}

/* =============================================
   Tab Navigation
   ============================================= */

#level-tabs .tabs {
  margin-bottom: 2rem;
}

#level-tabs .tabs ul {
  border-bottom-color: var(--border-color);
}

#level-tabs .tabs li a {
  color: var(--text-secondary);
  border-bottom-color: transparent;
  font-weight: 600;
  transition: var(--transition);
  padding: 0.75em 1.25em;
}

#level-tabs .tabs li a:hover {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background-color: var(--background-accent);
}

#level-tabs .tabs li.is-active a {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  font-weight: 700;
}

#level-tabs .tabs li a .icon {
  margin-right: 0.4em;
}

/* Tab panels */
.tab-panel {
  display: none;
  animation: fadeInUp 0.4s ease-out;
}

.tab-panel.is-active {
  display: block;
}

/* =============================================
   Section Dividers
   ============================================= */

/* =============================================
   Numbering
   ============================================= */

.section-number {
  color: var(--text-light);
  font-weight: 700;
}

.benchmark-number {
  color: var(--text-light);
  font-weight: 600;
}

/* =============================================
   Collapsible Sections
   ============================================= */

.collapsible-toggle {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.collapsible-toggle:hover {
  color: var(--primary-color) !important;
}

.collapse-icon {
  font-size: 0.75em;
  transition: transform 0.3s ease;
  display: inline-flex;
  width: 1em;
  flex-shrink: 0;
}

.collapsible.is-collapsed .collapse-icon {
  transform: rotate(-90deg);
}

.collapsible-content {
  overflow: hidden;
  max-height: 5000px;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  opacity: 1;
}

.collapsible.is-collapsed > .collapsible-content {
  max-height: 0;
  opacity: 0;
}

/* =============================================
   Section Dividers (continued)
   ============================================= */

.benchmark-section {
  margin-bottom: 3rem;
}

.benchmark-section:last-child {
  margin-bottom: 0;
}

.section-divider {
  font-family: 'Inter', sans-serif !important;
  font-weight: 700 !important;
  color: var(--text-primary);
  position: relative;
  padding-bottom: 0.75rem;
  margin-top: 1rem;
  margin-bottom: 0.75rem;
}

.section-divider::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 80px;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

.section-description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.6;
}

/* =============================================
   Subsection Dividers
   ============================================= */

.benchmark-subsection {
  margin-bottom: 2.5rem;
  margin-left: 1rem;
}

.benchmark-subsection:last-child {
  margin-bottom: 0;
}

.subsection-divider {
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  color: var(--text-secondary);
  position: relative;
  padding-bottom: 0.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.subsection-divider::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 2px;
  background: var(--primary-color);
  border-radius: 2px;
}

.subsection-description {
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* =============================================
   Benchmark Cards
   ============================================= */

.benchmark-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.benchmark-card-link:hover {
  color: inherit;
}

.benchmark-card {
  height: 100%;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg) !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.benchmark-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-color);
}

.benchmark-card .card-image {
  overflow: hidden;
}

.benchmark-card .card-image img {
  transition: var(--transition);
  object-fit: cover;
  width: 100%;
  height: 100px;
}

.benchmark-card:hover .card-image img {
  transform: scale(1.05);
}

.benchmark-card .card-content {
  flex: 1;
  padding: 1.25rem;
}

.benchmark-card .card-content .title {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-family: 'Inter', sans-serif;
}

.benchmark-card .card-content .subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: 0.75rem;
}

.benchmark-card .card-footer {
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.benchmark-card .card-footer-item {
  color: var(--primary-color);
  font-weight: 600;
  gap: 0.5rem;
  transition: var(--transition);
  padding: 0.75rem;
}

.benchmark-card:hover .card-footer-item {
  background-color: var(--background-accent);
}

/* "Other" card — dashed border style */
.benchmark-card.other-card {
  border-style: dashed;
  border-color: var(--text-light);
  background: var(--background-secondary);
}

.benchmark-card.other-card:hover {
  border-color: var(--primary-color);
  border-style: dashed;
}

.benchmark-card.other-card .card-content .title {
  color: var(--text-secondary);
}

/* Card grid spacing */
.benchmark-cards .column {
  margin-bottom: 1rem;
}

/* =============================================
   Performance Metrics Listing Tables
   ============================================= */

.benchmark-listing-table {
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
}

.benchmark-listing-table .metric-number {
  font-weight: 600;
  color: var(--text-light);
  text-align: center;
  width: 3.5rem;
}

.benchmark-listing-table .metric-name {
  font-weight: 600;
  color: var(--text-primary);
}

/* =============================================
   Sub-subsection Dividers (third level)
   ============================================= */

.benchmark-subsubsection {
  margin-bottom: 2rem;
  margin-left: 1rem;
}

.benchmark-subsubsection:last-child {
  margin-bottom: 0;
}

.subsubsection-divider {
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  color: var(--text-light);
  position: relative;
  padding-bottom: 0.4rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Placeholder image for benchmarks without images */
.benchmark-card .card-image .placeholder-image {
  width: 100%;
  height: 100px;
  background: var(--background-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 3rem;
}

/* =============================================
   Detail Page - Navigation
   ============================================= */

.benchmark-navbar {
  background: var(--background-primary);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.benchmark-navbar .navbar-item {
  color: var(--text-secondary);
  font-weight: 600;
  transition: var(--transition);
}

.benchmark-navbar .navbar-item:hover {
  color: var(--primary-color);
  background-color: var(--background-accent);
}

.benchmark-navbar .navbar-item .icon {
  margin-right: 0.4em;
}

/* =============================================
   Detail Page - Breadcrumb
   ============================================= */

.breadcrumb {
  margin-bottom: 1.5rem !important;
}

.breadcrumb a {
  color: var(--primary-color) !important;
  transition: var(--transition);
}

.breadcrumb a:hover {
  color: var(--primary-hover) !important;
}

.breadcrumb li.is-active a {
  color: var(--text-secondary) !important;
}

/* =============================================
   Detail Page - Content Sections
   ============================================= */

.detail-section {
  padding: 3rem 1.5rem;
}

.detail-section:nth-child(even) {
  background: var(--background-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.detail-section .title.is-3 {
  text-align: left;
}

.detail-section .title.is-3::after {
  left: 0;
  transform: none;
}

/* Benchmark hero image */
.benchmark-hero-image {
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 500px;
  object-fit: cover;
  width: 100%;
}

/* Procedures list */
.procedures-list {
  counter-reset: procedure;
  list-style: none;
  padding-left: 0;
}

.procedures-list li {
  counter-increment: procedure;
  padding: 1rem 1rem 1rem 3.5rem;
  position: relative;
  margin-bottom: 0.75rem;
  background: var(--background-primary);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  color: var(--text-secondary);
  line-height: 1.6;
}

.procedures-list li:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.procedures-list li::before {
  content: counter(procedure);
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 28px;
  height: 28px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Metrics table */
.metrics-table {
  border-radius: var(--border-radius) !important;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.metrics-table thead th {
  background: var(--background-accent) !important;
  color: var(--text-primary) !important;
  font-weight: 700;
  border-bottom: 2px solid var(--border-color) !important;
  padding: 1rem !important;
}

.metrics-table tbody td {
  padding: 1rem !important;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color) !important;
}

.metrics-table tbody tr:hover {
  background: var(--background-accent);
}

.metrics-table tbody td:first-child {
  font-weight: 600;
  color: var(--text-primary);
}

/* Analysis methods list */
.analysis-list {
  list-style: none;
  padding-left: 0;
}

.analysis-list li {
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  position: relative;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.analysis-list li::before {
  content: '\f0c8';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 0.75rem;
  color: var(--primary-color);
  font-size: 0.5rem;
  top: 1.1rem;
}

/* =============================================
   Loading State
   ============================================= */

.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4rem;
  color: var(--text-light);
}

.loading-spinner .icon {
  animation: spin 1s linear infinite;
  font-size: 2rem;
  margin-right: 1rem;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Coming soon state */
.coming-soon {
  text-align: center;
  padding: 4rem 2rem;
}

.coming-soon > .icon {
  font-size: 4rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  display: block;
}

.coming-soon .title {
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.coming-soon .subtitle {
  color: var(--text-secondary);
}

/* Not found state */
.not-found {
  text-align: center;
  padding: 4rem 2rem;
}

.not-found .icon {
  font-size: 4rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.not-found .title {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.not-found .subtitle {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* =============================================
   Responsive Adjustments
   ============================================= */

@media screen and (max-width: 768px) {
  #level-tabs .tabs li a {
    padding: 0.5em 0.75em;
    font-size: 0.85rem;
  }

  #level-tabs .tabs li a .icon {
    margin-right: 0.2em;
  }

  /* Hide tab text on very small screens, show only icons */
  #level-tabs .tabs li a span:not(.icon) {
    display: none;
  }

  .benchmark-card .card-image img {
    height: 80px;
  }

  .procedures-list li {
    padding-left: 3rem;
  }

  .detail-section {
    padding: 2rem 1rem;
  }
}

@media screen and (min-width: 769px) {
  #level-tabs .tabs li a span:not(.icon) {
    display: inline;
  }
}

@media screen and (max-width: 480px) {
  .benchmark-card .card-image img {
    height: 70px;
  }

  .benchmark-card .card-content {
    padding: 1rem;
  }

  .benchmark-card .card-content .title {
    font-size: 1rem;
  }
}
