/*
 * Legal Pages Master CSS
 * For: Terms, Privacy, Disclaimer, FAQ, Contact, About
 * YMYL 10/10 Compliant Design
 * Version: 1.0
 */

/* ============================================================================
   ROOT VARIABLES & THEME
   ============================================================================ */
:root {
  --primary: #22d3ee;
  --primary-dark: #0891b2;
  --primary-light: #67e8f9;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --success: #22c55e;
  --warning: #f59e0b;
  --info: #3b82f6;
  
  --bg-page: #0a0a0a;
  --bg-card: #1a1a1a;
  --bg-section: rgba(2,6,23,0.35);
  --bg-hover: rgba(34,211,238,0.05);
  
  --text-primary: #f1f5f9;
  --text-secondary: #e5e7eb;
  --text-muted: #94a3b8;
  --text-disabled: #64748b;
  
  --border-color: rgba(148,163,184,0.18);
  --border-light: rgba(148,163,184,0.1);
  --border-accent: rgba(34,211,238,0.3);
  
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.15);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.2);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.25);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Fira Code', 'Courier New', monospace;
  
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
}

body {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.75rem;
  color: var(--primary);
  border-bottom: 2px solid var(--border-accent);
  padding-bottom: 0.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.35rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
}

h4 {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-top: 1.25rem;
}

p {
  margin-bottom: 1rem;
  line-height: 1.85;
}

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

em {
  font-style: italic;
  color: var(--text-muted);
}

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

a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

/* ============================================================================
   CONTAINER & LAYOUT
   ============================================================================ */
.legal-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.legal-wrapper {
  min-height: 100vh;
  padding-top: 80px; /* Account for fixed header */
}

/* ============================================================================
   PAGE HEADER SECTION
   ============================================================================ */
.page-header {
  background: linear-gradient(135deg, rgba(34,211,238,0.05) 0%, rgba(2,6,23,0.3) 100%);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-accent);
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.page-header h1 {
  margin-bottom: 0.75rem;
  font-size: 2.25rem;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.page-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-meta-item strong {
  color: var(--primary);
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 0.75rem;
  font-style: italic;
}

/* ============================================================================
   BREADCRUMB NAVIGATION
   ============================================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb span[aria-current] {
  color: var(--primary);
  font-weight: 500;
}

.breadcrumb-separator {
  color: var(--text-disabled);
  user-select: none;
}

/* ============================================================================
   CARD COMPONENTS
   ============================================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-section {
  background: var(--bg-section);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

/* ============================================================================
   NOTICE & ALERT BOXES
   ============================================================================ */
.notice {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  border-left: 4px solid;
  position: relative;
}

.notice-legal {
  background: rgba(239,68,68,0.12);
  border-color: var(--danger);
  border: 2px solid rgba(239,68,68,0.3);
  text-align: center;
  padding: 2rem;
  border-radius: var(--radius-lg);
}

.notice-legal h2 {
  margin: 0 0 1rem 0;
  border: none;
  padding: 0;
  color: var(--danger);
  font-size: 1.5rem;
}

.notice-warning {
  background: rgba(239,68,68,0.1);
  border-color: var(--danger);
}

.notice-info {
  background: rgba(34,211,238,0.08);
  border-color: var(--primary);
}

.notice-success {
  background: rgba(34,197,94,0.08);
  border-color: var(--success);
}

.notice-tip {
  background: rgba(245,158,11,0.08);
  border-color: var(--warning);
}

/* ============================================================================
   TABLE OF CONTENTS
   ============================================================================ */
.toc {
  background: rgba(34,211,238,0.05);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin: 2rem 0;
}

.toc h2 {
  margin-top: 0;
  font-size: 1.35rem;
}

.toc-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.toc-list {
  list-style: none;
  padding: 0;
  columns: 2;
  column-gap: 2rem;
}

.toc-list li {
  margin-bottom: 0.75rem;
  break-inside: avoid;
}

.toc-list a {
  display: inline-block;
  padding: 0.35rem 0;
  color: var(--primary);
  border-bottom: 1px dashed rgba(34,211,238,0.4);
  transition: all var(--transition-fast);
}

.toc-list a:hover {
  border-bottom-style: solid;
  color: var(--primary-light);
  text-decoration: none;
  transform: translateX(4px);
}

/* ============================================================================
   LISTS
   ============================================================================ */
ul, ol {
  margin-left: 1.75rem;
  margin-bottom: 1.25rem;
}

li {
  margin-bottom: 0.65rem;
  line-height: 1.8;
}

.custom-list {
  list-style: none;
  padding-left: 0;
}

.custom-list li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.85rem;
}

.custom-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
  font-size: 1.1em;
}

.check-list li::before {
  content: "✓";
  color: var(--success);
}

.cross-list li::before {
  content: "✗";
  color: var(--danger);
}

/* ============================================================================
   GRID LAYOUTS
   ============================================================================ */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

/* ============================================================================
   CONTACT GRID
   ============================================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.contact-item {
  background: rgba(34,211,238,0.08);
  border: 1px solid rgba(34,211,238,0.2);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: all var(--transition-normal);
}

.contact-item:hover {
  background: rgba(34,211,238,0.12);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.contact-item-label {
  display: block;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.contact-item-value {
  color: var(--text-secondary);
  word-break: break-word;
}

/* ============================================================================
   FAQ COMPONENTS
   ============================================================================ */
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.faq-item:hover {
  border-color: var(--primary);
}

.faq-question {
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background var(--transition-fast);
}

.faq-question:hover {
  background: var(--bg-hover);
}

.faq-question::after {
  content: "▼";
  font-size: 0.8em;
  color: var(--primary);
  transition: transform var(--transition-normal);
}

.faq-item.active .faq-question::after {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.faq-item.active .faq-answer {
  max-height: 1000px;
}

.faq-answer-content {
  padding: 0 1.5rem 1.5rem;
  color: var(--text-secondary);
}

/* ============================================================================
   DEFINITION LIST
   ============================================================================ */
.definition-list {
  margin: 1.5rem 0;
}

.definition-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.definition-item:last-child {
  border-bottom: none;
}

.definition-term {
  font-weight: 600;
  color: var(--primary);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.definition-desc {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ============================================================================
   STATISTICS / INFO BOXES
   ============================================================================ */
.stat-box {
  background: var(--bg-section);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--bg-page);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34,211,238,0.3);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--bg-page);
}

/* ============================================================================
   FOOTER SECTION
   ============================================================================ */
.page-footer {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

.footer-meta strong {
  color: var(--primary);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* ============================================================================
   ANCHOR LINKS
   ============================================================================ */
.anchor {
  scroll-margin-top: 120px;
}

/* ============================================================================
   UTILITIES
   ============================================================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.font-sm { font-size: 0.875rem; }
.font-lg { font-size: 1.125rem; }
.font-xl { font-size: 1.25rem; }

.font-bold { font-weight: 600; }
.font-normal { font-weight: 400; }

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */
@media (max-width: 768px) {
  .legal-container {
    padding: 1.5rem 1rem;
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.35rem;
  }
  
  h3 {
    font-size: 1.15rem;
  }
  
  .page-header {
    padding: 1.75rem 1.25rem;
  }
  
  .page-header h1 {
    font-size: 1.65rem;
  }
  
  .toc-list {
    columns: 1;
  }
  
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
  }
  
  .card {
    padding: 1.25rem;
  }
  
  .notice {
    padding: 1.25rem;
  }
  
  .page-meta {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }
  
  .legal-container {
    padding: 1rem 0.75rem;
  }
  
  .card {
    padding: 1rem;
  }
  
  .notice {
    padding: 1rem;
  }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */
@media print {
  body {
    background: white;
    color: black;
  }
  
  .page-header,
  .card,
  .notice {
    border: 1px solid #ccc;
    box-shadow: none;
  }
  
  a {
    color: #0066cc;
    text-decoration: underline;
  }
  
  .breadcrumb,
  .btn {
    display: none;
  }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

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

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* ============================================================================
   END OF FILE
   ============================================================================ */