/* ==========================================================================
   Glass Circle Navigation Design System v1.0.0
   Becchio Group LLC -- Proprietary & Confidential

   Shared CSS consumed by all GX Foundry client portals.
   All glass tokens inherit from :root CSS vars set per-client.

   Components:
     .gc-arrow       -- 40px nav back/forward circle
     .gc-toggle      -- 28px accordion expand/collapse circle
     .gc-info        -- 20px info icon circle (positioned on data tiles)
     .gc-accordion   -- collapsible section container
     .gc-info-overlay -- glass info panel with Context/Math/Sync tabs
   ========================================================================== */

/* --------------------------------------------------------------------------
   Glass Circle -- Arrow (Nav Back/Forward)
   -------------------------------------------------------------------------- */
.gc-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
  padding: 0;
  color: var(--text);
}

.gc-arrow svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.gc-arrow:hover {
  border-color: var(--glass-border-hover);
  background: var(--glass-bg-hover);
}

.gc-arrow:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Glass Circle -- Toggle (Accordion Expand/Collapse)
   -------------------------------------------------------------------------- */
.gc-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  color: var(--text);
  font-family: var(--font-body);
}

.gc-toggle::before {
  content: '+';
}

.gc-toggle.is-open {
  transform: rotate(45deg);
}

.gc-toggle:hover {
  border-color: var(--glass-border-hover);
  background: var(--glass-bg-hover);
}

.gc-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Glass Circle -- Info Icon (Data Tile Overlay Trigger)
   -------------------------------------------------------------------------- */
.gc-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
  padding: 0;
  color: var(--text-muted);
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
}

/* SVG icon injected by glass-nav.js -- no CSS text fallback */
.gc-info svg {
  width: 12px;
  height: 12px;
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

.gc-info:hover {
  border-color: var(--glass-border-hover);
  background: var(--glass-bg-hover);
}

.gc-info:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Ensure parent tile has relative positioning for .gc-info placement */
[data-info] {
  position: relative;
}

/* --------------------------------------------------------------------------
   Accordion Container
   -------------------------------------------------------------------------- */
.gc-accordion {
  width: 100%;
}

.gc-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 8px 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.gc-accordion-header:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  border-radius: 4px;
}

.gc-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease;
}

.gc-accordion-body.is-open {
  /* max-height set dynamically by JS based on content */
}

/* --------------------------------------------------------------------------
   Accordion Group -- mutual exclusion (only one open at a time)
   -------------------------------------------------------------------------- */
.gc-accordion-group .gc-accordion-body.is-open {
  /* JS handles closing siblings in a group */
}

/* --------------------------------------------------------------------------
   Glass Info Overlay
   -------------------------------------------------------------------------- */
.gc-info-overlay {
  position: fixed;
  width: 320px;
  max-width: calc(100vw - 32px);
  max-height: 80vh;
  overflow-y: auto;
  background: var(--glass-tile-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 200;
  box-shadow: var(--glass-shadow-hover);
  display: none;
}

.gc-info-overlay.is-visible {
  display: block;
}

/* Close button */
.gc-info-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition: border-color 150ms ease, background 150ms ease;
}

.gc-info-close:hover {
  border-color: var(--glass-border-hover);
  background: var(--glass-bg-hover);
}

.gc-info-close:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Overlay title */
.gc-info-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px 0;
  padding-right: 28px;
}

/* --------------------------------------------------------------------------
   Info Overlay -- Tab Strip
   -------------------------------------------------------------------------- */
.gc-info-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 12px;
}

.gc-info-tab {
  flex: 1;
  padding: 8px 4px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  transition: color 150ms ease, border-color 150ms ease;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gc-info-tab:hover {
  color: var(--text);
}

.gc-info-tab.is-active {
  color: var(--primary);
  border-bottom: 1px solid var(--primary);
}

.gc-info-tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Info Overlay -- Tab Panes
   -------------------------------------------------------------------------- */
.gc-info-pane {
  display: none;
}

.gc-info-pane.is-active {
  display: block;
}

.gc-info-pane-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px 0;
}

.gc-info-pane-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--glass-bg-subtle, rgba(255, 255, 255, 0.03));
}

.gc-info-pane-row:last-child {
  border-bottom: none;
}

.gc-info-pane-key {
  color: var(--text-muted);
  font-size: 12px;
}

.gc-info-pane-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}

/* Context tab source entries */
.gc-info-source {
  padding: 6px 0;
  border-bottom: 1px solid var(--glass-bg-subtle, rgba(255, 255, 255, 0.03));
}

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

.gc-info-source-type {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 2px;
}

.gc-info-source-value {
  font-size: 13px;
  color: var(--text);
}

.gc-info-source-date {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   Mobile Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .gc-info-overlay {
    width: calc(100vw - 32px);
    left: 16px !important;
    right: 16px;
  }

  .gc-arrow {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
  }

  .gc-toggle {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .gc-info {
    min-width: 28px;
    min-height: 28px;
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
}
