/*
 * Component library. Each component style is encapsulated to avoid global
 * side‑effects. Only classes prefixed with a descriptive name are defined
 * here. These components rely on the design tokens and base styles
 * imported earlier. They’re intentionally minimalist so they can be
 * composed together in different contexts.
 */
/* Icon button */
.icon-button {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-round);
  background: var(--color-muted-light);
  /* Accent border to bring the neon palette into icons */
  border: 1px solid var(--color-neon-4);
  color: var(--color-silver);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: background var(--duration-fast) var(--easing),
    color var(--duration-fast) var(--easing);
}
.icon-button:hover,
.icon-button:focus {
  background: var(--color-muted);
  color: var(--color-neon-3);
}

/* 3D card for case studies and service items */
.card-3d {
  position: relative;
  background: var(--color-muted-light);
  color: var(--text-on-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
  /* Subtle accent border draws from the neon palette */
  border: 1px solid var(--color-neon-5);
  transform-style: preserve-3d;
  transition: transform var(--duration-medium) var(--easing),
    box-shadow var(--duration-medium) var(--easing);
  will-change: transform, box-shadow;
}
.card-3d:hover {
  transform: translateZ(20px) rotateX(4deg) rotateY(-4deg);
  box-shadow: var(--shadow-lg);
}

/* Glass panel – semi-transparent surface with subtle blur on desktop */
.glass-panel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(4px);
  padding: var(--space-5);
  color: var(--text-on-dark);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 600px) {
  .glass-panel {
    backdrop-filter: none;
    background: rgba(255, 255, 255, 0.02);
  }
}

/* Tabs and segmented control */
.tabs {
  display: flex;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-muted-light);
}
.tabs button {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: none;
  color: var(--color-silver);
  font-weight: 500;
  transition: background var(--duration-fast) var(--easing),
    color var(--duration-fast) var(--easing);
}
.tabs button.active {
  background: var(--color-muted);
  color: var(--color-neon-3);
}
.tabs button:hover,
.tabs button:focus {
  background: var(--color-muted);
  color: var(--color-neon-2);
}

/* Accordion */
.accordion {
  border-top: 1px solid var(--color-muted-light);
}
.accordion-item {
  border-bottom: 1px solid var(--color-muted-light);
}
.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) 0;
  cursor: pointer;
  color: var(--color-neon-5);
  font-weight: 500;
}
.accordion-header:hover {
  color: var(--color-neon-3);
}
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-medium) var(--easing);
  padding-bottom: 0;
}
.accordion-item.open .accordion-content {
  max-height: 600px; /* large enough to accommodate content */
  padding-bottom: var(--space-4);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: var(--space-8);
}
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc(var(--space-3) + 1px);
  width: 2px;
  height: 100%;
  background: var(--color-muted-light);
}
.timeline-event {
  position: relative;
  margin-bottom: var(--space-5);
}
.timeline-event:last-child {
  margin-bottom: 0;
}
.timeline-event::before {
  content: '';
  position: absolute;
  left: -1.25rem;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-neon-5);
  box-shadow: 0 0 0 4px rgba(50, 214, 240, 0.3);
}
.timeline-event-title {
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-neon-5);
}
.timeline-event-content {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: var(--space-7);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-muted);
  color: var(--text-on-dark);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-medium) var(--easing),
    transform var(--duration-medium) var(--easing);
  z-index: 1000;
}
.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) translateZ(30px);
}

/* Modal / side panel */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-medium) var(--easing);
  z-index: 800;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateZ(-280px) scale(0.98);
  background: var(--color-muted-light);
  color: var(--text-on-dark);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: transform var(--duration-slow) var(--easing),
    opacity var(--duration-medium) var(--easing);
  z-index: 900;
}
.modal.active {
  transform: translate(-50%, -50%) translateZ(0) scale(1);
  opacity: 1;
}

/* Form fields */
.form-field {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-4);
}
.form-field label {
  margin-bottom: var(--space-1);
  font-size: 0.875rem;
  color: var(--color-silver);
}
.form-field input,
.form-field textarea,
.form-field select {
  background: var(--color-muted-light);
  border: 1px solid var(--color-muted);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  color: var(--text-on-dark);
  resize: vertical;
  min-height: 40px;
  transition: border-color var(--duration-fast) var(--easing),
    box-shadow var(--duration-fast) var(--easing);
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--color-neon-3);
  box-shadow: 0 0 0 3px rgba(50, 214, 240, 0.2);
}
.form-field .error {
  color: var(--color-danger);
  font-size: 0.75rem;
  margin-top: var(--space-1);
}

/* KPI mini widgets */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.kpi-card {
  background: var(--color-muted-light);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-medium) var(--easing);
  /* Neon accent bar for KPI cards */
  border-left: 4px solid var(--color-neon-2);
}
.kpi-card:hover {
  transform: translateY(-4px);
}
.kpi-card .kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-round);
  background: var(--color-octane);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--color-neon-3);
}
.kpi-card .kpi-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-neon-5);
}
.kpi-card .kpi-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Badge and Tag */
.badge,
.tag {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-round);
  font-size: 0.75rem;
  font-weight: 500;
}
.badge {
  background: var(--color-neon-5);
  color: var(--color-anthracite);
  border: 1px solid var(--color-neon-2);
}
.tag {
  background: var(--color-muted-light);
  color: var(--color-silver);
  border: 1px solid var(--color-neon-5);
}
