/* ==========================================================================
   ACCELFLOWSYSTEMS DESIGN SYSTEM - COMPONENTS
   ========================================================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 46px;
  padding: 0 var(--space-5);
  font-size: var(--text-body);
  font-weight: 500;
  border-radius: var(--radius-button);
  white-space: nowrap;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--accent);
  color: var(--white);
  border: 1px solid var(--accent);
  box-shadow: 0 1px 2px rgba(49, 92, 255, 0.2);
}

.btn-primary:hover {
  background-color: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn-secondary {
  background-color: var(--white);
  color: var(--ink-900);
  border: var(--border-mid);
  box-shadow: var(--shadow-subtle);
}

.btn-secondary:hover {
  background-color: var(--slate-100);
  border-color: var(--slate-300);
  color: var(--ink-950);
}

.btn-dark {
  background-color: var(--ink-900);
  color: var(--white);
  border: 1px solid var(--ink-800);
}

.btn-dark:hover {
  background-color: var(--ink-800);
  border-color: var(--ink-700);
}

.btn-tertiary {
  background: transparent;
  color: var(--ink-900);
  padding: 0 var(--space-2);
  height: auto;
}

.btn-tertiary:hover {
  color: var(--accent);
}

.btn-sm {
  height: 36px;
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
}

.btn-lg {
  height: 52px;
  padding: 0 var(--space-6);
  font-size: var(--text-body-lg);
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  line-height: 1.2;
}

.badge-neutral {
  background: var(--slate-100);
  color: var(--slate-600);
  border-color: var(--slate-200);
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-color: rgba(49, 92, 255, 0.2);
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(24, 134, 91, 0.2);
}

.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: rgba(166, 106, 0, 0.2);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(197, 58, 58, 0.2);
}

/* Status Dot */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot-success { background-color: var(--success); }
.status-dot-warning { background-color: var(--warning); }
.status-dot-danger  { background-color: var(--danger); }
.status-dot-neutral { background-color: var(--slate-400); }

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(250, 251, 252, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--border-light);
  height: 72px;
  display: flex;
  align-items: center;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: var(--border-mid);
  box-shadow: 0 1px 4px rgba(17, 21, 26, 0.03);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  line-height: 1;
}

/* Precision Text Brand Logo */
.brand-text-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  text-decoration: none;
}

.brand-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--ink-950);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.04em;
  position: relative;
  box-shadow: 0 2px 4px rgba(11, 13, 16, 0.08);
  flex-shrink: 0;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.brand-glyph .glyph-char {
  color: var(--white);
}

.brand-glyph .glyph-node {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  background-color: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(49, 92, 255, 0.8);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink-950);
  white-space: nowrap;
}

.brand-title .brand-flow {
  color: var(--accent);
  font-weight: 700;
}

.brand-title .brand-systems {
  color: var(--ink-800);
  font-weight: 500;
}

/* Footer / Dark mode logo adjustments */
.site-footer .brand-glyph {
  background: var(--ink-900);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.site-footer .brand-title {
  color: var(--white);
}

.site-footer .brand-title .brand-systems {
  color: var(--slate-300);
}

.logo-link:hover .brand-glyph {
  transform: translateY(-1px);
}


.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}

.nav-item {
  position: relative;
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--slate-600);
  padding: var(--space-2) 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link:hover, .nav-link.active {
  color: var(--ink-950);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: var(--white);
  border: var(--border-mid);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-panel);
  padding: var(--space-2);
  display: none;
  z-index: var(--z-dropdown);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.nav-item:hover .dropdown-menu,
.nav-item:focus-within .dropdown-menu {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--slate-600);
  font-size: var(--text-sm);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.dropdown-item:hover {
  background-color: var(--slate-100);
  color: var(--ink-950);
}

.dropdown-item-title {
  font-weight: 500;
  color: var(--ink-950);
}

.dropdown-item-desc {
  font-size: var(--text-xs);
  color: var(--slate-500);
  margin-top: 2px;
}

.header-cta-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-button);
  border: var(--border-light);
  color: var(--ink-900);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  z-index: var(--z-drawer);
  padding: var(--space-6) var(--space-5);
  overflow-y: auto;
  flex-direction: column;
  gap: var(--space-4);
  border-top: var(--border-light);
}

.mobile-menu.is-open {
  display: flex;
}

/* Cards & Panels */
.card {
  background: var(--white);
  border: var(--border-light);
  border-radius: var(--radius-card);
  padding: var(--space-6);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
}

.card:hover {
  border-color: var(--slate-300);
}

.card-dark {
  background: var(--ink-900);
  border-color: rgba(255, 255, 255, 0.08);
}

.card-dark:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.feature-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--space-6);
  background: var(--white);
  border: var(--border-light);
  border-radius: var(--radius-card);
}

.feature-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--slate-100);
  border: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  color: var(--accent);
}

.feature-card h3 {
  margin-bottom: var(--space-2);
}

.metric-card {
  background: var(--white);
  border: var(--border-light);
  border-radius: var(--radius-card);
  padding: var(--space-5);
}

.metric-card-number {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink-950);
  line-height: 1.1;
  margin-bottom: var(--space-1);
}

.metric-card-label {
  font-size: var(--text-sm);
  color: var(--slate-500);
  font-weight: 500;
}

/* Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  border: var(--border-light);
  border-radius: var(--radius-card);
  background: var(--white);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--text-sm);
}

.data-table th {
  background: var(--slate-100);
  color: var(--slate-600);
  font-weight: 600;
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-light);
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-light);
  color: var(--ink-900);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background-color: rgba(238, 241, 243, 0.5);
  cursor: pointer;
}

/* Tabs */
.tabs-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-bottom: var(--border-light);
  padding-bottom: 2px;
  overflow-x: auto;
}

.tab-btn {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--slate-500);
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--ink-900);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab-pane {
  display: none;
  padding-top: var(--space-4);
}

.tab-pane.active {
  display: block;
}

/* Accordion */
.accordion-group {
  border-top: var(--border-light);
}

.accordion-item {
  border-bottom: var(--border-light);
}

.accordion-trigger {
  width: 100%;
  text-align: left;
  padding: var(--space-5) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink-950);
  cursor: pointer;
}

.accordion-trigger:hover {
  color: var(--accent);
}

.accordion-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform var(--transition-normal);
  color: var(--slate-400);
}

.accordion-item.is-open .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  display: none;
  padding-bottom: var(--space-5);
  color: var(--slate-600);
  font-size: var(--text-body);
  line-height: var(--leading-relaxed);
}

.accordion-item.is-open .accordion-content {
  display: block;
}

/* Forms */
.form-group {
  margin-bottom: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-950);
}

.form-control {
  width: 100%;
  height: 44px;
  padding: 0 var(--space-3);
  font-size: var(--text-body);
  border: var(--border-mid);
  border-radius: var(--radius-button);
  background: var(--white);
  color: var(--ink-950);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea.form-control {
  height: auto;
  min-height: 120px;
  padding: var(--space-3);
  resize: vertical;
}

/* Modals & Drawers */
.drawer-backdrop, .modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 13, 16, 0.45);
  backdrop-filter: blur(4px);
  z-index: var(--z-drawer);
  display: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.drawer-backdrop.is-visible, .modal-backdrop.is-visible {
  display: block;
  opacity: 1;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 580px;
  background: var(--white);
  z-index: calc(var(--z-drawer) + 1);
  box-shadow: var(--shadow-drawer);
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 10;
}

.drawer-body {
  padding: var(--space-6);
  flex: 1;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  position: relative;
  border-left: 2px solid var(--slate-200);
  margin-left: 12px;
  padding-left: var(--space-4);
  gap: var(--space-5);
}

.timeline-item {
  position: relative;
}

.timeline-dot {
  position: absolute;
  left: calc(-1 * var(--space-4) - 6px);
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--accent);
}

.timeline-date {
  font-size: var(--text-xs);
  color: var(--slate-400);
  font-weight: 500;
}

.timeline-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-950);
}

.timeline-desc {
  font-size: var(--text-sm);
  color: var(--slate-600);
  margin-top: 2px;
}

/* Footer */
.site-footer {
  background: var(--ink-950);
  color: var(--slate-300);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: var(--space-16);
  padding-bottom: var(--space-12);
  margin-top: auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: var(--space-8);
  margin-bottom: var(--space-16);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.footer-col-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--white);
  margin-bottom: var(--space-4);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-link {
  font-size: var(--text-sm);
  color: var(--slate-400);
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--slate-500);
  flex-wrap: wrap;
  gap: var(--space-4);
}
