/* ============================================
   PULSEFLOW — Base & Global Styles
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 16px;
}

body {
  font-family: var(--pf-sans);
  background-color: var(--pf-bg);
  color: var(--pf-text-primary);
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--pf-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--pf-border);
  border-radius: var(--pf-radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--pf-border-hover);
}

/* Focus States (Rule 17) */
:focus-visible {
  outline: 2px solid var(--pf-accent);
  outline-offset: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--pf-duration) var(--pf-ease);
}

ul, ol {
  list-style: none;
}

button {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--pf-max-width);
  margin: 0 auto;
  padding: 0 var(--pf-6);
}

/* Typography elements */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
}

p {
  color: var(--pf-text-secondary);
  line-height: 1.6;
  max-width: 70ch;
}

/* Reusable UI Components */
/* Buttons: 44px min height (Rule 25 design language) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--pf-2);
  min-height: 44px;
  padding: 0 var(--pf-5);
  font-size: var(--pf-text-sm);
  font-weight: 500;
  border-radius: var(--pf-radius-md);
  transition: all var(--pf-duration) var(--pf-ease);
  white-space: nowrap;
}

.btn--primary {
  background: var(--pf-text-primary);
  color: var(--pf-bg);
  border: 1px solid var(--pf-text-primary);
}
.btn--primary:hover {
  background: transparent;
  color: var(--pf-text-primary);
}

.btn--secondary {
  background: var(--pf-surface);
  color: var(--pf-text-primary);
  border: 1px solid var(--pf-border);
}
.btn--secondary:hover {
  background: var(--pf-surface-hover);
  border-color: var(--pf-border-hover);
}

.btn--accent {
  background: var(--pf-accent);
  color: #FFFFFF;
}
.btn--accent:hover {
  background: var(--pf-accent-hover);
}

.btn--icon {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: var(--pf-radius-sm);
  background: transparent;
  border: 1px solid var(--pf-border);
  color: var(--pf-text-secondary);
  transition: all var(--pf-duration) var(--pf-ease);
}
.btn--icon:hover {
  background: var(--pf-surface-hover);
  color: var(--pf-text-primary);
  border-color: var(--pf-border-hover);
}

/* Card layout */
.card {
  background: var(--pf-surface);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-lg);
  padding: var(--pf-6);
  transition: border-color var(--pf-duration) var(--pf-ease), transform var(--pf-duration) var(--pf-ease);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--pf-1);
  padding: var(--pf-1) var(--pf-2);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--pf-radius-full);
}
.badge--success { background: var(--pf-success-bg); color: var(--pf-success); }
.badge--warning { background: var(--pf-warning-bg); color: var(--pf-warning); }
.badge--danger { background: var(--pf-danger-bg); color: var(--pf-danger); }
.badge--info { background: var(--pf-info-bg); color: var(--pf-info); }

/* Skeleton loaders (Rule 25 performance/loading state) */
.skeleton {
  background: linear-gradient(90deg, var(--pf-surface) 25%, var(--pf-surface-hover) 50%, var(--pf-surface) 75%);
  background-size: 200% 100%;
  animation: loading-skeleton 1.5s infinite;
  border-radius: var(--pf-radius-sm);
}

.skeleton--text { height: 16px; width: 100%; margin-bottom: 8px; }
.skeleton--title { height: 24px; width: 60%; margin-bottom: 16px; }
.skeleton--rect { height: 120px; width: 100%; }

@keyframes loading-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty State styling (Rule 25 UX) */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--pf-12) var(--pf-6);
  border: 1px dashed var(--pf-border);
  border-radius: var(--pf-radius-lg);
  background: var(--pf-surface-alt);
}
.empty-state__icon {
  width: 48px;
  height: 48px;
  color: var(--pf-text-tertiary);
  margin-bottom: var(--pf-4);
}
.empty-state__title {
  font-size: var(--pf-text-lg);
  margin-bottom: var(--pf-2);
  color: var(--pf-text-primary);
}
.empty-state__desc {
  font-size: var(--pf-text-sm);
  color: var(--pf-text-secondary);
  max-width: 320px;
  margin-bottom: var(--pf-6);
}

/* Accessibility: skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--pf-accent);
  color: white;
  padding: 10px 20px;
  z-index: 1000;
  border-radius: var(--pf-radius-sm);
  transition: top var(--pf-duration) var(--pf-ease);
}
.skip-link:focus {
  top: 20px;
}
