/* ==========================================================================
   Spin Wheel - Legal Pages Mobile-Friendly Design System (Light Theme)
   ========================================================================== */

:root {
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-light: #f5f3ff;
  --primary-border: #ddd6fe;
  --primary-glow: rgba(124, 58, 237, 0.15);
  
  --bg-main: #f8fafc;
  --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e8eef8 50%, #c3cfe2 100%);
  --card-bg: #ffffff;
  --card-border: rgba(226, 232, 240, 0.9);
  --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.06), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
  
  --text-main: #1e293b;
  --text-muted: #475569;
  --text-subtle: #64748b;
  
  --nav-bg: rgba(255, 255, 255, 0.92);
  --nav-border: rgba(226, 232, 240, 0.9);
  
  --code-bg: #f1f5f9;
  --table-header-bg: #f8fafc;
  --table-stripe: #fafafa;
  --table-border: #e2e8f0;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --callout-bg: #f0fdf4;
  --callout-border: #bbf7d0;
  --callout-text: #166534;
}

/* Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.65;
  color: var(--text-muted);
  background: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  padding-bottom: 40px;
  -webkit-font-smoothing: antialiased;
}

/* Headings smooth scroll offset under sticky header */
h1, h2, h3, h4, h5, h6 {
  scroll-margin-top: 76px;
}

/* Sticky Top Navigation Bar */
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--nav-border);
  padding: 10px 16px;
  transition: all 0.3s ease;
}

.top-navbar-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  min-height: 36px;
}

.nav-back-btn:hover, .nav-back-btn:active {
  background: var(--primary);
  color: #ffffff;
}

.nav-title-badge {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-subtle);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 4px 10px;
  border-radius: 9999px;
  white-space: nowrap;
}

/* Main Page Container */
.page-wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px 12px 36px;
}

@media (min-width: 640px) {
  .page-wrapper {
    padding: 28px 20px 48px;
  }
}

.document-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 18px 16px;
}

@media (min-width: 640px) {
  .document-card {
    padding: 32px 36px;
    border-radius: var(--radius-xl);
  }
}

/* Markdown Content Styling */
#content {
  color: var(--text-muted);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Compact Headline Styling */
#content h1 {
  color: #7c3aed;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid #ddd6fe;
}

#content h2 {
  color: var(--text-main);
  font-size: clamp(1.05rem, 3vw, 1.3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 28px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}

#content h3 {
  color: var(--text-main);
  font-size: clamp(0.925rem, 2.2vw, 1.1rem);
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 8px;
}

#content p {
  margin-bottom: 14px;
  font-size: 0.925rem;
  line-height: 1.65;
  color: #475569;
}

#content hr {
  border: 0;
  height: 1px;
  background: var(--card-border);
  margin: 24px 0;
}

#content ul, #content ol {
  margin-left: 20px;
  margin-bottom: 16px;
}

#content li {
  margin-bottom: 6px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #475569;
}

#content li::marker {
  color: var(--primary);
}

#content a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dashed var(--primary-border);
  transition: all 0.2s ease;
  word-break: break-word;
}

#content a:hover {
  color: var(--primary-hover);
  border-bottom-style: solid;
  background: var(--primary-light);
  border-radius: 2px;
}

#content strong {
  color: var(--text-main);
  font-weight: 600;
}

#content blockquote {
  background: var(--code-bg);
  border-left: 4px solid var(--primary);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 16px 0;
  font-style: italic;
}

/* Callout Banner */
.callout-box {
  background: var(--callout-bg);
  border: 1px solid var(--callout-border);
  color: var(--callout-text);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin: 16px 0;
  font-size: 0.875rem;
}

/* Mobile Friendly Responsive Table Styling */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 20px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--table-border);
}

.table-wrapper::-webkit-scrollbar {
  height: 5px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: var(--primary-border);
  border-radius: 3px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.825rem;
  min-width: 520px;
}

th {
  background: var(--table-header-bg);
  color: var(--text-main);
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 2px solid var(--table-border);
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--table-border);
  vertical-align: top;
  color: var(--text-muted);
}

tr:nth-child(even) td {
  background: var(--table-stripe);
}

.table-scroll-hint {
  display: block;
  font-size: 0.725rem;
  color: var(--text-subtle);
  margin-top: -12px;
  margin-bottom: 14px;
  text-align: right;
}

@media (min-width: 640px) {
  .table-scroll-hint {
    display: none;
  }
}

/* Clean Email Link Styling */
.email-link {
  color: var(--primary) !important;
  font-weight: 600;
  text-decoration: underline !important;
  text-decoration-color: var(--primary-border) !important;
  text-underline-offset: 3px;
  word-break: break-all;
  transition: all 0.2s ease;
  border-bottom: none !important;
}

.email-link:hover {
  color: var(--primary-hover) !important;
  background: var(--primary-light);
  border-radius: 4px;
  text-decoration-color: var(--primary) !important;
}

/* Bottom Action Navigation Footer */
.legal-footer-nav {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 640px) {
  .legal-footer-nav {
    flex-direction: row;
  }
}

.footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  min-height: 44px;
}

@media (min-width: 640px) {
  .footer-btn {
    width: auto;
  }
}

.footer-btn-primary {
  background: var(--primary);
  color: #ffffff !important;
  border: none;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.footer-btn-primary:hover {
  background: var(--primary-hover);
}

.footer-btn-secondary {
  background: var(--card-bg);
  color: var(--text-muted) !important;
  border: 1px solid var(--card-border);
}

.footer-btn-secondary:hover {
  background: var(--code-bg);
  color: var(--text-main) !important;
}

/* Scroll To Top Button */
.scroll-top-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 90;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top-btn:hover {
  background: var(--primary-hover);
}

/* Loading State */
.loading-skeleton {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-subtle);
  font-size: 0.925rem;
}
