/* Global Styles - Dark Theme */
:root {
  --primary-color: #3b82f6;
  --primary-hover: #60a5fa;
  --text-color: #e2e8f0;
  --text-light: #94a3b8;
  --text-muted: #64748b;
  --bg-color: #0f1020;
  --card-bg: #151633;
  --card-border: #334155;
  --border-color: #2d3748;
  --pink: #ec4899;
  --transition: all 0.2s ease;
  --header-bg: linear-gradient(180deg, #151633 0%, #0f1020 100%);
  --card-shadow: 0 10px 40px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.06);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  padding: 0;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header */
.legal-header {
  background: var(--header-bg);
  color: white;
  padding: 3rem 1rem;
  text-align: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--card-border);
  position: relative;
  overflow: hidden;
}

.legal-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #ec4899);
}

.legal-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.legal-header p {
  font-size: 1.125rem;
  opacity: 0.9;
  max-width: 700px;
  margin: 0 auto;
}

/* Container */
.legal-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  position: relative;
  z-index: 1;
}

/* Navigation */
.legal-nav {
  position: sticky;
  top: 1rem;
  margin-bottom: 2rem;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.legal-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
}

.legal-nav a {
  display: block;
  padding: 0.6rem 1.2rem;
  color: var(--text-color);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: var(--transition);
  border: 1px solid transparent;
  font-size: 0.95rem;
}

.legal-nav a:hover,
.legal-nav a:focus {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
}

.legal-nav a.active {
  background: linear-gradient(90deg, var(--primary-color), #7c3aed);
  color: white;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Content */
.legal-content {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
  position: relative;
  overflow: hidden;
}

.legal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #ec4899);
}

.legal-content h2 {
  color: #e2e8f0;
  margin: 2.5rem 0 1.25rem;
  font-size: 1.6rem;
  font-weight: 700;
  position: relative;
  padding-bottom: 0.75rem;
  letter-spacing: -0.3px;
}

.legal-content h2:after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 4rem;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), #ec4899);
  border-radius: 4px;
}

.legal-content h3 {
  color: #e2e8f0;
  margin: 2rem 0 1rem;
  font-size: 1.3rem;
  font-weight: 600;
  position: relative;
  padding-left: 1rem;
}

.legal-content h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.4em;
  height: 0.8em;
  width: 4px;
  background: var(--primary-color);
  border-radius: 2px;
}

.legal-content p,
.legal-content ul,
.legal-content ol {
  margin-bottom: 1.5rem;
  color: var(--text-color);
  line-height: 1.8;
  font-size: 1.05rem;
}

.legal-content ul,
.legal-content ol {
  padding-left: 1.5rem;
}

.legal-content li {
  margin-bottom: 0.5rem;
}

.legal-content a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  border-bottom: 1px solid var(--primary-color);
  padding-bottom: 1px;
  position: relative;
}

.legal-content a:hover {
  color: var(--primary-hover);
  border-bottom-color: transparent;
}

.legal-content a::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 1px;
  bottom: 0;
  left: 0;
  background: var(--primary-color);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.legal-content a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Highlight */
.highlight {
  background: rgba(59, 130, 246, 0.08);
  border-left: 4px solid var(--primary-color);
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.highlight::before {
  content: '!';
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: rgba(59, 130, 246, 0.15);
  line-height: 1;
}

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

/* Back to top */
.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  margin: 2.5rem 0 1rem;
  padding: 0.75rem 1.5rem;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 8px;
  transition: var(--transition);
  border: 1px solid rgba(59, 130, 246, 0.2);
  backdrop-filter: blur(4px);
}

.back-to-top:hover {
  color: white;
  background: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  border-color: transparent;
}

.back-to-top svg {
  width: 1em;
  height: 1em;
  transition: transform 0.3s ease;
}

.back-to-top:hover svg {
  transform: translateY(-2px);
}

/* Footer */
.legal-footer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4rem;
  position: relative;
  background: rgba(15, 16, 32, 0.7);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
  .legal-header h1 {
    font-size: 1.8rem;
  }
  
  .legal-content {
    padding: 1.75rem;
    border-radius: 8px;
  }
  
  .legal-nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .legal-nav a {
    padding: 0.75rem 1rem;
    text-align: center;
  }
  
  .legal-content h2 {
    font-size: 1.4rem;
  }
  
  .legal-content h3 {
    font-size: 1.2rem;
  }
  
  .legal-content p,
  .legal-content ul,
  .legal-content ol {
    font-size: 1rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.legal-content > * {
  animation: fadeIn 0.5s ease-out forwards;
  opacity: 0;
}

.legal-content > *:nth-child(1) { animation-delay: 0.1s; }
.legal-content > *:nth-child(2) { animation-delay: 0.15s; }
.legal-content > *:nth-child(3) { animation-delay: 0.2s; }
.legal-content > *:nth-child(4) { animation-delay: 0.25s; }
.legal-content > *:nth-child(5) { animation-delay: 0.3s; }
.legal-content > *:nth-child(n+6) { animation-delay: 0.35s; }

.back-to-top:hover svg {
  animation: float 1.5s ease-in-out infinite;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Print styles */
@media print {
  .legal-nav,
  .back-to-top,
  .legal-footer {
    display: none;
  }
  
  .legal-content {
    padding: 0;
    box-shadow: none;
    border: none;
    background: none;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.6;
    color: #000;
    background: #fff;
  }
  
  .legal-header {
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    background: none !important;
    color: #000;
    border-bottom: 2px solid #000;
  }
  
  .legal-header h1 {
    font-size: 1.8rem;
    color: #000;
  }
  
  .legal-content h2 {
    font-size: 1.4rem;
    margin: 2rem 0 1rem;
    color: #000;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5rem;
  }
  
  .legal-content h3 {
    font-size: 1.2rem;
    margin: 1.75rem 0 0.75rem;
    color: #222;
  }
  
  .legal-content p,
  .legal-content li {
    color: #333;
  }
  
  a {
    color: #0066cc;
    text-decoration: underline;
  }
  
  .highlight {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
  }
  
  @page {
    margin: 2cm;
  }
}

/* Footer */
.footer {
  background-color: #0f1230;
  color: white;
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--primary-color);
}

@media (max-width: 768px) {
  .footer-links {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}
