/* ==========================================================================
   PlayTerabox Legal Suite - Ultra-Premium Luxury Design System
   Fast Loading • GPU-Accelerated 3D Effects • Responsive Glassmorphism
   Publisher: MSW Presents Tech (https://mswpresents.tech)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  --bg-main: #08080d;
  --bg-card: rgba(18, 18, 28, 0.72);
  --bg-card-hover: rgba(26, 26, 40, 0.88);
  --bg-elevated: rgba(255, 255, 255, 0.04);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(66, 133, 244, 0.5);

  --accent-blue: #4285f4;
  --accent-purple: #9b51e0;
  --accent-pink: #ec4899;
  --accent-green: #34c759;
  --accent-amber: #f59e0b;
  --accent-cyan: #00e5ff;

  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --shadow-luxury: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 30px -10px rgba(66, 133, 244, 0.15);
  --shadow-glow: 0 0 25px rgba(66, 133, 244, 0.25);
  --rainbow-gradient: linear-gradient(135deg, #4285f4, #9b51e0, #ea4335, #fbbc05, #34a853, #4285f4);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-main);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Background Ambient Orbs */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
}

body::before {
  top: -150px;
  left: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-blue), var(--accent-purple));
  animation: floatOrb 18s ease-in-out infinite alternate;
}

body::after {
  bottom: 5%;
  right: 5%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--accent-cyan), var(--accent-green));
  animation: floatOrb 22s ease-in-out infinite alternate-reverse;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 70px) scale(0.95); }
}

/* Reading Progress Bar */
#readingProgress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--rainbow-gradient);
  background-size: 300% 300%;
  animation: rainbowShift 6s linear infinite;
  z-index: 10000;
  transition: width 0.1s ease-out;
}

@keyframes rainbowShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Header & Navigation */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(8, 8, 13, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

header.site-header.scrolled {
  background: rgba(8, 8, 13, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  filter: drop-shadow(0 2px 8px rgba(66, 133, 244, 0.4));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-link:hover .brand-logo-img {
  transform: scale(1.08) rotate(-4deg);
}

.badge-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(66, 133, 244, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(66, 133, 244, 0.3);
  text-transform: uppercase;
}

/* Nav Links */
nav.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

nav.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
  position: relative;
}

nav.nav-links a:hover,
nav.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

nav.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-blue);
}

.nav-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-cta-btn:hover {
  background: #fff;
  color: #000;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* Main Layout */
.main-wrapper {
  max-width: 1200px;
  width: 100%;
  margin: 2.5rem auto 5rem;
  padding: 0 1.5rem;
  flex: 1;
  position: relative;
  z-index: 1;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.breadcrumbs a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

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

.breadcrumbs span.separator {
  opacity: 0.4;
}

.breadcrumbs span.current {
  color: var(--text-primary);
  font-weight: 500;
}

/* Hero Section for Hub / Documents */
.hero-hub {
  text-align: center;
  margin-bottom: 3.5rem;
  position: relative;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(66, 133, 244, 0.1);
  border: 1px solid rgba(66, 133, 244, 0.25);
  font-size: 0.78rem;
  font-weight: 600;
  color: #93c5fd;
  margin-bottom: 1.25rem;
}

.hero-hub h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-hub p.subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto;
}

/* 3D Interactive Card Grid */
.cards-grid-3d {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
  margin-bottom: 4rem;
  perspective: 1000px;
}

.card-3d-item {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.4s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.card-3d-item:hover {
  transform: translateY(-6px) rotateX(2deg) rotateY(-2deg);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), var(--shadow-glow);
}

.card-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  transition: transform 0.3s ease;
}

.card-3d-item:hover .card-icon-wrapper {
  transform: scale(1.1) translateZ(20px);
}

.card-3d-item h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-3d-item h3 .arrow-icon {
  font-size: 1rem;
  opacity: 0.4;
  transition: all 0.2s ease;
}

.card-3d-item:hover h3 .arrow-icon {
  opacity: 1;
  transform: translate(3px, -3px);
  color: var(--accent-cyan);
}

.card-3d-item p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex: 1;
}

.card-footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

/* Document Layout (Article + Sidebar) */
.doc-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

@media (max-width: 960px) {
  .doc-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Sidebar Table of Contents */
aside.toc-sidebar {
  position: sticky;
  top: 90px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

aside.toc-sidebar h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

ul.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

ul.toc-list a {
  display: block;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.84rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  line-height: 1.35;
}

ul.toc-list a:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

ul.toc-list a.active {
  color: #60a5fa;
  background: rgba(66, 133, 244, 0.12);
  font-weight: 600;
  border-left: 2px solid var(--accent-blue);
}

/* Document Content Card */
article.doc-content {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 4vw, 3.5rem);
  box-shadow: var(--shadow-luxury);
  position: relative;
}

.doc-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
}

.doc-header h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.8rem;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.doc-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.doc-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-elevated);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

/* Legal Body Typography */
.doc-body section {
  margin-bottom: 2.75rem;
  scroll-margin-top: 100px;
}

.doc-body h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.doc-body h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.1em;
  background: var(--accent-blue);
  border-radius: 2px;
}

.doc-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.doc-body p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 1.15rem;
}

.doc-body ul, .doc-body ol {
  margin: 0.75rem 0 1.25rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.75;
}

.doc-body li {
  margin-bottom: 0.5rem;
}

.doc-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Callout Box / Notice */
.legal-callout {
  background: rgba(66, 133, 244, 0.08);
  border: 1px solid rgba(66, 133, 244, 0.25);
  border-left: 4px solid var(--accent-blue);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  color: #cbd5e1;
}

.legal-callout.warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
  border-left-color: var(--accent-amber);
  color: #fef3c7;
}

.legal-callout.success {
  background: rgba(52, 199, 89, 0.08);
  border-color: rgba(52, 199, 89, 0.25);
  border-left-color: var(--accent-green);
  color: #dcfce7;
}

/* Quick Action Toolbar (Print, Copy Link, Share) */
.doc-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.tool-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Toast Notification */
#toastBox {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(18, 18, 28, 0.95);
  border: 1px solid var(--border-focus);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), var(--shadow-glow);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 10001;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#toastBox.show {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
footer.site-footer {
  background: rgba(5, 5, 10, 0.92);
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 0 2rem;
  position: relative;
  z-index: 10;
}

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

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s ease;
}

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

.footer-bottom {
  padding-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.contact-email-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: #60a5fa;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  transition: all 0.2s ease;
}

.contact-email-pill:hover {
  background: rgba(66, 133, 244, 0.15);
  border-color: rgba(66, 133, 244, 0.4);
}

/* Print Stylesheet */
@media print {
  header.site-header,
  footer.site-footer,
  aside.toc-sidebar,
  .doc-toolbar,
  #readingProgress,
  #toastBox,
  body::before,
  body::after {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
  }

  article.doc-content {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .doc-body h2, .doc-body h3, .doc-body strong, .doc-header h1 {
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
  }

  .doc-body p, .doc-body li {
    color: #222 !important;
  }
}
