/**
 * AgentReady Brand Styles
 * Based on official brand guidelines
 * 
 * Colors:
 * - Agent Dark: #0a0a0a (background)
 * - Agent Dark Alt: #161616 (cards)
 * - Agent Blue: #7c5cff (primary)
 * - Agent Blue Deep: #6d28d9 (hover)
 * - Agent Teal: #a78bfa (secondary)
 * - Success: #22C55E
 * - Warning: #F59E0B
 * - Error: #EF4444
 */

:root {
  /* Background / Surface */
  --agent-dark: #0a0a0a;
  --agent-dark-alt: #161616;
  
  /* Primary Accent (Blue) */
  --agent-blue: #7c5cff;
  --agent-blue-deep: #6d28d9;
  
  /* Secondary Accent (Teal) */
  --agent-teal: #a78bfa;
  
  /* Text */
  --agent-text-primary: #FFFFFF;
  --agent-text-secondary: #B6C0E0;
  --agent-text-muted: #7B86B2;
  
  /* Utility Colors */
  --agent-success: #22C55E;
  --agent-warning: #F59E0B;
  --agent-error: #EF4444;

  /* Polaris Typescale Tokens - 4px grid aligned */
  /* Heading Typescale */
  --polaris-heading-large-font-size: 2rem;      /* 32px */
  --polaris-heading-large-line-height: 2.5rem;  /* 40px */
  --polaris-heading-large-font-weight: 600;
  
  --polaris-heading-medium-font-size: 1.5rem;   /* 24px */
  --polaris-heading-medium-line-height: 2rem;    /* 32px */
  --polaris-heading-medium-font-weight: 600;
  
  --polaris-heading-small-font-size: 1.125rem;  /* 18px */
  --polaris-heading-small-line-height: 1.5rem;  /* 24px */
  --polaris-heading-small-font-weight: 600;
  
  /* Body Typescale */
  --polaris-body-base-font-size: 1rem;          /* 16px */
  --polaris-body-base-line-height: 1.5rem;      /* 24px */
  --polaris-body-base-font-weight: 400;
  
  --polaris-body-small-font-size: 0.875rem;     /* 14px */
  --polaris-body-small-line-height: 1.25rem;    /* 20px */
  --polaris-body-small-font-weight: 400;

  /* Polaris Depth Tokens - Shadows */
  --polaris-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --polaris-shadow-base: 0 2px 4px rgba(0, 0, 0, 0.1);
  --polaris-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
  --polaris-shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
  --polaris-shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.18);
  
  /* Polaris Depth Tokens - Bevels (for buttons) */
  --polaris-bevel-primary: inset 0 1px 0 0 rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.1);
  --polaris-bevel-pressed: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  
  /* Polaris Depth Tokens - Lighting */
  --polaris-brightness-normal: 1;
  --polaris-brightness-hover: 1.05;
  --polaris-brightness-active: 0.95;
  --polaris-brightness-selected: 1.08;
  
  /* Polaris Depth Tokens - Z-index Layers */
  --polaris-z-background: 0;
  --polaris-z-card: 1;
  --polaris-z-dropdown: 2;
  --polaris-z-modal: 3;
  --polaris-z-navigation: -1;
}

/* Brand-specific grade colors */
.agent-grade-a {
  color: var(--agent-success);
}

.agent-grade-b {
  color: var(--agent-blue);
}

.agent-grade-c {
  color: var(--agent-warning);
}

.agent-grade-d {
  color: var(--agent-error);
}

/* Brand score display */
.agent-score-display {
  font-weight: 700;
  line-height: 1;
}

.agent-score-large {
  font-size: 5rem;
}

.agent-score-medium {
  font-size: 2rem;
}

/* Brand cards */
.agent-card {
  background: var(--agent-dark-alt);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid rgba(124, 92, 255, 0.1);
}

.agent-card:hover {
  border-color: rgba(124, 92, 255, 0.3);
}

/* Brand progress bars */
.agent-progress {
  background: var(--agent-dark-alt);
  border-radius: 4px;
  overflow: hidden;
}

.agent-progress-fill {
  background: linear-gradient(90deg, var(--agent-blue) 0%, var(--agent-teal) 100%);
  height: 100%;
  transition: width 0.3s ease;
}

/* Brand badges */
.agent-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
}

.agent-badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--agent-success);
}

.agent-badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--agent-warning);
}

.agent-badge-error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--agent-error);
}

.agent-badge-info {
  background: rgba(124, 92, 255, 0.15);
  color: var(--agent-blue);
}

/* Brand text styles */
.agent-text-primary {
  color: var(--agent-text-primary);
}

.agent-text-secondary {
  color: var(--agent-text-secondary);
}

.agent-text-muted {
  color: var(--agent-text-muted);
}

/* Brand logo container */
.agent-logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.agent-logo {
  height: 32px;
  width: auto;
}

.agent-logo-icon {
  height: 24px;
  width: 24px;
}

/* Brand button overrides */
.agent-button-primary {
  background: var(--agent-blue);
  color: var(--agent-text-primary);
  border: none;
}

.agent-button-primary:hover {
  background: var(--agent-blue-deep);
}

/* Brand chart colors */
.agent-chart-bar-a {
  background: var(--agent-success);
}

.agent-chart-bar-b {
  background: var(--agent-blue);
}

.agent-chart-bar-c {
  background: var(--agent-warning);
}

.agent-chart-bar-d {
  background: var(--agent-error);
}

/* Polaris Typescale Utilities */
.polaris-heading-large {
  font-size: var(--polaris-heading-large-font-size);
  line-height: var(--polaris-heading-large-line-height);
  font-weight: var(--polaris-heading-large-font-weight);
}

.polaris-heading-medium {
  font-size: var(--polaris-heading-medium-font-size);
  line-height: var(--polaris-heading-medium-line-height);
  font-weight: var(--polaris-heading-medium-font-weight);
}

.polaris-heading-small {
  font-size: var(--polaris-heading-small-font-size);
  line-height: var(--polaris-heading-small-line-height);
  font-weight: var(--polaris-heading-small-font-weight);
}

.polaris-body-base {
  font-size: var(--polaris-body-base-font-size);
  line-height: var(--polaris-body-base-line-height);
  font-weight: var(--polaris-body-base-font-weight);
}

.polaris-body-small {
  font-size: var(--polaris-body-small-font-size);
  line-height: var(--polaris-body-small-line-height);
  font-weight: var(--polaris-body-small-font-weight);
}

/* Polaris Depth Utilities - Shadows */
.polaris-shadow-sm {
  box-shadow: var(--polaris-shadow-sm);
}

.polaris-shadow-base {
  box-shadow: var(--polaris-shadow-base);
}

.polaris-shadow-md {
  box-shadow: var(--polaris-shadow-md);
}

.polaris-shadow-lg {
  box-shadow: var(--polaris-shadow-lg);
}

.polaris-shadow-xl {
  box-shadow: var(--polaris-shadow-xl);
}

/* Polaris Depth Utilities - Cards */
.polaris-card {
  background: white;
  border-radius: 8px;
  box-shadow: var(--polaris-shadow-sm);
  border: 1px solid #E1E3E5;
  position: relative;
  z-index: var(--polaris-z-card);
}

.polaris-card:hover {
  box-shadow: var(--polaris-shadow-base);
}

/* Polaris Depth Utilities - Buttons with Bevels */
.polaris-button-primary {
  background: var(--agent-blue);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--polaris-bevel-primary);
  position: relative;
  z-index: var(--polaris-z-card);
}

.polaris-button-primary:hover {
  background: var(--agent-blue-deep);
  filter: brightness(var(--polaris-brightness-hover));
  box-shadow: var(--polaris-shadow-base);
}

.polaris-button-primary:active {
  filter: brightness(var(--polaris-brightness-active));
  box-shadow: var(--polaris-bevel-pressed);
  transform: translateY(1px);
}

.polaris-button-secondary {
  background: white;
  color: var(--agent-blue);
  border: 1px solid rgba(124, 92, 255, 0.3);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--polaris-shadow-sm);
}

.polaris-button-secondary:hover {
  background: rgba(124, 92, 255, 0.05);
  border-color: rgba(124, 92, 255, 0.4);
  box-shadow: var(--polaris-shadow-base);
}

.polaris-button-secondary:active {
  filter: brightness(var(--polaris-brightness-active));
  box-shadow: var(--polaris-bevel-pressed);
}

/* Polaris Depth Utilities - Interactive Elements */
.polaris-interactive {
  transition: all 0.2s ease;
  cursor: pointer;
}

.polaris-interactive:hover {
  filter: brightness(var(--polaris-brightness-hover));
}

.polaris-interactive:active {
  filter: brightness(var(--polaris-brightness-active));
}

.polaris-interactive-selected {
  filter: brightness(var(--polaris-brightness-selected));
  box-shadow: var(--polaris-shadow-base);
}

/* Polaris Spacing - 4px Grid */
.polaris-spacing-xs { margin: 0.25rem; padding: 0.25rem; }  /* 4px */
.polaris-spacing-sm { margin: 0.5rem; padding: 0.5rem; }    /* 8px */
.polaris-spacing-base { margin: 1rem; padding: 1rem; }     /* 16px */
.polaris-spacing-md { margin: 1.5rem; padding: 1.5rem; }    /* 24px */
.polaris-spacing-lg { margin: 2rem; padding: 2rem; }       /* 32px */
.polaris-spacing-xl { margin: 3rem; padding: 3rem; }       /* 48px */

/* -----------------------------------------------------------------------
 * Interactive baseline (cursor + tactile active-press).
 *
 * Tailwind v4 dropped the default `cursor: pointer` on <button>. Without
 * a global rule every button across the app loses its hand cursor on
 * hover — the kind of subtle wrongness that makes a web app feel like
 * a wireframe.
 *
 * These rules live here in brand.css (a static file loaded via <link>
 * from app/root.jsx) rather than in app/styles/dashboard.css because
 * brand.css is NOT processed by Vite and has no content-hash filename.
 * Adding rules to dashboard.css changed its hash, which on Vercel
 * appeared to poison the build cache so /assets/dashboard-XXX.css
 * returned 404 from the function fallback after deploy (same symptom
 * previously seen in PR #13). Static-file home is the safe place.
 *
 * `:where()` keeps specificity at 0 so Polaris (in /app/*) and any
 * route's own utility class can override without `!important`.
 *
 * Reduced-motion users get the cursor change but skip the press
 * transform, per the spec.
 */
:where(button, [role="button"]):not(:disabled, [aria-disabled="true"]) {
  cursor: pointer;
}
:where(button, [role="button"]):is(:disabled, [aria-disabled="true"]) {
  cursor: not-allowed;
}
@media (prefers-reduced-motion: no-preference) {
  :where(button, [role="button"]):not(:disabled, [aria-disabled="true"]):active {
    transform: scale(0.985);
    transition: transform 80ms ease-out;
  }
}
