/**
 * TrackSharp Admin Styles
 * Extracted from inline CSS in Tracksharp-tracker.php
 */

:root {
  --ws-primary: #158a5f;
  --ws-primary-600: #127a54;
  --ws-primary-700: #0f6948;
  --ws-surface: #ffffff;
  --ws-border: #e5e7eb;
  --ws-muted: #64748b;
}

/* WordPress button overrides */
.wp-core-ui .button-primary,
.button.button-primary {
  background: var(--ws-primary);
  border-color: var(--ws-primary);
  text-shadow: none;
  box-shadow: none;
}

.wp-core-ui .button-primary:hover,
.button.button-primary:hover {
  background: var(--ws-primary-600);
  border-color: var(--ws-primary-600);
}

.wp-core-ui .button-primary:focus {
  box-shadow: 0 0 0 2px rgba(21, 138, 95, .25);
}

/* Main admin container */
.tracksharp-admin {
  max-width: 1100px;
  margin: 18px auto 0;
  width: 100%;
}

.tracksharp-admin.tracksharp-admin--wide {
  max-width: 100%;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.tracksharp-admin h1 {
  margin-top: 0;
}

/* Card component */
.tracksharp-admin .ws-card {
  background: var(--ws-surface);
  border: 1px solid var(--ws-border);
  border-radius: 14px;
  margin-top: 22px;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: 0 15px 35px rgba(15, 23, 42, .08);
}

.tracksharp-admin .ws-card h2,
.tracksharp-admin .ws-card h3 {
  margin-top: 0;
}

.tracksharp-admin .ws-card+.ws-card {
  margin-top: 20px;
}

.ws-card-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.ws-card-header p {
  margin: 6px 0 0;
  color: var(--ws-muted);
}

/* Card table variant */
.ws-card.ws-card-table {
  padding: 0;
  overflow: hidden;
}

.ws-card.ws-card-table table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  border: 0;
}

.tracksharp-admin--wide .ws-card.ws-card-table {
  overflow-x: auto;
}

.tracksharp-admin--wide .ws-card.ws-card-table table {
  min-width: 1200px;
}

.ws-card-table th {
  background: #f8fafc;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #475569;
}

.ws-card-table th,
.ws-card-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ws-border);
}

.ws-card-table tbody tr:nth-child(even) {
  background: #fcfdff;
}

.ws-card-table tbody tr:hover {
  background: #f1f5f9;
}

.ws-card-table tbody tr:last-child td {
  border-bottom: 0;
}

.ws-card-table__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ws-border);
  background: #f8fafc;
}

/* Toolbar */
.tracksharp-admin .ws-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 0;
  align-items: center;
  justify-content: flex-end;
}

/* Form inputs */
.tracksharp-admin input[type=text],
.tracksharp-admin input[type=number],
.tracksharp-admin select {
  border-radius: 9px;
  border: 1px solid #cbd5f5;
  padding: 8px 10px;
  min-height: 38px;
  width: 100%;
  box-sizing: border-box;
}

/* Range selector */
.ws-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-range label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ws-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.ws-range select {
  width: auto;
  min-width: 130px;
}

/* Wizard steps */
.ws-steps {
  display: flex;
  gap: 12px;
  margin: 20px 0 24px;
  flex-wrap: wrap;
}

.ws-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--ws-border);
  background: #f8fafc;
  color: #0f172a;
  font-weight: 600;
}

.ws-step .num {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: #e2e8f0;
  color: #0f172a;
}

.ws-step.active {
  border-color: var(--ws-primary);
  background: #f2fbf7;
}

.ws-step.done {
  opacity: .92;
}

.ws-step.active .num,
.ws-step.done .num {
  background: var(--ws-primary);
  color: #fff;
}

/* Form fields */
.ws-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ws-field+.ws-field {
  margin-top: 12px;
}

.ws-desc,
.ws-note {
  color: var(--ws-muted);
  font-size: 13px;
  margin-top: 4px;
}

/* Checklist */
.ws-checklist {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ws-checklist li {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Status badges */
.ws-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.ws-status-ok {
  background: #ecfdf5;
  color: #15803d;
}

.ws-status-warn {
  background: #fff7ed;
  color: #b45309;
}

.ws-status-bad {
  background: #fef2f2;
  color: #b91c1c;
}

/* Tags */
.ws-tag {
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

/* Grid layouts */
.ws-grid {
  display: grid;
  gap: 18px;
}

.tracksharp-admin .ws-grid>.ws-card {
  margin-bottom: 0;
}

.tracksharp-admin .ws-grid>.ws-card+.ws-card {
  margin-top: 0;
}

.ws-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.ws-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.tracksharp-admin .ws-grid-3 .ws-card {
  margin-top: 0px;
}

/* Proof / upsell cards (keep equal heights + sticky CTAs) */
.ws-proof-grid {
  align-items: stretch;
  box-sizing: border-box;
}

.ws-proof-grid>.ws-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  margin-top: 0;
  margin-bottom: 0;
}

.ws-proof-actions {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Metrics */
.ws-metric-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
}

.ws-delta {
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}

.ws-delta.ws-up {
  color: #15803d;
}

.ws-delta.ws-down {
  color: #b91c1c;
}

.ws-delta.ws-flat {
  color: #475569;
}

/* Sparklines */
.ws-sparkline {
  margin-top: 24px;
  padding: 16px;
  border: 1px dashed var(--ws-border);
  border-radius: 12px;
  background: #f8fafc;
}

.ws-sparkline strong {
  display: block;
  margin-bottom: 6px;
}

.ws-sparkline svg {
  width: 100%;
  height: auto;
}

/* Help tooltips */
.ws-help {
  position: relative;
  display: inline-block;
  cursor: help;
}

.ws-help .dashicons {
  color: #555;
}

.ws-tip {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #fff;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.35;
  max-width: 320px;
  display: none;
  z-index: 10;
}

.ws-help:hover .ws-tip {
  display: block;
}

.ws-hint {
  margin: 6px 0 0;
  color: #555;
  font-size: 12px;
}

.ws-more {
  display: block;
  margin-top: 6px;
  font-size: 12px;
}

.ws-more a {
  text-decoration: none;
}

.ws-hidden {
  display: none;
}

/* Test pills */
.ws-test-pills {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.ws-test-pill {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #cbd5f5;
  background: #fff;
  min-width: 240px;
  box-shadow: 0 8px 25px rgba(15, 23, 42, .08);
}

.ws-test-pill.ws-ok {
  border-color: #15803d;
  background: #ecfdf5;
}

.ws-test-pill.ws-fail {
  border-color: #b91c1c;
  background: #fef2f2;
}

.ws-test-pill .dashicons {
  font-size: 24px;
  width: 24px;
  height: 24px;
  color: inherit;
}

.ws-test-pill.ws-ok .dashicons {
  color: #15803d;
}

.ws-test-pill.ws-fail .dashicons {
  color: #b91c1c;
}

.ws-test-pill details {
  margin-top: 8px;
}

.ws-test-pill details summary {
  cursor: pointer;
  color: #2563eb;
}

/* Filter bar */
.ws-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.ws-filter-field {
  flex: 1 1 180px;
  min-width: 180px;
}

.ws-filter-field label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ws-muted);
}

.ws-filter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.ws-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 16px;
}

/* Clipped text */
.ws-clip {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pagination */
.ws-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.ws-page-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ws-page-btn {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid var(--ws-border);
  text-decoration: none;
  color: #0f172a;
  background: #fff;
  font-weight: 600;
}

.ws-page-btn.is-active {
  background: var(--ws-primary);
  border-color: var(--ws-primary);
  color: #fff;
}

/* Notice spacer */
.tracksharp-notice-spacer {
  height: 12px;
  clear: both;
}

/* Pro badge */
.ws-pro-badge {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

/* Locked card */
.ws-card.ws-card-locked {
  border: 2px dashed #cbd5e1;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

/* Blurred content container */
.ws-blurred-content {
  position: relative;
}

.ws-blurred-content .ws-grid {
  filter: blur(6px);
  opacity: 0.5;
  user-select: none;
  pointer-events: none;
}

/* Blur placeholder text */
.ws-blur {
  color: #94a3b8;
}

/* Teaser overlay */
.ws-teaser-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
}

.ws-teaser-message {
  text-align: center;
  padding: 24px;
}

.ws-teaser-message .dashicons {
  font-size: 32px;
  width: 32px;
  height: 32px;
  color: #475569;
  margin-bottom: 8px;
}

.ws-teaser-message p {
  margin: 8px 0;
}

.ws-teaser-message .button-primary {
  margin-top: 12px;
}

/* Freemius Page Styling Enhancements */
.fs-pricing-page,
.fs-account-page {
  padding: 20px 0;
}

.fs-pricing-page .fs-section,
.fs-account-page .fs-section {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  padding: 24px;
  margin-bottom: 20px;
}

.fs-pricing-page .fs-plan,
.fs-pricing-page .fs-package {
  border-radius: 12px;
  overflow: hidden;
}

.fs-pricing-page .fs-plan.fs-featured,
.fs-pricing-page .fs-package.fs-featured {
  border-color: #10b981;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
}

.fs-pricing-page .button-primary,
.fs-account-page .button-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.fs-pricing-page .button-primary:hover,
.fs-account-page .button-primary:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
}