/* Terms of Service Page Styles */

/* Main Layout */
.terms-main {
  min-height: 100vh;
  background: var(--bg-primary);
  padding: var(--spacing-2xl) 0;
  position: relative;
  overflow-x: hidden;
}

.terms-main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 60%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.terms-main .container {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

/* Hero Section */
.terms-hero {
  text-align: center;
  margin-bottom: var(--spacing-3xl);
  padding: var(--spacing-3xl) 0;
  background: var(--gradient-glass);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border-primary);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.terms-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

.terms-hero .hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--spacing-lg);
  line-height: 1.2;
  position: relative;
}

.terms-hero .hero-description {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--spacing-xl);
  line-height: 1.6;
  font-weight: 400;
}

.last-updated {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: var(--bg-secondary);
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-primary);
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.update-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.update-date {
  font-weight: 600;
  color: var(--primary-color);
}

/* Table of Contents */
.toc-section {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--spacing-2xl);
  margin-bottom: var(--spacing-3xl);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: var(--spacing-xl);
  z-index: 10;
}

.toc-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.toc-section h2::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-sm);
}

.toc-list li {
  position: relative;
}

.toc-list a {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
  font-weight: 500;
  font-size: 0.875rem;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.toc-list a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0.1;
  transition: left var(--transition-normal);
  z-index: -1;
}

.toc-list a:hover::before {
  left: 0;
}

.toc-list a:hover {
  color: var(--primary-color);
  border-color: var(--border-secondary);
  transform: translateX(4px);
}

.toc-list a:active {
  transform: translateX(2px);
}

/* Terms Content */
.terms-content {
  background: var(--bg-card);
  border-radius: var(--radius-2xl);
  padding: var(--spacing-3xl);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}

.terms-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

/* Terms Sections */
.terms-section {
  margin-bottom: var(--spacing-3xl);
  padding-bottom: var(--spacing-2xl);
  border-bottom: 1px solid var(--border-primary);
  position: relative;
  animation: slideInUp 0.6s ease-out;
}

.terms-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.terms-section h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  position: relative;
}

.terms-section h2::before {
  content: '';
  width: 6px;
  height: 32px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.terms-section h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
}

.terms-section p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
  text-align: justify;
}

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

/* Lists */
.terms-section ul {
  list-style: none;
  padding: 0;
  margin: var(--spacing-lg) 0;
}

.terms-section li {
  position: relative;
  padding-left: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.terms-section li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  background: var(--gradient-primary);
  border-radius: 50%;
  transform: translateY(-50%);
}

.terms-section li:last-child {
  margin-bottom: 0;
}

/* Links */
.terms-section a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
}

.terms-section a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width var(--transition-fast);
}

.terms-section a:hover::after {
  width: 100%;
}

.terms-section a:hover {
  color: var(--primary-hover);
  background: rgba(99, 102, 241, 0.1);
}

/* Contact Info */
.contact-info {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  margin-top: var(--spacing-lg);
  border: 1px solid var(--border-primary);
  position: relative;
  overflow: hidden;
}

.contact-info::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
}

.contact-info p {
  margin-bottom: var(--spacing-sm);
  font-size: 1rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

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

.contact-info strong {
  color: var(--text-primary);
  font-weight: 600;
  min-width: 80px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .terms-main .container {
    padding: 0 var(--spacing-md);
  }
  
  .terms-content {
    padding: var(--spacing-2xl);
  }
  
  .toc-section {
    padding: var(--spacing-xl);
  }
  
  .toc-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .terms-main {
    padding: var(--spacing-xl) 0;
  }
  
  .terms-hero {
    padding: var(--spacing-2xl) var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
  }
  
  .terms-hero .hero-title {
    font-size: 2.5rem;
  }
  
  .terms-hero .hero-description {
    font-size: 1.125rem;
  }
  
  .terms-content {
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
  }
  
  .toc-section {
    padding: var(--spacing-lg);
    position: static;
    margin-bottom: var(--spacing-2xl);
  }
  
  .terms-section {
    margin-bottom: var(--spacing-2xl);
    padding-bottom: var(--spacing-xl);
  }
  
  .terms-section h2 {
    font-size: 1.5rem;
  }
  
  .terms-section p {
    font-size: 0.95rem;
    text-align: left;
  }
  
  .terms-section li {
    font-size: 0.95rem;
    padding-left: var(--spacing-lg);
  }
  
  .contact-info {
    padding: var(--spacing-lg);
  }
  
  .contact-info p {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
  }
  
  .contact-info strong {
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .terms-main .container {
    padding: 0 var(--spacing-sm);
  }
  
  .terms-hero {
    padding: var(--spacing-xl) var(--spacing-md);
  }
  
  .terms-hero .hero-title {
    font-size: 2rem;
  }
  
  .terms-hero .hero-description {
    font-size: 1rem;
  }
  
  .terms-content {
    padding: var(--spacing-lg);
  }
  
  .toc-section {
    padding: var(--spacing-md);
  }
  
  .terms-section h2 {
    font-size: 1.375rem;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }
  
  .terms-section h2::before {
    width: 4px;
    height: 24px;
  }
  
  .terms-section p {
    font-size: 0.9rem;
  }
  
  .terms-section li {
    font-size: 0.9rem;
    padding-left: var(--spacing-md);
  }
  
  .contact-info {
    padding: var(--spacing-md);
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .toc-list a {
    padding: var(--spacing-md);
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  .terms-section a {
    padding: var(--spacing-xs) var(--spacing-sm);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* Dark theme enhancements */
[data-theme="dark"] .terms-hero {
  background: var(--gradient-glass);
  border-color: var(--border-primary);
}

[data-theme="dark"] .toc-section,
[data-theme="dark"] .terms-content {
  background: var(--bg-card);
  border-color: var(--border-primary);
}

[data-theme="dark"] .contact-info {
  background: var(--bg-secondary);
  border-color: var(--border-primary);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .terms-section h2::before,
  .terms-section h2::after {
    background: var(--primary-color);
  }
  
  .terms-section li::before {
    background: var(--primary-color);
  }
  
  .toc-section h2::before {
    background: var(--primary-color);
  }
  
  .contact-info::before {
    background: var(--primary-color);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .terms-section {
    animation: none;
  }
  
  .toc-list a,
  .terms-section a {
    transition: none;
  }
  
  .toc-list a::before,
  .terms-section a::after {
    transition: none;
  }
}

/* Print styles */
@media print {
  .terms-main::before {
    display: none;
  }
  
  .toc-section {
    position: static;
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .terms-content {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .terms-hero {
    background: white;
    border: 1px solid #ccc;
  }
  
  .terms-section h2::before,
  .terms-section h2::after {
    background: #333;
  }
  
  .terms-section li::before {
    background: #333;
  }
}

/* Animation keyframes */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered animation for sections */
.terms-section:nth-child(1) { animation-delay: 0.1s; }
.terms-section:nth-child(2) { animation-delay: 0.2s; }
.terms-section:nth-child(3) { animation-delay: 0.3s; }
.terms-section:nth-child(4) { animation-delay: 0.4s; }
.terms-section:nth-child(5) { animation-delay: 0.5s; }
.terms-section:nth-child(6) { animation-delay: 0.6s; }
.terms-section:nth-child(7) { animation-delay: 0.7s; }
.terms-section:nth-child(8) { animation-delay: 0.8s; }
.terms-section:nth-child(9) { animation-delay: 0.9s; }
.terms-section:nth-child(10) { animation-delay: 1.0s; }
.terms-section:nth-child(11) { animation-delay: 1.1s; }
.terms-section:nth-child(12) { animation-delay: 1.2s; }

/* Focus styles for accessibility */
.terms-section h2:focus,
.toc-list a:focus,
.terms-section a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Smooth scrolling for anchor links */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
.terms-content::-webkit-scrollbar {
  width: 8px;
}

.terms-content::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.terms-content::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
}

.terms-content::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}

