/* ==========================================================================
   DESIGN SYSTEM & CUSTOM PROPERTIES (Sleek Dark Mode & Premium Typography)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* Colors */
  --bg-dark: #080b11;
  --bg-card: rgba(15, 22, 38, 0.7);
  --bg-card-hover: rgba(22, 32, 56, 0.8);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-color-active: rgba(59, 130, 246, 0.4);
  
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.15);
  --secondary: #8b5cf6;
  --secondary-glow: rgba(139, 92, 246, 0.15);
  --accent: #22c55e;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Fonts */
  --font-display: 'Outfit', sans-serif;
  --font-sans: 'Plus Jakarta Sans', sans-serif;
  
  /* Layout */
  --max-width: 1200px;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* Background Gradients & Glows */
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1400px;
  height: 600px;
  background: radial-gradient(circle at 50% -100px, rgba(59, 130, 246, 0.18) 0%, rgba(139, 92, 246, 0.08) 50%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}

body::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 400px;
  background: radial-gradient(circle at 50% 120%, rgba(139, 92, 246, 0.1) 0%, transparent 80%);
  pointer-events: none;
  z-index: -1;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  border: 2px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Selection */
::selection {
  background: var(--primary);
  color: #fff;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
}

p {
  margin-bottom: 1.25rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--secondary);
}

/* ==========================================================================
   LAYOUT & CONTAINER
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header & Navigation */
header {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 11, 17, 0.8);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.logo-icon svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-subtext {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Back Link Button */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.back-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

/* Hero Section */
.hero {
  padding: 5rem 0 3.5rem;
  text-align: center;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

/* Search Bar & Controls Area */
.controls-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

/* Premium Tabs Switcher */
.tabs-container {
  display: inline-flex;
  background: rgba(15, 22, 38, 0.8);
  border: 1px solid var(--border-color);
  padding: 0.375rem;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}

.tab-btn {
  padding: 0.75rem 1.75rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.tab-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Search Input */
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
}

.search-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  background: rgba(15, 22, 38, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition);
}

.search-input:focus + .search-icon {
  color: var(--primary);
}

.search-clear-btn {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
}

.search-clear-btn:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   MAIN CONTENT AREA (Split Layout with Index)
   ========================================================================== */
.main-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
  margin-bottom: 6rem;
}

/* Sidebar Index / Sticky Navigation */
.sidebar-nav {
  position: sticky;
  top: 120px;
  height: fit-content;
}

.nav-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.nav-card-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-card-title svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.index-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.index-item a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  border-left: 2px solid transparent;
}

.index-item a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.index-item.active a {
  color: var(--primary);
  background: rgba(59, 130, 246, 0.04);
  border-left-color: var(--primary);
  font-weight: 600;
}

/* Content Panel */
.content-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3.5rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

/* Glow highlights inside card */
.content-panel::before {
  content: "";
  position: absolute;
  top: -150px;
  right: -150px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  pointer-events: none;
}

/* Content Switcher Wrapper */
.legal-content-wrapper {
  position: relative;
}

.legal-document {
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.legal-document.active {
  display: block;
}

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

/* Legal Document Styles */
.legal-doc-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.last-updated {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.last-updated svg {
  width: 14px;
  height: 14px;
}

.legal-doc-header h2 {
  font-size: 2.25rem;
  letter-spacing: -0.02em;
}

/* Legal Content Headings & Text */
.legal-body section {
  margin-bottom: 2.5rem;
  scroll-margin-top: 120px; /* Offset for sticky header */
}

.legal-body section:last-child {
  margin-bottom: 0;
}

.legal-body h3 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-num {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 0.125rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.legal-body p {
  color: var(--text-secondary);
  font-size: 0.975rem;
  line-height: 1.7;
  text-align: justify;
}

/* Highlights & Callout Boxes */
.callout-box {
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--secondary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.callout-box p {
  margin-bottom: 0;
  font-size: 0.925rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* Custom Lists */
.legal-list {
  list-style: none;
  margin: 1.25rem 0 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.legal-list li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.legal-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.625rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

/* Contact Block Card */
.contact-card {
  margin-top: 2rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 1px solid rgba(59, 130, 246, 0.1);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-card h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.contact-info-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  list-style: none;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.contact-info-item svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

/* Search Highlights */
mark.highlight {
  background: rgba(234, 179, 8, 0.25);
  color: #fff;
  border-bottom: 2px solid #eab308;
  padding: 0 2px;
  border-radius: 2px;
}

/* No Results State */
.no-results {
  text-align: center;
  padding: 3rem 1rem;
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.no-results svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.no-results h4 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.no-results p {
  color: var(--text-muted);
  font-size: 0.925rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 0;
  background: rgba(6, 9, 14, 0.6);
  backdrop-filter: blur(10px);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.footer-copyright {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.footer-link a {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition);
}

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

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .sidebar-nav {
    position: static;
  }
  
  .nav-card {
    padding: 1.25rem;
  }
  
  .index-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .index-item a {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 0.75rem;
  }
  
  .index-item.active a {
    border-left-color: transparent;
    border-bottom-color: var(--primary);
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
  
  .container {
    padding: 0 1.5rem;
  }
  
  .hero {
    padding: 3.5rem 0 2.5rem;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .content-panel {
    padding: 2rem;
  }
  
  .controls-bar {
    width: 100%;
  }
  
  .tabs-container {
    width: 100%;
  }
  
  .tab-btn {
    flex: 1;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  
  .footer-links {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .content-panel {
    padding: 1.5rem;
  }
  
  .contact-info-list {
    grid-template-columns: 1fr;
  }
}
