/* Reality Defender PeakMetrics Dashboard Styles */

@font-face {
  font-family: 'ABC Marfa';
  src: url('https://rd-platform-assets.s3.amazonaws.com/fonts/ABCMarfa-Light.woff')
    format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  font-stretch: normal;
}

:root {
  /* Reality Defender Color System - Exact Tailwind Values */
  --color-black: #292827;
  --color-white: #fff;
  --color-gray: #8b8a87;
  --color-gray-light: #e6e4e2;
  --color-purple: #3a3946;
  --color-purple-light: #59576a;
  --color-green: #525f58;
  --color-green-accent: #687a70;
  --color-green-light: #daecd3;
  --color-green-light-accent: #909350;
  --color-red-error: #ff5917;

  /* Primary Colors */
  --primary-black: #292827;
  --primary-white: #fff;

  /* Background Colors */
  --background-white: #fff;
  --background-gray: #f9f9f8;

  /* Text Colors */
  --text-primary: #292827;
  --text-secondary: #292827;
  --text-muted: #8b8a87;

  /* Border Colors */
  --border-light: #e6e4e2;
  --border-medium: #e6e4e2;

  /* Design System */
  --font-family-heading: 'ABC Marfa', -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, sans-serif;
  --font-family-body: 'Public Sans', -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, sans-serif;
  --spacing: calc(1rem / 16);
  --font-weight-extralight: 200;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-bold: 700;
  --easing: cubic-bezier(0.4, 0.1, 0.1, 0.9);

  /* Shadows - Minimal for Reality Defender style */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);

  /* Border Radius - Sharp angles (Reality Defender style) */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

body {
  font-family: var(--font-family-heading);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--primary-white);
  font-weight: 300;
  letter-spacing: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Header & Navigation */
.header {
  background: var(--background-white);
  border-bottom: 1px solid var(--border-light);
}

.navbar {
  padding: 16px 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  height: 48px;
  width: auto;
  fill: var(--primary-black);
  color: var(--primary-black);
}

.footer-logo {
  height: 32px;
  width: auto;
  fill: var(--primary-white);
}

.brand-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
  width: fit-content;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 300;
  font-size: 15px;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--primary-black);
}

.nav-button {
  background-color: var(--color-green);
  color: var(--primary-white);
  display: flex;
  align-items: center;
  gap: calc(var(--spacing) * 20);
  border-radius: 0.0625rem;
  padding-block: calc(var(--spacing) * 12);
  padding-inline: calc(var(--spacing) * 52) calc(var(--spacing) * 20);
  transition: color 0.3s, background-color 0.3s, opacity 0.3s;
  font-size: calc(16 / 16 * 1rem);
  line-height: 1;
  letter-spacing: 0.01em;
  background-repeat: no-repeat;
  background-position: calc(var(--spacing) * 12) 50%;
  background-size: calc(var(--spacing) * 20);
  background-image: url('data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M12.5%2010.8438L7.5%2015.8438V5.84375L12.5%2010.8438Z%22%20fill%3D%22white%22%2F%3E%0A%3C%2Fsvg%3E');
  text-decoration: none;
  border: none;
}

.nav-button:hover,
.nav-button:active {
  cursor: pointer;
  background-color: var(--color-green-light-accent);
}

@media (min-width: 1024px) {
  .nav-button {
    gap: calc(var(--spacing) * 24);
    padding-block: calc(var(--spacing) * 16);
    padding-inline: calc(var(--spacing) * 60) calc(var(--spacing) * 24);
    font-size: calc(20 / 16 * 1rem);
    background-position: calc(var(--spacing) * 16) 50%;
  }
}

/* Hero Section */
.hero-section {
  background: var(--color-purple);
  color: var(--primary-white);
  padding: 80px 0;
  text-align: center;
}

.hero-title {
  font-size: 40px;
  font-weight: 300;
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero-subtitle {
  font-family: var(--font-family-body);
  font-size: 18px;
  font-weight: 200;
  margin: 0 auto;
  line-height: 1.2;
}

/* Main Content */
.main {
  padding: 40px 0;
}

.dashboard-section {
  background: var(--background-white);
  padding: 32px 0;
  margin-bottom: 32px;
}

.section-header {
  margin-bottom: 24px;
}

.section-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-description {
  font-family: var(--font-family-body);
  font-weight: 200;
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 700px;
}

/* Airtable Embed */
.airtable-embed {
  margin: 24px 0;
  overflow: hidden;
}

.airtable-embed-iframe {
  min-height: 533px;
  width: 100%;
  border: none;
  background: var(--background-white);
}

/* Data Notes */
.data-notes {
  background: var(--background-gray);
  padding: 24px;
  margin-top: 24px;
  border-radius: 4px;
}

.data-notes h3 {
  color: var(--text-primary);
  font-size: 20px;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.data-notes ul {
  font-family: var(--font-family-body);
  font-weight: 200;
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.data-notes li {
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.data-notes li strong {
  color: var(--text-primary);
  font-weight: 500;
}

.list-icon {
  width: 10px;
  height: 10px;
  color: var(--text-secondary);
}

/* CTA Section */
.cta-section {
  background-color: var(--color-green-light);
  padding: 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cta-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  width: 100%;
}

.cta-content-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.cta-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-align: left;
}

.cta-description {
  font-family: var(--font-family-body);
  font-weight: 200;
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.5;
  text-align: left;
}

.cta-button {
  width: fit-content;
  background-color: var(--color-green);
  color: var(--primary-white);
  display: flex;
  align-items: center;
  gap: calc(var(--spacing) * 20);
  border-radius: 0.0625rem;
  padding-block: calc(var(--spacing) * 12);
  padding-inline: calc(var(--spacing) * 52) calc(var(--spacing) * 20);
  transition: color 0.3s, background-color 0.3s, opacity 0.3s;
  font-size: calc(16 / 16 * 1rem);
  line-height: 1;
  letter-spacing: 0.01em;
  font-weight: 300;
  background-repeat: no-repeat;
  background-position: calc(var(--spacing) * 12) 50%;
  background-size: calc(var(--spacing) * 20);
  background-image: url('data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M12.5%2010.8438L7.5%2015.8438V5.84375L12.5%2010.8438Z%22%20fill%3D%22white%22%2F%3E%0A%3C%2Fsvg%3E');
  text-decoration: none;
  border: none;
  flex-shrink: 0;
}

.cta-button:hover,
.cta-button:active {
  cursor: pointer;
  background-color: var(--color-green-light-accent);
}

@media (min-width: 1024px) {
  .cta-button {
    gap: calc(var(--spacing) * 24);
    padding-block: calc(var(--spacing) * 16);
    padding-inline: calc(var(--spacing) * 60) calc(var(--spacing) * 24);
    font-size: calc(20 / 16 * 1rem);
    background-position: calc(var(--spacing) * 16) 50%;
  }
}

/* Footer */
.footer {
  background: var(--color-green);
  color: white;
  padding: 32px 0 24px;
  margin-top: 40px;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand .logo svg {
  width: 128px;
  height: auto;
}

.footer-brand-text {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.footer-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 300;
  font-size: 15px;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--primary-white);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.footer-copyright,
.footer-powered {
  color: var(--primary-white);
  font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }

  .navbar .container {
    gap: 16px;
    align-items: flex-start;
  }

  .nav-menu {
    gap: 24px;
  }

  .hero-section {
    padding: 64px 0;
  }

  .hero-title {
    font-size: 32px;
    text-align: left;
  }

  .hero-subtitle {
    text-align: left;
  }

  .main {
    padding: 32px 0;
  }

  .dashboard-section {
    padding: 24px 0px;
    margin-bottom: 24px;
  }

  .section-title {
    font-size: 20px;
  }

  .section-description {
    font-size: 16px;
  }

  .airtable-embed-iframe {
    min-height: 400px;
  }

  .data-notes {
    padding: 24px;
  }

  .cta-section {
    padding: 32px 24px;
  }

  .cta-title {
    font-size: 20px;
  }

  .cta-description {
    font-size: 16px;
  }

  .footer-content {
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
  }

  .footer-links {
    gap: 24px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 32px;
  }

  .section-title {
    font-size: 20px;
    text-align: left;
  }

  .section-description {
    text-align: left;
  }

  .dashboard-section {
    padding: 32px 0px;
  }

  .data-notes {
    padding: 20px;
  }

  .cta-section {
    padding: 40px 20px;
  }

  .nav-menu {
    flex-wrap: wrap;
    gap: 16px;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 16px;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-section,
.cta-section {
  animation: fadeInUp 0.6s ease forwards;
}

/* Focus states for accessibility */
.nav-link:focus,
.footer-link:focus,
.cta-button:focus {
  outline: 2px solid var(--primary-black);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --text-primary: #000000;
    --text-secondary: #333333;
    --border-light: #666666;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dashboard Table Styles */
.dashboard-table-container {
  background: var(--background-white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.table-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top-color: var(--color-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.table-error {
  text-align: center;
  padding: 3rem;
  background: #fee;
  color: var(--color-red-error);
  border-radius: 8px;
  margin: 2rem 0;
}

.table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-family-body);
  font-size: 0.875rem;
}

.dashboard-table thead {
  background: var(--background-gray);
  border-bottom: 2px solid var(--border-medium);
}

.dashboard-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--background-gray);
  cursor: pointer;
  user-select: none;
}

.dashboard-table th:hover {
  background: var(--color-gray-light);
}

.dashboard-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background-color 0.2s;
}

.dashboard-table tbody tr:hover {
  background: var(--background-gray);
}

.dashboard-table td {
  padding: 0.75rem 1rem;
  color: var(--text-primary);
}

.dashboard-table .entity-name {
  font-weight: 600;
  color: var(--color-purple);
}

.dashboard-table .numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dashboard-table .percentage {
  color: var(--color-green-accent);
  font-weight: 600;
}

.dashboard-table .date {
  color: var(--text-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.category-separator {
  background: var(--color-purple);
  color: var(--color-white);
}

.category-header {
  padding: 0.5rem 1rem !important;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.category-ceos .entity-name {
  color: var(--color-purple);
}

.last-update {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* Responsive table */
@media (max-width: 768px) {
  .dashboard-table {
    font-size: 0.75rem;
  }

  .dashboard-table th,
  .dashboard-table td {
    padding: 0.5rem;
  }

  .table-wrapper {
    overflow-x: scroll;
  }
}
