/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
  min-height: 100vh;
  line-height: 1.6;
  color: #333;
}

/* Main Container */
.legal-container {
  max-width: 1200px;
  margin: 0 auto;
  background: #ffffff;
  min-height: 100vh;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
}

/* Header */
.legal-header {
  background: linear-gradient(135deg, #05305c 0%, #0a4a8a 100%);
  padding: 30px 50px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}

.logo-link {
  display: flex;
  align-items: center;
}

.brand-logo {
  height: 45px;
  width: auto;
  transition: transform 0.3s ease;
}

.back-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.back-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.back-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-1px);
}

/* Main Content */
.legal-main {
  padding: 60px 80px;
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.legal-content {
  max-width: 900px;
  margin: 0 auto;
}

/* Title Section */
.title-section {
  margin-bottom: 50px;
  padding-bottom: 30px;
  border-bottom: 3px solid #05305c;
}

.title-section h1 {
  font-size: 42px;
  color: #05305c;
  margin-bottom: 15px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.last-updated {
  color: #666;
  font-size: 14px;
  margin-bottom: 20px;
  font-style: italic;
}

.intro-text {
  font-size: 18px;
  color: #555;
  line-height: 1.8;
  margin-top: 20px;
}

/* Table of Contents */
.toc {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 30px;
  border-radius: 12px;
  margin-bottom: 50px;
  border-left: 4px solid #0a4a8a;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.toc h3 {
  color: #05305c;
  font-size: 20px;
  margin-bottom: 20px;
  font-weight: 600;
}

.toc ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.toc li {
  margin: 0;
}

.toc a {
  color: #0a4a8a;
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 10px 15px;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.5);
}

.toc a:hover {
  background: #ffffff;
  color: #05305c;
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Legal Sections */
.legal-section {
  margin-bottom: 50px;
  scroll-margin-top: 120px;
}

.legal-section h2 {
  color: #05305c;
  font-size: 32px;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e9ecef;
  font-weight: 700;
}

.legal-section h3 {
  color: #0a4a8a;
  font-size: 22px;
  margin-top: 30px;
  margin-bottom: 15px;
  font-weight: 600;
}

.legal-section h4 {
  color: #333;
  font-size: 18px;
  margin-top: 20px;
  margin-bottom: 12px;
  font-weight: 600;
}

.legal-section p {
  color: #444;
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 18px;
}

.legal-section ul {
  margin: 20px 0;
  padding-left: 30px;
}

.legal-section li {
  color: #444;
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 12px;
  position: relative;
}

.legal-section li::marker {
  color: #0a4a8a;
  font-weight: bold;
}

.legal-section strong {
  color: #05305c;
  font-weight: 600;
}

/* Risk Warning Box */
.risk-warning {
  background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
  border: 2px solid #ffc107;
  border-left: 6px solid #ff9800;
  padding: 25px;
  border-radius: 10px;
  margin: 30px 0;
  box-shadow: 0 4px 15px rgba(255, 152, 0, 0.15);
}

.risk-warning h3 {
  color: #d84315;
  font-size: 20px;
  margin: 0 0 15px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.risk-warning p {
  color: #333;
  font-size: 17px;
  margin: 0;
  line-height: 1.7;
  font-weight: 500;
}

/* Contact Info */
.contact-info {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 10px;
  border-left: 4px solid #0a4a8a;
  margin: 25px 0;
}

.contact-info p {
  margin: 8px 0;
  color: #333;
}

.contact-info strong {
  color: #05305c;
  font-size: 18px;
}

/* Acceptance Box */
.acceptance-box {
  background: linear-gradient(135deg, #05305c 0%, #0a4a8a 100%);
  color: #ffffff;
  padding: 35px;
  border-radius: 12px;
  margin: 50px 0;
  text-align: center;
  box-shadow: 0 10px 30px rgba(5, 48, 92, 0.3);
}

.acceptance-box h3 {
  color: #ffffff;
  font-size: 24px;
  margin-bottom: 15px;
  font-weight: 600;
}

.acceptance-box p {
  color: #ffffff;
  font-size: 15px;
  line-height: 1.8;
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* Privacy Summary (Privacy Policy specific) */
.privacy-summary {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  padding: 40px;
  border-radius: 12px;
  margin: 50px 0;
  border: 2px solid #2196f3;
}

.privacy-summary h3 {
  color: #05305c;
  font-size: 26px;
  margin-bottom: 30px;
  text-align: center;
  font-weight: 700;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
}

.summary-item {
  background: #ffffff;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.summary-item:hover {
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.summary-item h4 {
  color: #05305c;
  font-size: 18px;
  margin: 0 0 12px 0;
  font-weight: 600;
}

.summary-item p {
  color: #666;
  font-size: 15px;
  margin: 0;
  line-height: 1.6;
}

/* Footer */
.legal-footer {
  background: #05305c;
  color: #ffffff;
  padding: 30px 50px;
  margin-top: 80px;
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-content p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.footer-nav {
  display: flex;
  gap: 30px;
}

.footer-nav a {
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: #fabb2e;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .legal-main {
    padding: 50px 50px;
  }

  .toc ul {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .legal-header {
    padding: 20px 25px;
  }

  .brand-logo {
    height: 35px;
  }

  .back-link {
    font-size: 14px;
    padding: 8px 15px;
  }

  .legal-main {
    padding: 40px 25px;
  }

  .title-section h1 {
    font-size: 32px;
  }

  .intro-text {
    font-size: 16px;
  }

  .legal-section h2 {
    font-size: 26px;
  }

  .legal-section h3 {
    font-size: 20px;
  }

  .legal-section p,
  .legal-section li {
    font-size: 15px;
  }

  .toc {
    padding: 20px;
  }

  .toc ul {
    grid-template-columns: 1fr;
  }

  .acceptance-box {
    padding: 25px;
  }

  .acceptance-box h3 {
    font-size: 20px;
  }

  .acceptance-box p {
    font-size: 14px;
  }

  .footer-content {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .footer-nav {
    flex-direction: column;
    gap: 15px;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .legal-header {
    padding: 15px 20px;
  }

  .header-content {
    flex-direction: column;
    gap: 15px;
  }

  .back-link {
    width: 100%;
    justify-content: center;
  }

  .legal-main {
    padding: 30px 20px;
  }

  .title-section h1 {
    font-size: 28px;
  }

  .legal-section h2 {
    font-size: 24px;
  }

  .legal-section ul {
    padding-left: 20px;
  }

  .toc a {
    padding: 8px 12px;
    font-size: 14px;
  }

  .risk-warning {
    padding: 20px;
  }

  .privacy-summary {
    padding: 25px 20px;
  }

  .summary-item {
    padding: 20px;
  }
}

/* Print Styles */
@media print {
  body {
    background: #ffffff;
  }

  .legal-container {
    box-shadow: none;
  }

  .legal-header,
  .back-link,
  .legal-footer {
    display: none;
  }

  .legal-main {
    padding: 0;
  }

  .legal-section {
    page-break-inside: avoid;
  }

  .toc a {
    color: #000000;
  }

  .acceptance-box {
    background: #f0f0f0;
    color: #000000;
    border: 2px solid #000000;
  }

  .acceptance-box h3,
  .acceptance-box p {
    color: #000000;
  }
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection Color */
::selection {
  background: #0a4a8a;
  color: #ffffff;
}

::-moz-selection {
  background: #0a4a8a;
  color: #ffffff;
}

/* Focus Styles for Accessibility */
a:focus,
button:focus {
  outline: 2px solid #0a4a8a;
  outline-offset: 2px;
}

/* Loading Animation */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.loading {
  animation: shimmer 2s infinite;
  background: linear-gradient(to right, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
  background-size: 2000px 100%;
}
