/* MoveRef Component Styles */

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-heading);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  min-height: 44px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}
.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
}
.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.btn-danger {
  background: var(--error);
  color: white;
}
.btn-danger:hover {
  background: #DC2626;
}

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover {
  background: #059669;
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  min-height: 52px;
  border-radius: var(--radius-lg);
}

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

.btn-icon {
  padding: var(--space-2);
  min-height: 40px;
  min-width: 40px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn .spinner {
  width: 16px;
  height: 16px;
  border-color: rgba(255,255,255,0.3);
  border-top-color: white;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.card-title {
  font-family: var(--font-heading);
  font-weight: var(--font-bold);
  font-size: var(--text-lg);
  color: var(--gray-900);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-style: italic;
}

.card-subtitle {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-top: var(--space-1);
}

/* Summary/stat card */
.stat-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-sm);
}

.stat-card-label {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  color: var(--gray-500);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
}

.stat-card-value {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--gray-900);
  font-style: italic;
}

.stat-card-change {
  font-size: var(--text-xs);
  margin-top: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.stat-card-change.positive { color: var(--success); }
.stat-card-change.negative { color: var(--error); }

/* ============================================
   BADGES / PILLS
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 10px;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-submitted {
  background: var(--gray-100);
  color: var(--gray-600);
}
.badge-in-progress {
  background: var(--info-light);
  color: #1D4ED8;
}
.badge-booked {
  background: var(--warning-light);
  color: #B45309;
}
.badge-completed {
  background: var(--success-light);
  color: #047857;
}
.badge-paid {
  background: var(--success-light);
  color: #047857;
}

/* B2B pipeline stage badges use dynamic colors from org config */
.badge-stage {
  padding: 2px 10px;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
}

/* ============================================
   FORM GROUPS
   ============================================ */

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-family: var(--font-heading);
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
  color: var(--gray-700);
  margin-bottom: var(--space-2);
}

.form-label .required {
  color: var(--error);
  margin-left: 2px;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--gray-400);
  margin-top: var(--space-1);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--error);
  margin-top: var(--space-1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Toggle switch */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--gray-300);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.toggle.active {
  background: var(--accent-primary);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.toggle.active::after {
  transform: translateX(20px);
}

.toggle-label {
  font-size: var(--text-sm);
  color: var(--gray-700);
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px);
  transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--gray-200);
}

.modal-title {
  font-family: var(--font-heading);
  font-weight: var(--font-semibold);
  font-size: var(--text-lg);
}

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--gray-200);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--gray-300);
  min-width: 300px;
  max-width: 420px;
  animation: slideIn var(--transition-base) ease;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--info); }

.toast-message {
  font-size: var(--text-sm);
  color: var(--gray-700);
  flex: 1;
}

.toast-close {
  color: var(--gray-400);
  padding: var(--space-1);
  cursor: pointer;
}
.toast-close:hover {
  color: var(--gray-600);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  color: var(--gray-300);
  margin-bottom: var(--space-4);
}

.empty-state-title {
  font-family: var(--font-heading);
  font-weight: var(--font-semibold);
  font-size: var(--text-lg);
  color: var(--gray-700);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  font-size: var(--text-sm);
  color: var(--gray-500);
  max-width: 360px;
  margin-bottom: var(--space-6);
}

/* ============================================
   SEARCH INPUT
   ============================================ */

.search-wrapper {
  position: relative;
}

.search-wrapper .search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}

.search-wrapper input {
  padding-left: 40px;
}

/* ============================================
   DROPDOWN
   ============================================ */

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  max-height: 240px;
  overflow-y: auto;
  display: none;
}

.dropdown-menu.active {
  display: block;
}

.dropdown-item {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.dropdown-item:hover {
  background: var(--gray-50);
}

.dropdown-item.selected {
  background: var(--accent-subtle);
  color: var(--accent-primary);
  font-weight: var(--font-medium);
}

/* ============================================
   TABS
   ============================================ */

.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: var(--space-6);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-heading);
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.tab:hover {
  color: var(--gray-700);
}

.tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

/* ============================================
   PIPELINE STAGES (premium glass cards)
   ============================================ */

.pipeline-stages {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.pipeline-stage {
  position: relative;
  padding: var(--space-5) var(--space-4) var(--space-4);
  text-align: center;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all var(--transition-fast);
  overflow: hidden;
  font-size: var(--text-xs);
  font-family: var(--font-heading);
  font-weight: var(--font-semibold);
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Colored top accent bar */
.pipeline-stage::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gray-300);
  transition: height var(--transition-fast), background var(--transition-fast);
}

.pipeline-stage:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Active state — accent bar grows, tinted background */
.pipeline-stage.active {
  color: var(--gray-800);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.pipeline-stage.active::before {
  height: 4px;
}

/* Per-stage accent bar colors */
.pipeline-stage.stage-submitted::before { background: var(--stage-submitted); }
.pipeline-stage.stage-in-progress::before { background: var(--stage-in-progress); }
.pipeline-stage.stage-booked::before { background: var(--stage-booked); }
.pipeline-stage.stage-completed::before { background: var(--stage-completed); }
.pipeline-stage.stage-paid::before { background: var(--stage-paid); }

/* Active stage tinted backgrounds */
.pipeline-stage.stage-submitted.active { background: rgba(148, 163, 184, 0.12); }
.pipeline-stage.stage-in-progress.active { background: rgba(59, 130, 246, 0.10); }
.pipeline-stage.stage-booked.active { background: rgba(245, 158, 11, 0.10); }
.pipeline-stage.stage-completed.active { background: rgba(16, 185, 129, 0.10); }
.pipeline-stage.stage-paid.active { background: rgba(16, 185, 129, 0.12); }

.pipeline-stage-count {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  display: block;
  color: var(--gray-900);
  margin-bottom: var(--space-1);
  line-height: 1;
}

@media (max-width: 768px) {
  .pipeline-stages {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .pipeline-stages {
    grid-template-columns: repeat(2, 1fr);
  }
  .pipeline-stage {
    padding: var(--space-4) var(--space-3) var(--space-3);
  }
  .pipeline-stage-count {
    font-size: var(--text-2xl);
  }
}
