/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* Color Variables & Base Reset */
:root {
  --color-bg: #090e1a;
  --color-surface: #131b2e;
  --color-surface-hover: #1e2942;
  --color-border: rgba(255, 255, 255, 0.06);
  --color-primary: #38bdf8;
  --color-primary-glow: rgba(56, 189, 248, 0.15);
  --color-text-main: #f8fafc;
  --color-text-muted: #94a3b8;
  --color-accent: #818cf8;
  --color-nav-bg: rgba(9, 14, 26, 0.8);
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base Body Styles */
body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  background-image: 
    radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(129, 140, 248, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--color-text-main);
  line-height: 1.7;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* Keep compatibility with index.html */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}
.badge {
  display: inline-block;
  background: #1e293b;
  border-radius: 4px;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  color: #38bdf8;
  margin-bottom: 1rem;
}

/* Header & Navigation Bar (Glassmorphic) */
.navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--color-nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  padding: 1rem 2rem;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-accent {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

/* Content Layout (TOC on Left, Doc Content on Right) */
.legal-wrapper {
  max-width: 1200px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: start;
}

/* Sidebar Navigation (TOC) */
.sidebar {
  position: sticky;
  top: 6.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
}

.sidebar h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  margin-bottom: 1rem;
  font-weight: 700;
}

.toc-list {
  list-style: none;
}

.toc-item {
  margin-bottom: 0.6rem;
}

.toc-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  display: block;
  padding: 0.25rem 0;
  transition: color 0.2s ease, transform 0.2s ease;
}

.toc-link:hover {
  color: var(--color-text-main);
  transform: translateX(3px);
}

/* Main Content Styling */
.legal-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 3rem;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.legal-header {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1.5rem;
  margin-bottom: 2.5rem;
}

.legal-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--color-text-main), var(--color-text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.last-updated {
  font-size: 0.875rem;
  color: var(--color-primary);
  background: var(--color-primary-glow);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  display: inline-block;
  font-weight: 500;
}

.legal-section {
  scroll-margin-top: 6rem;
  margin-bottom: 3rem;
}

.legal-section h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 1.2rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.legal-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-main);
  margin: 1.5rem 0 0.8rem;
}

.legal-section p {
  color: var(--color-text-muted);
  margin-bottom: 1.2rem;
  font-size: 1rem;
  line-height: 1.75;
}

/* Unordered list styled */
.legal-section ul {
  list-style: none;
  margin-bottom: 1.5rem;
  padding-left: 0.5rem;
}

.legal-section ul li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--color-text-muted);
  margin-bottom: 0.8rem;
  font-size: 0.975rem;
}

.legal-section ul li::before {
  content: "•";
  position: absolute;
  left: 0.2rem;
  top: -0.05rem;
  color: var(--color-primary);
  font-size: 1.4rem;
}

.legal-section strong {
  color: var(--color-text-main);
  font-weight: 600;
}

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease, border-bottom 0.2s ease;
}

a:hover {
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
  text-decoration: underline;
}

/* Contact box / info card */
.contact-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.5), rgba(15, 23, 42, 0.5));
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.8rem;
  margin-top: 1.5rem;
}

.contact-card address {
  font-style: normal;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.contact-card address strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  color: var(--color-text-main);
}

.contact-card-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

/* Back to Top button styling */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  z-index: 99;
}

.back-to-top:hover {
  color: var(--color-text-main);
  background: var(--color-surface-hover);
  transform: translateY(-3px);
  border-color: var(--color-primary);
  box-shadow: 0 0 12px var(--color-primary-glow);
}

/* Responsive design */
@media (max-width: 992px) {
  .legal-wrapper {
    grid-template-columns: 1fr;
    margin: 1.5rem auto;
  }
  
  .sidebar {
    display: none; /* Hide TOC on mobile for clean screen, navbar works fine */
  }
  
  .legal-content {
    padding: 2rem;
  }
  
  .legal-header h1 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0;
  }
  
  .navbar {
    padding: 1rem;
  }
  
  .nav-container {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
  }
  
  .nav-links {
    gap: 1rem;
  }
  
  .legal-content {
    padding: 1.5rem 1.2rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .back-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
  }
}
