/**
 * UsagePill Component Styles
 * Usage indicator for scans and reports
 */

/* Base styles */
.usage-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  color: var(--text-primary, #fff);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-family: var(--font-family-sans, 'Inter', sans-serif);
}

.usage-pill__plan {
  font-weight: 700;
  font-size: 0.625rem;
  padding: 0.125rem 0.5rem;
  color: var(--accent-primary, #00ff41);
  background: rgba(0, 255, 65, 0.1);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.usage-pill__separator {
  display: none;
}

.usage-pill__count {
  color: var(--text-primary, #fff);
  font-weight: 500;
}

.usage-pill__status {
  color: var(--text-primary, #fff);
  font-weight: 500;
}

.usage-pill__upgrade {
  margin-left: 0.5rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent-primary, #ffd700);
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.usage-pill__upgrade:hover {
  background: rgba(255, 215, 0, 0.2);
  border-color: rgba(255, 215, 0, 0.5);
}

/* Unlimited state */
.usage-pill--unlimited .usage-pill__status {
  color: var(--success, #4ade80);
}

/* Day Pass state with time remaining */
.usage-pill--day-pass .usage-pill__plan {
  color: var(--accent-gold, #ffd700);
  background: rgba(255, 215, 0, 0.15);
}

.usage-pill__time-remaining {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary, #aaa);
  padding-left: 0.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

body.white-theme .usage-pill__time-remaining {
  color: var(--text-secondary, #666);
  border-left-color: rgba(0, 0, 0, 0.1);
}

body.white-theme .usage-pill--day-pass .usage-pill__plan {
  color: var(--accent-gold, #c49000);
  background: rgba(200, 150, 0, 0.12);
}

/* Low warning state (1-2 scans left) */
.usage-pill--low {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

.usage-pill--low .usage-pill__plan {
  color: var(--warning, #f59e0b);
  background: rgba(245, 158, 11, 0.15);
}

.usage-pill--low .usage-pill__count {
  color: var(--warning, #f59e0b);
  font-weight: 700;
}

/* Exhausted state (0 scans left) */
.usage-pill--exhausted {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.usage-pill--exhausted .usage-pill__plan {
  color: var(--error, #ef4444);
  background: rgba(239, 68, 68, 0.15);
}

.usage-pill--exhausted .usage-pill__status {
  color: var(--error, #ef4444);
  font-weight: 700;
}

/* Compact mode (just a number) */
.usage-pill--compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-primary, #ccc);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
}

.usage-pill--compact.usage-pill--unlimited {
  color: var(--success, #4ade80);
  background: rgba(74, 222, 128, 0.1);
}

.usage-pill--compact.usage-pill--low {
  color: var(--warning, #f59e0b);
  background: rgba(245, 158, 11, 0.1);
}

.usage-pill--compact.usage-pill--exhausted {
  color: var(--error, #ef4444);
  background: rgba(239, 68, 68, 0.1);
}

/* Dropdown mode */
.usage-pill--dropdown {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  min-width: 160px;
}

.usage-pill__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.usage-pill__plan-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.125rem 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  color: var(--text-primary, #fff);
}

.usage-pill__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.usage-pill__label {
  color: var(--text-secondary, #888);
}

.usage-pill__value {
  font-weight: 600;
  font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
  color: var(--text-primary, #ccc);
}

.usage-pill__reset {
  font-size: 0.65rem;
  color: var(--text-tertiary, #666);
  text-align: center;
  margin-top: 0.25rem;
  opacity: 0.8;
}

/* Light theme adjustments */
body.white-theme .usage-pill {
  color: var(--text-primary, #333);
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

body.white-theme .usage-pill__plan {
  color: var(--accent-primary, #059669);
  background: rgba(5, 150, 105, 0.1);
}

body.white-theme .usage-pill__count,
body.white-theme .usage-pill__status {
  color: var(--text-primary, #333);
}

body.white-theme .usage-pill--low {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

body.white-theme .usage-pill--low .usage-pill__plan {
  color: var(--warning, #d97706);
  background: rgba(245, 158, 11, 0.12);
}

body.white-theme .usage-pill--exhausted {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}

body.white-theme .usage-pill--exhausted .usage-pill__plan {
  color: var(--error, #dc2626);
  background: rgba(239, 68, 68, 0.12);
}

body.white-theme .usage-pill__upgrade {
  color: var(--accent-primary, #c49000);
  background: rgba(200, 150, 0, 0.1);
  border-color: rgba(200, 150, 0, 0.3);
}

body.white-theme .usage-pill__upgrade:hover {
  background: rgba(200, 150, 0, 0.15);
  border-color: rgba(200, 150, 0, 0.5);
}

body.white-theme .usage-pill--compact {
  color: var(--text-primary, #333);
  background: rgba(0, 0, 0, 0.05);
}

body.white-theme .usage-pill--dropdown {
  background: rgba(0, 0, 0, 0.03);
}

body.white-theme .usage-pill__plan-badge {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary, #333);
}

body.white-theme .usage-pill__value {
  color: var(--text-primary, #333);
}

/* Scan page integration */
.scan-form .usage-pill {
  margin-top: 0.5rem;
}

.scan-input-wrapper + .usage-pill {
  margin-top: 0.5rem;
}

/* Login link for unauthenticated users */
.usage-pill__login-link {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-primary, #00ff41);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.usage-pill__login-link:hover {
  opacity: 0.8;
}

body.white-theme .usage-pill__login-link {
  color: var(--accent-primary, #059669);
}

.usage-pill--exhausted .usage-pill__login-link {
  color: var(--text-primary, #fff);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding-left: 0.5rem;
}

body.white-theme .usage-pill--exhausted .usage-pill__login-link {
  color: var(--text-primary, #333);
  border-left-color: rgba(0, 0, 0, 0.1);
}

/* Header dropdown integration */
.auth-dropdown-menu .usage-pill--dropdown {
  margin: 0.5rem;
  margin-top: 0;
}
