* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
  line-height: 1.6;
}

/* Navigation */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #007aff;
}

.logo-image {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #007aff, #0051d5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: #007aff;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header Section */
.terms-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4rem 0;
}

.header-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.terms-title {
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, #007aff, #0051d5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.terms-subtitle {
  font-size: 1.25rem;
  color: #666;
  margin-bottom: 2rem;
}

.last-updated {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 122, 255, 0.1);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  border: 1px solid rgba(0, 122, 255, 0.2);
}

.update-label {
  font-size: 0.875rem;
  color: #666;
  font-weight: 500;
}

.update-date {
  font-size: 0.875rem;
  color: #007aff;
  font-weight: 600;
}

/* Terms Content */
.terms-content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  min-height: calc(100vh - 200px);
  padding: 3rem 0;
}

.terms-wrapper {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: start;
}

/* Table of Contents */
.toc-sidebar {
  position: sticky;
  top: 120px;
}

.toc-container {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.toc-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #f0f0f0;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toc-link {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #666;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.toc-link:hover,
.toc-link.active {
  background: rgba(0, 122, 255, 0.1);
  color: #007aff;
  border-left-color: #007aff;
}

/* Main Content */
.terms-main {
  background: white;
  border-radius: 16px;
  padding: 3rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.terms-article {
  max-width: none;
}

.terms-section {
  margin-bottom: 3rem;
  scroll-margin-top: 120px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #f0f0f0;
}

.section-content {
  color: #444;
  font-size: 1rem;
  line-height: 1.8;
}

.section-content p {
  margin-bottom: 1.5rem;
}

.section-content p:last-child {
  margin-bottom: 0;
}

.terms-list {
  list-style: none;
  margin: 1.5rem 0;
  padding-left: 0;
}

.terms-list li {
  position: relative;
  padding: 0.5rem 0 0.5rem 2rem;
  margin-bottom: 0.5rem;
}

.terms-list li::before {
  content: "•";
  position: absolute;
  left: 0.5rem;
  color: #007aff;
  font-weight: 700;
  font-size: 1.2rem;
}

.warning-box {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  border: 1px solid #ffc107;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  border-left: 4px solid #ffc107;
}

.warning-box strong {
  color: #856404;
  display: block;
  margin-bottom: 0.5rem;
}

.contact-info {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 2rem;
  margin-top: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.contact-item:last-child {
  margin-bottom: 0;
}

.contact-item strong {
  min-width: 80px;
  color: #333;
}

.contact-item a {
  color: #007aff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.contact-item a:hover {
  color: #0051d5;
  text-decoration: underline;
}

/* Footer */
.footer {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  color: white;
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-brand .logo-text {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, #007aff, #0051d5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  display: block;
}

.footer-tagline {
  color: #ccc;
  font-size: 0.875rem;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.link-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.link-title {
  font-size: 1rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.5rem;
}

.link-group a {
  color: #ccc;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.3s ease;
}

.link-group a:hover,
.link-group a.active-link {
  color: #007aff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
}

.copyright {
  color: #999;
  font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .terms-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .toc-sidebar {
    position: static;
    order: 2;
  }
  
  .toc-container {
    display: none;
  }
  
  .terms-main {
    order: 1;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .nav-container {
    padding: 1rem;
  }
  
  .nav-links {
    gap: 1rem;
  }
  
  .terms-header {
    padding: 2rem 0;
  }
  
  .terms-title {
    font-size: 2rem;
  }
  
  .terms-subtitle {
    font-size: 1rem;
  }
  
  .terms-main {
    padding: 2rem;
  }
  
  .section-title {
    font-size: 1.25rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer-links {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 480px) {
  .terms-header {
    padding: 1.5rem 0;
  }
  
  .terms-title {
    font-size: 1.75rem;
  }
  
  .terms-main {
    padding: 1.5rem;
  }
  
  .last-updated {
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
  }
  
  .nav-links {
    display: none;
  }
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Print Styles */
@media print {
  .navbar,
  .footer,
  .toc-sidebar {
    display: none;
  }
  
  .terms-wrapper {
    grid-template-columns: 1fr;
  }
  
  .terms-main {
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  .section-title {
    color: #000;
    page-break-after: avoid;
  }
  
  .terms-section {
    page-break-inside: avoid;
  }
}

/* Focus Styles for Accessibility */
.toc-link:focus,
.nav-links a:focus,
.contact-item a:focus {
  outline: 2px solid #007aff;
  outline-offset: 2px;
  border-radius: 4px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .terms-main,
  .toc-container {
    border: 2px solid #000;
  }
  
  .section-title {
    border-bottom-color: #000;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}
