/**
 * Commission Structure Page Styles
 * 
 * Page-specific styles for the commission structure page layout and spacing.
 */

@import url('../variables/referral_theme.css');

/* Page Layout */
.commission-structure-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  padding: var(--space-xl) 0;
}

.commission-structure-page__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Hero Section */
.commission-structure-hero {
  text-align: center;
  margin-bottom: var(--space-3xl);
  padding: var(--space-3xl) 0;
}

.commission-structure-hero__title {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-primary);
  margin: 0 0 var(--space-lg) 0;
  line-height: var(--line-height-tight);
}

.commission-structure-hero__subtitle {
  font-size: var(--font-size-xl);
  color: var(--text-secondary);
  margin: 0 0 var(--space-xl) 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  line-height: var(--line-height-normal);
}

.commission-structure-hero__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}

.commission-structure-hero__stat {
  background: var(--bg-glass);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  text-align: center;
  transition: all var(--transition-normal);
}

.commission-structure-hero__stat:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg);
}

.commission-structure-hero__stat-value {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--brand-primary);
  margin-bottom: var(--space-sm);
  line-height: 1;
}

.commission-structure-hero__stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--font-weight-medium);
}

/* Section Spacing */
.commission-structure-section {
  margin-bottom: var(--space-3xl);
}

.commission-structure-section__header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.commission-structure-section__title {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin: 0 0 var(--space-md) 0;
}

.commission-structure-section__subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Grid Layouts */
.commission-structure-grid {
  display: grid;
  gap: var(--space-xl);
}

.commission-structure-grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.commission-structure-grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.commission-structure-grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Referral Types Grid */
.referral-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.referral-type-card {
  background: var(--bg-glass);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  text-align: center;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.referral-type-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--brand-gradient);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.referral-type-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg);
}

.referral-type-card:hover::before {
  opacity: 1;
}

.referral-type-card__icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-2xl);
  background: var(--brand-gradient);
  color: var(--text-primary);
  margin: 0 auto var(--space-md);
  box-shadow: var(--shadow-brand);
}

.referral-type-card__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin: 0 0 var(--space-sm) 0;
}

.referral-type-card__description {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: 0 0 var(--space-md) 0;
  line-height: var(--line-height-normal);
}

.referral-type-card__rate {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--brand-primary);
  margin-bottom: var(--space-sm);
}

.referral-type-card__rate-label {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}

.referral-type-card__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.referral-type-card__badge--requires-approval {
  background: var(--status-warning);
  color: var(--text-primary);
  border-color: var(--status-warning);
}

/* Legal Documents Section */
.legal-documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.legal-document-card {
  background: var(--bg-glass);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-normal);
  text-decoration: none;
  color: inherit;
  display: block;
}

.legal-document-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: inherit;
}

.legal-document-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xl);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.legal-document-card__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin: 0 0 var(--space-sm) 0;
}

.legal-document-card__version {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
}

.legal-document-card__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--status-error);
  color: var(--text-primary);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .commission-structure-page__container {
    padding: 0 var(--space-md);
  }
  
  .commission-structure-hero__stats {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-md);
  }
  
  .commission-structure-grid--2 {
    grid-template-columns: 1fr;
  }
  
  .commission-structure-grid--3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  .commission-structure-grid--4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .commission-structure-page {
    padding: var(--space-lg) 0;
  }
  
  .commission-structure-hero {
    padding: var(--space-2xl) 0;
    margin-bottom: var(--space-2xl);
  }
  
  .commission-structure-hero__title {
    font-size: var(--font-size-3xl);
  }
  
  .commission-structure-hero__subtitle {
    font-size: var(--font-size-lg);
  }
  
  .commission-structure-hero__stats {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .commission-structure-section {
    margin-bottom: var(--space-2xl);
  }
  
  .commission-structure-section__title {
    font-size: var(--font-size-2xl);
  }
  
  .commission-structure-section__subtitle {
    font-size: var(--font-size-base);
  }
  
  .referral-types-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .legal-documents-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

@media (max-width: 480px) {
  .commission-structure-page__container {
    padding: 0 var(--space-sm);
  }
  
  .commission-structure-hero__title {
    font-size: var(--font-size-2xl);
  }
  
  .commission-structure-hero__subtitle {
    font-size: var(--font-size-base);
  }
  
  .commission-structure-hero__stat {
    padding: var(--space-md);
  }
  
  .commission-structure-hero__stat-value {
    font-size: var(--font-size-2xl);
  }
  
  .referral-type-card {
    padding: var(--space-md);
  }
  
  .referral-type-card__icon {
    width: 48px;
    height: 48px;
    font-size: var(--font-size-xl);
  }
  
  .referral-type-card__rate {
    font-size: var(--font-size-xl);
  }
  
  .legal-document-card {
    padding: var(--space-md);
  }
  
  .legal-document-card__icon {
    width: 40px;
    height: 40px;
    font-size: var(--font-size-lg);
  }
}

/* ============================================
   Light Mode Support
   ============================================ */
[data-theme="light"] .commission-structure-page {
  background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
}

[data-theme="light"] .commission-structure-hero__title,
[data-theme="light"] .commission-structure-section__title,
[data-theme="light"] .referral-type-card__title {
  color: #1a1a1a;
}

[data-theme="light"] .commission-structure-hero__subtitle,
[data-theme="light"] .commission-structure-section__subtitle,
[data-theme="light"] .referral-type-card__description {
  color: #4a4a4a;
}

[data-theme="light"] .commission-structure-hero__stat,
[data-theme="light"] .referral-type-card,
[data-theme="light"] .legal-document-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .commission-structure-hero__stat:hover,
[data-theme="light"] .referral-type-card:hover,
[data-theme="light"] .legal-document-card:hover {
  background: rgba(255, 255, 255, 1);
  border-color: var(--brand-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .commission-structure-hero__stat-label {
  color: #666666;
}

[data-theme="light"] .referral-type-card__icon {
  color: #ffffff;
}

[data-theme="light"] .legal-document-card__title {
  color: #1a1a1a;
}

[data-theme="light"] .legal-document-card__description,
[data-theme="light"] .legal-document-card__date {
  color: #666666;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .commission-structure-hero__stat,
  .referral-type-card,
  .legal-document-card {
    border-width: 2px;
  }

  .referral-type-card:hover,
  .legal-document-card:hover {
    border-width: 3px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .commission-structure-hero__stat,
  .referral-type-card,
  .legal-document-card {
    transition: none;
  }
  
  .commission-structure-hero__stat:hover,
  .referral-type-card:hover,
  .legal-document-card:hover {
    transform: none;
  }
}
