/* Terms and Conditions Style Guide Implementation */

/* CSS Custom Properties */
:root {
  /* Background Colors */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F5F5F5;
  --bg-tertiary: #FAFAFA;

  /* Text Colors */
  --text-primary: #36353A;
  --text-secondary: #666666;
  --text-muted: #999999;

  /* Accent Colors */
  --accent-primary: #0066CC;
  --accent-hover: #0052A3;
  --accent-light: #E3F2FD;

  /* Border Colors */
  --border-light: #E0E0E0;
  --border-medium: #CCCCCC;
  --border-dark: #999999;

  /* Status Colors */
  --success: #4CAF50;
  --warning: #FF9800;
  --error: #D32F2F;
  --info: #2196F3;
}

/* Base Styles */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 
               'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 
               'Helvetica Neue', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  margin: 0;
  padding: 0;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent-primary);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
  border-radius: 4px;
}

.skip-link:focus {
  top: 0;
  color: white;
}

/* Main Container */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.main-layout {
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .container {
    max-width: 1200px;
  }
  
  .main-layout {
    flex-direction: row;
    gap: 3rem;
    align-items: flex-start;
  }
  
  .toc {
    flex: 0 0 280px;
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    margin-bottom: 0;
    padding-right: 1rem; /* Space for scrollbar */
  }
  
  .content {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 1023px) {
  .toc {
    position: static; /* Ensure it doesn't float on smaller screens */
    width: 100%;
    margin-bottom: 2rem;
  }
}

/* Page Header */
.page-header {
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 1.5rem;
  margin-bottom: 3rem;
}

.header-content {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.app-icon {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-text {
  flex: 1;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.2;
  margin-top: 0;
}

.last-updated {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .app-icon {
    width: 56px;
    height: 56px;
  }
  
  .page-title {
    font-size: 2rem;
  }
}

/* Table of Contents */
.toc {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 3rem;
}

.toc-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
  margin-top: 0;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-item {
  margin-bottom: 0.5rem;
}

.toc-link {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.toc-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.toc-link:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Section Headings */
.section-heading {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
  line-height: 1.3;
  scroll-margin-top: 2rem;
}

.subsection-heading {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.sub-subsection-heading {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .section-heading {
    font-size: 1.5rem;
    margin-top: 2rem;
  }
  
  .subsection-heading {
    font-size: 1.125rem;
  }
}

/* Content Sections */
.content-section {
  margin-bottom: 2rem;
}

.content-section p {
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.content-section p:last-child {
  margin-bottom: 0;
}

.content-section strong {
  font-weight: 600;
  color: var(--text-primary);
}

.content-section em {
  font-style: italic;
}

/* Lists */
ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
  padding-left: 0.5rem;
}

ol li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
  color: var(--text-primary);
}

ul {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
  padding-left: 0.5rem;
  list-style-type: disc;
}

ul li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
  color: var(--text-primary);
}

ul ul, ol ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

ul ul {
  list-style-type: circle;
}

ul ul ul {
  list-style-type: square;
}

/* Links */
a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration-thickness: 2px;
}

a:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Highlighted Sections */
.important-notice {
  background-color: var(--accent-light);
  border-left: 4px solid var(--accent-primary);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  border-radius: 4px;
}

.important-notice p {
  margin-bottom: 0.5rem;
}

.important-notice p:last-child {
  margin-bottom: 0;
}

.important-notice strong {
  color: var(--text-primary);
}

/* Legal References */
.legal-reference {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 
               'Courier New', monospace;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Code Blocks */
code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 
               'Courier New', monospace;
  font-size: 0.875rem;
  background-color: var(--bg-secondary);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
}

pre {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

pre code {
  background-color: transparent;
  padding: 0;
}

/* Contact Section */
.contact-section {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 3rem;
}

.contact-section h2 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.contact-section p {
  margin-bottom: 0.5rem;
}

.contact-section p:last-child {
  margin-bottom: 0;
}

/* Print Styles */
@media print {
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }
  
  .container {
    max-width: 100%;
    padding: 0;
  }
  
  .skip-link {
    display: none;
  }
  
  .toc {
    page-break-after: always;
    background: #fff;
    border: 1px solid #000;
  }
  
  .section-heading {
    page-break-after: avoid;
    border-bottom: 1px solid #000;
  }
  
  .content-section {
    page-break-inside: avoid;
  }
  
  a {
    color: #000;
    text-decoration: underline;
  }
  
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
  
  .important-notice {
    border-left: 4px solid #000;
    background: #f5f5f5;
  }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* Focus Visible for Better Keyboard Navigation */
*:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Ensure minimum touch target sizes on mobile */
@media (max-width: 767px) {
  a, button {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
  }
}

