/* Labs Layout Styles */

body.labs main {
  width: 95%;
  max-width: 95%;
}

/* Activity Squares (moved from global.css) */
.activity-block {
  display: flex;
  max-width: calc(17px * 7);
  flex-wrap: wrap;
}

.activity-square {
  width: 14px;
  height: 14px;
  margin: 1px;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.activity-square.empty {
  opacity: 0.4;
}

/* Dashboard Stats Header */
.labs-stats-header {
  width: inherit;
  max-width: inherit;
  display: flex;
  gap: 2rem;
  align-items: baseline;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.labs-stat {
  display: flex;
  flex-direction: column;
}

.labs-stat-value {
  font-family: var(--font-stack-monospace);
  font-size: 1.5rem;
  font-weight: 600;
}

.labs-stat-label {
  font-family: var(--font-stack-sans-serif);
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.labs-stat.is-small .labs-stat-value {
  font-size: 1rem;
}

.labs-stat.is-small .labs-stat-label {
  font-size: 0.65rem;
}

/* Dashboard Activity */
.labs-activity-group {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.labs-activity {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.labs-activity-label {
  font-family: var(--font-stack-sans-serif);
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.6);
}

/* Dashboard Funnel (Progress Bar Style) */
.labs-funnel-bar {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.01);
}

.labs-funnel-bar-title {
  font-family: var(--font-stack-sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: rgba(0, 0, 0, 0.7);
}

.labs-funnel-bar-track {
  position: relative;
  height: 28px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.labs-funnel-bar-segment {
  position: absolute;
  left: 0;
  top: 0;
  min-width: 6px;
  height: 100%;
  background: rgba(59, 130, 246, 0.35);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  transition: width 0.3s ease;
}

.labs-funnel-bar-label {
  font-family: var(--font-stack-sans-serif);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(0, 0, 0, 0.6);
}

.labs-funnel-bar-value {
  font-family: var(--font-stack-monospace);
  font-size: 1rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

.labs-funnel-bar-segment.is-engaged {
  background: rgba(16, 185, 129, 0.45);
}

.labs-funnel-bar-segment.is-paying {
  background: rgba(139, 92, 246, 0.55);
  border-right: none;
}

.labs-funnel-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.6rem;
}

.labs-funnel-bar-legend-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

/* Dashboard Alerts */
.labs-alerts {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.labs-alert {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-family: var(--font-stack-sans-serif);
  font-size: 0.85rem;
  text-decoration: none;
}

.labs-alert.is-warning {
  background: #fff3cd;
  color: #856404;
}

.labs-alert.is-danger {
  background: #f8d7da;
  color: #721c24;
}

.labs-alert.is-success {
  background: #d4edda;
  color: #155724;
}


.labs-container {
  display: flex;
  gap: 2rem;
  min-height: 60vh;
}

.labs-nav {
  flex-shrink: 0;
  width: 200px;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  padding-right: 2rem;
}

.labs-nav nav {
  position: sticky;
  top: 1rem;
}

.labs-nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: rgba(0, 0, 0, 0.7);
  text-decoration: none;
  font-family: var(--font-stack-sans-serif);
  font-size: 0.9rem;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.labs-nav a:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.9);
}

.labs-nav a.active {
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  font-weight: 500;
}

.labs-nav details {
  margin-top: 0.5rem;
}

.labs-nav summary {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-family: var(--font-stack-sans-serif);
  font-size: 0.9rem;
  color: rgba(0, 0, 0, 0.7);
  list-style: none;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.labs-nav summary::-webkit-details-marker {
  display: none;
}

.labs-nav summary:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.9);
}

.labs-nav details[open] summary {
  margin-bottom: 0.25rem;
}

.labs-nav details a {
  padding-left: 1.5rem;
  font-size: 0.85rem;
}

.labs-content {
  flex-grow: 1;
  min-width: 0;
}

.labs-message-box {
  background: rgba(0, 0, 0, 0.04);
  color: rgba(0, 0, 0, 0.85);
}

.labs-breadcrumb {
  width: inherit;
  max-width: inherit;
  font-family: var(--font-stack-monospace);
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.5);
  margin-bottom: 1.5rem;
}

.labs-breadcrumb a {
  color: rgba(0, 0, 0, 0.5);
  text-decoration: none;
}

.labs-breadcrumb a:hover {
  color: rgba(0, 0, 0, 0.8);
}

.labs-breadcrumb .separator {
  margin: 0 0.5rem;
}

@media (max-width: 768px) {
  .funnel-arrow {
    transform: rotate(90deg);
    margin: 1rem 0;
  }

  .labs-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .labs-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-right: 0;
    padding-bottom: 1rem;
  }
  
  .labs-nav nav {
    position: static;
  }
  
  body.labs main {
    width: 90%;
    max-width: var(--max-width);
  }
}

@media (prefers-color-scheme: dark) {
  .labs-nav {
    border-right-color: rgba(255, 255, 255, 0.1);
  }
  
  .labs-nav a {
    color: rgba(255, 255, 255, 0.7);
  }
  
  .labs-nav a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
  }
  
  .labs-nav a.active {
    background-color: rgba(255, 255, 255, 0.9);
    color: black;
  }
  
  .labs-nav summary {
    color: rgba(255, 255, 255, 0.7);
  }
  
  .labs-nav summary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
  }
  
  .labs-breadcrumb,
  .labs-breadcrumb a {
    color: rgba(255, 255, 255, 0.5);
  }
  
  .labs-breadcrumb a:hover {
    color: rgba(255, 255, 255, 0.8);
  }

  .labs-message-box {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
  }

  /* Dashboard dark mode */
  .labs-stats-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  .labs-stat-label {
    color: rgba(255, 255, 255, 0.5);
  }

  .labs-activity-label {
    color: rgba(255, 255, 255, 0.6);
  }

  .labs-stat-value {
    color: rgba(255, 255, 255, 0.9);
  }

  .activity-square {
    border-color: rgba(255, 255, 255, 0.1);
  }

  .labs-funnel-bar {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.01);
  }

  .labs-funnel-bar-title {
    color: rgba(255, 255, 255, 0.7);
  }

  .labs-funnel-bar-track {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .labs-funnel-bar-segment {
    background: rgba(96, 165, 250, 0.8);
    border-right-color: rgba(255, 255, 255, 0.08);
  }

  .labs-funnel-bar-segment.is-engaged {
    background: rgba(52, 211, 153, 0.85);
  }

  .labs-funnel-bar-segment.is-paying {
    background: rgba(167, 139, 250, 0.9);
    border-right: none;
  }

  .labs-funnel-bar-label {
    color: rgba(255, 255, 255, 0.6);
  }

  .labs-funnel-bar-value {
    color: rgba(255, 255, 255, 0.9);
  }

  .labs-alert.is-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
  }

  .labs-alert.is-danger {
    background: rgba(220, 53, 69, 0.2);
    color: #f8d7da;
  }

  .labs-alert.is-success {
    background: rgba(40, 167, 69, 0.2);
    color: #d4edda;
  }

  
  @media (max-width: 768px) {
    .labs-nav {
      border-bottom-color: rgba(255, 255, 255, 0.1);
    }
  }
}

/* Details/Summary Enhancements */
details summary {
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary .ph-caret-right {
  display: inline-block;
  transition: transform 0.2s ease;
}

details[open] summary .ph-caret-right {
  transform: rotate(90deg);
}
