/* Legal Modal Styles - ECLYP5ED Neon Theme */

.legal-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

.legal-modal.active {
  display: block;
  opacity: 1;
}

/* Backdrop */
.legal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 18, 0.75);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

/* Main panel */
.legal-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: min(1100px, 95vw);
  max-height: 90vh;
  background: rgba(10, 10, 22, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid transparent;
  border-radius: 24px;
  overflow: hidden;
  transition: transform 0.3s ease-out;
  
  /* Neon ring border */
  background-image: linear-gradient(rgba(10, 10, 22, 0.9), rgba(10, 10, 22, 0.9)),
                    linear-gradient(135deg, #00b8ff, #ff00ff, #a46bff);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  
  /* Outer glow */
  box-shadow: 0 0 80px 20px rgba(164, 107, 255, 0.2),
              0 0 120px 40px rgba(0, 184, 255, 0.1);
}

.legal-modal.active .legal-panel {
  transform: translate(-50%, -50%) scale(1);
}

/* Header */
.legal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.legal-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  background: linear-gradient(135deg, #00b8ff, #a46bff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.legal-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Language toggle */
.legal-lang-toggle {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.legal-lang-toggle button {
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: #a9a9c6;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.legal-lang-toggle button.active {
  background: linear-gradient(135deg, #00b8ff, #a46bff);
  color: #fff;
  box-shadow: 0 0 20px rgba(164, 107, 255, 0.5);
}

.legal-lang-toggle button:hover:not(.active) {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Icon buttons */
.legal-icon-btn,
.legal-close-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #a9a9c6;
  cursor: pointer;
  transition: all 0.2s ease;
}

.legal-icon-btn:hover,
.legal-close-btn:hover {
  color: #fff;
  border-color: var(--neon-purple);
  box-shadow: 0 0 20px rgba(164, 107, 255, 0.5);
  transform: scale(1.1);
}

.legal-close-btn:hover {
  transform: scale(1.1) rotate(90deg);
}

.legal-icon-btn.copied::after {
  content: "✓";
  position: absolute;
  color: #33ff8c;
}

/* Tabs */
.legal-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.legal-tab {
  flex: 1;
  padding: 16px;
  background: transparent;
  border: none;
  color: #a9a9c6;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.legal-tab.active {
  color: #fff;
}

.legal-tab.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #00b8ff, #ff00ff);
  box-shadow: 0 0 10px rgba(0, 184, 255, 0.5);
}

/* Search bar */
.legal-search-bar {
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.legal-search-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(164, 107, 255, 0.3);
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
}

.legal-search-input:focus {
  outline: none;
  border-color: var(--neon-purple);
  box-shadow: 0 0 0 2px rgba(164, 107, 255, 0.3);
}

/* Body layout */
.legal-body {
  display: flex;
  height: calc(90vh - 200px);
}

/* Table of contents */
.legal-toc {
  width: 240px;
  padding: 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  overflow-y: auto;
}

.legal-toc-mobile {
  display: none;
}

.legal-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.legal-toc-list li {
  margin-bottom: 12px;
}

.legal-toc-link {
  color: #a9a9c6;
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.5;
  transition: all 0.2s ease;
  display: block;
  padding: 4px 0;
}

.legal-toc-link:hover {
  color: #fff;
  padding-left: 8px;
}

.legal-toc-link.active {
  color: var(--neon-purple);
  font-weight: 600;
  padding-left: 8px;
  border-left: 2px solid var(--neon-purple);
  padding-left: 12px;
}

/* Content area */
.legal-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

.legal-section {
  margin-bottom: 48px;
}

.legal-section h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  margin-bottom: 16px;
  padding-top: 24px;
}

.legal-section p {
  line-height: 1.7;
  color: #dfe1ff;
  margin-bottom: 16px;
}

/* Footer */
.legal-footer {
  padding: 24px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.legal-footer-text,
.legal-effective-date {
  font-size: 0.85rem;
  color: #a9a9c6;
  margin: 0;
}

.legal-cookie-settings {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: #cbd0ff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.legal-cookie-settings:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--neon-purple);
  box-shadow: 0 0 20px rgba(164, 107, 255, 0.3);
}

/* Mobile responsive */
@media (max-width: 1024px) {
  .legal-panel {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    transform: translate(-50%, -50%);
  }
  
  .legal-header {
    padding: 16px 20px;
  }
  
  .legal-title {
    font-size: 1.25rem;
  }
  
  .legal-lang-toggle {
    display: none;
  }
  
  .legal-body {
    flex-direction: column;
    height: calc(100vh - 180px);
  }
  
  .legal-toc {
    display: none;
  }
  
  .legal-toc-mobile {
    display: block;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .legal-toc-toggle {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #cbd0ff;
    font-size: 0.9rem;
    cursor: pointer;
  }
  
  .legal-content {
    padding: 20px;
  }
  
  .legal-footer {
    flex-direction: column;
    padding: 16px 20px;
    text-align: center;
  }
}

/* Print styles */
@media print {
  .legal-backdrop,
  .legal-header,
  .legal-tabs,
  .legal-toc,
  .legal-footer {
    display: none !important;
  }
  
  .legal-panel {
    width: 100%;
    max-width: none;
    height: auto;
    position: static;
    transform: none;
    background: white;
    color: black;
    border: none;
    box-shadow: none;
  }
  
  .legal-content {
    padding: 0;
  }
  
  .legal-section h3 {
    color: black;
    page-break-after: avoid;
  }
  
  .legal-section p {
    color: black;
  }
  
  .legal-section {
    page-break-inside: avoid;
  }
}

/* Laser sweep animation on open */
@keyframes laserSweep {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(100%);
    opacity: 0;
  }
}

.legal-modal.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00b8ff, #ff00ff, #a46bff, transparent);
  animation: laserSweep 0.25s ease-out forwards;
  pointer-events: none;
  z-index: 1001;
}

/* Accessibility */
.legal-modal:focus-within .legal-panel {
  box-shadow: 0 0 0 3px rgba(43, 217, 255, 0.6),
              0 0 80px 20px rgba(164, 107, 255, 0.2),
              0 0 120px 40px rgba(0, 184, 255, 0.1);
}