/* =========================
   ROOT VARIABLES
========================= */
:root {
  --bg-dark: #0b1220;
  --card-bg: #0f1a2e;
  --text-main: #e8eefc;
  --text-muted: rgba(232, 238, 252, 0.7);
  --border-soft: rgba(232, 238, 252, 0.12);
  
  --bg-table-header: rgba(255, 255, 255, 0.04);
  --bg-table-row: rgba(255, 255, 255, 0.02);
  --bg-table-row-alt: rgba(255, 255, 255, 0.015);
  --border-table: rgba(232, 238, 252, 0.08);

  --fixid-blue: #0b5fff;
  --fixid-orange: #ff7a18;
  --fixid-blue-light: rgba(11, 95, 255, 0.15);
  --fixid-blue-border: rgba(11, 95, 255, 0.3);

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;

  --shadow-card: 0 12px 30px rgba(0, 0, 0, 0.35);
  --shadow-table: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.1);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.35s ease;
}

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

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================
   TYPOGRAPHY
========================= */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.3px;
}

h1 {
  font-size: 20px;
}

h2 {
  font-size: 16px;
  margin-top: 28px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
}

h3 {
  font-size: 14px;
  margin-top: 20px;
  margin-bottom: 6px;
}

p {
  margin-bottom: 14px;
  font-size: 14px;
  color: rgba(232, 238, 252, 0.92);
}

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

em {
  font-style: italic;
  color: rgba(232, 238, 252, 0.85);
}

.muted {
  color: var(--text-muted);
  font-size: 13px;
}

/* =========================
   LINKS
========================= */
a {
  color: var(--fixid-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
  position: relative;
}

a:hover {
  color: #4d8dff;
}

a:after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--fixid-blue);
  opacity: 0.4;
  transition: opacity var(--transition-fast);
}

a:hover:after {
  opacity: 1;
}

a:focus-visible {
  outline: 2px solid var(--fixid-blue);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* =========================
   LISTS
========================= */
ul, ol {
  padding-left: 18px;
  margin: 12px 0;
}

li {
  margin-bottom: 6px;
  font-size: 14px;
  color: rgba(232, 238, 252, 0.92);
}

li:last-child {
  margin-bottom: 0;
}

/* =========================
   TABLES (ENHANCED UI/UX)
========================= */
.data-table,
.legal-table,
.retention-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 22px 0;
  font-size: 13px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-table);
  border: 1px solid var(--border-table);
}

.data-table th,
.legal-table th,
.retention-table th {
  background: var(--bg-table-header);
  padding: 14px 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid var(--border-table);
  color: var(--text-main);
  font-size: 13px;
  letter-spacing: 0.3px;
  position: relative;
}

.data-table th:not(:last-child),
.legal-table th:not(:last-child),
.retention-table th:not(:last-child) {
  border-right: 1px solid var(--border-table);
}

.data-table td,
.legal-table td,
.retention-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-table);
  vertical-align: top;
  color: rgba(232, 238, 252, 0.88);
  transition: background-color var(--transition-fast);
}

.data-table td:not(:last-child),
.legal-table td:not(:last-child),
.retention-table td:not(:last-child) {
  border-right: 1px solid var(--border-table);
}

.data-table tr,
.legal-table tr,
.retention-table tr {
  background: var(--bg-table-row);
}

.data-table tr:nth-child(even),
.legal-table tr:nth-child(even),
.retention-table tr:nth-child(even) {
  background: var(--bg-table-row-alt);
}

.data-table tr:hover,
.legal-table tr:hover,
.retention-table tr:hover {
  background: rgba(11, 95, 255, 0.05);
}

.data-table tr:last-child td,
.legal-table tr:last-child td,
.retention-table tr:last-child td {
  border-bottom: none;
}

/* Table column highlighting */
.data-table th:first-child,
.legal-table th:first-child,
.retention-table th:first-child {
  border-left: 2px solid var(--fixid-blue-border);
}

/* Responsive tables */
@media (max-width: 768px) {
  .data-table,
  .legal-table,
  .retention-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    border-radius: var(--radius-sm);
  }
  
  .data-table::-webkit-scrollbar,
  .legal-table::-webkit-scrollbar,
  .retention-table::-webkit-scrollbar {
    height: 6px;
  }
  
  .data-table::-webkit-scrollbar-track,
  .legal-table::-webkit-scrollbar-track,
  .retention-table::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
  }
  
  .data-table::-webkit-scrollbar-thumb,
  .legal-table::-webkit-scrollbar-thumb,
  .retention-table::-webkit-scrollbar-thumb {
    background: var(--border-soft);
    border-radius: var(--radius-full);
  }
  
  .data-table::-webkit-scrollbar-thumb:hover,
  .legal-table::-webkit-scrollbar-thumb:hover,
  .retention-table::-webkit-scrollbar-thumb:hover {
    background: rgba(232, 238, 252, 0.2);
  }
}

/* Table compact variant */
.table-compact th,
.table-compact td {
  padding: 10px 8px;
  font-size: 12px;
}

/* =========================
   LAYOUT CONTAINER
========================= */
.container {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
}

.main {
  padding: 28px 0;
}

/* =========================
   HEADER
========================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(11, 18, 32, 0.85);
  border-bottom: 1px solid var(--border-soft);
  -webkit-backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: baseline;
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.brand:hover {
  opacity: 0.9;
}

.brand-mark {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.3px;
  color: var(--text-main);
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

/* =========================
   LANGUAGE SWITCH
========================= */
.lang-switch {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
}

.lang-btn {
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  border: none;
  transition: all var(--transition-fast);
  min-width: 80px;
  text-align: center;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.lang-btn.active {
  background: var(--fixid-blue-light);
  color: var(--text-main);
  box-shadow: var(--shadow-inset);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--fixid-blue);
  outline-offset: 2px;
}

/* =========================
   CARD
========================= */
.card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.015) 100%
  );
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

/* =========================
   DOCUMENT HEADER
========================= */
.doc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.01);
}

.doc-head h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

/* =========================
   DOCUMENT TOOLS
========================= */
.doc-tools {
  display: flex;
  gap: 10px;
}

button.secondary {
  border-radius: var(--radius-md);
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border: 1px solid var(--border-soft);
  font-weight: 500;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

button.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(232, 238, 252, 0.2);
  transform: translateY(-1px);
}

button.secondary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-inset);
}

button.secondary:focus-visible {
  outline: 2px solid var(--fixid-blue);
  outline-offset: 2px;
}

/* =========================
   NOTICE
========================= */
.notice {
  padding: 14px 20px;
  background: rgba(11, 95, 255, 0.12);
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
  line-height: 1.5;
  border-left: 3px solid var(--fixid-blue);
  margin: 0;
}

.notice strong {
  color: #a6c6ff;
}

/* =========================
   DOCUMENT CONTENT
========================= */
.doc {
  padding: 22px 20px;
}

.doc > *:first-child {
  margin-top: 0;
}

.doc h2 {
  position: relative;
  padding-left: 12px;
}

.doc h2:before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 70%;
  background: var(--fixid-blue);
  border-radius: var(--radius-xs);
}

/* =========================
   DOCUMENT FOOTER
========================= */
.doc-footer {
  padding: 18px 20px;
  border-top: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.01);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.7fr;
  gap: 20px;
}

.footer-grid h3 {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.3px;
  color: var(--text-main);
}

.footer-grid p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.footer-grid strong {
  color: var(--text-main);
  font-weight: 600;
}

/* =========================
   SITE FOOTER
========================= */
.site-footer {
  border-top: 1px solid var(--border-soft);
  background: rgba(11, 18, 32, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.footer-inner {
  padding: 20px 0 26px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* =========================
   RESPONSIVE DESIGN
========================= */
@media (max-width: 768px) {
  :root {
    --radius-lg: 12px;
    --radius-md: 10px;
  }
  
  .container {
    width: calc(100% - 20px);
  }
  
  .main {
    padding: 20px 0;
  }
  
  .doc-head {
    flex-direction: column;
    padding: 16px;
  }
  
  .doc {
    padding: 16px;
  }
  
  .doc h2 {
    font-size: 15px;
    margin-top: 20px;
  }
  
  p, li {
    font-size: 13px;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .lang-switch {
    align-self: stretch;
    justify-content: stretch;
  }
  
  .lang-btn {
    flex: 1;
  }
  
  .data-table th,
  .legal-table th,
  .retention-table th,
  .data-table td,
  .legal-table td,
  .retention-table td {
    padding: 10px 8px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .doc-tools {
    flex-direction: column;
    width: 100%;
  }
  
  button.secondary {
    width: 100%;
    justify-content: center;
  }
  
  .brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}

/* =========================
   PRINT STYLES (PDF)
========================= */
@media print {
  :root {
    --bg-dark: white;
    --text-main: black;
    --text-muted: #666;
    --border-soft: #ddd;
    --card-bg: white;
    --fixid-blue: #0066cc;
  }
  
  * {
    color: black !important;
    background: white !important;
  }
  
  body {
    background: white !important;
    font-size: 12pt;
    line-height: 1.4;
  }
  
  .site-header,
  .site-footer,
  .doc-tools,
  .notice,
  .lang-switch {
    display: none !important;
  }
  
  .container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .card {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
  
  .doc-head {
    border-bottom: 2px solid black !important;
    padding: 20px 0 !important;
  }
  
  .doc {
    padding: 0 !important;
  }
  
  .doc-footer {
    border-top: 2px solid black !important;
    padding: 20px 0 !important;
  }
  
  h1 {
    font-size: 18pt !important;
    margin-bottom: 10pt !important;
  }
  
  h2 {
    font-size: 14pt !important;
    margin-top: 20pt !important;
    border-bottom: 1px solid black !important;
    padding-bottom: 4pt !important;
    page-break-after: avoid;
  }
  
  h2:before {
    display: none !important;
  }
  
  p, li {
    font-size: 11pt !important;
    margin-bottom: 8pt !important;
  }
  
  a {
    color: black !important;
    text-decoration: none !important;
  }
  
  a:after {
    display: none !important;
  }
  
  a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
  }
  
  /* Print tables */
  .data-table,
  .legal-table,
  .retention-table {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    margin: 15pt 0 !important;
    break-inside: avoid;
  }
  
  .data-table th,
  .legal-table th,
  .retention-table th {
    background: #f5f5f5 !important;
    border: 1px solid #ccc !important;
    color: black !important;
    padding: 8pt 6pt !important;
  }
  
  .data-table td,
  .legal-table td,
  .retention-table td {
    border: 1px solid #ccc !important;
    color: black !important;
    padding: 6pt !important;
  }
  
  /* Ensure URLs are visible */
  @page {
    margin: 0.5in;
  }
  
  /* Hide hover effects */
  *:hover {
    transform: none !important;
  }
}

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

/* Focus styles for better accessibility */
:focus-visible {
  outline: 2px solid var(--fixid-blue);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .card {
    transition: none !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --text-main: #ffffff;
    --text-muted: #cccccc;
    --border-soft: #666666;
    --fixid-blue: #4d8dff;
  }
  
  .notice {
    border-left: 4px solid var(--fixid-blue);
  }
  
  .data-table,
  .legal-table,
  .retention-table {
    border: 2px solid var(--border-soft);
  }
}

/* =========================
   SCROLLBAR STYLING
========================= */
@media (min-width: 769px) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  
  ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-xs);
  }
  
  ::-webkit-scrollbar-thumb {
    background: rgba(232, 238, 252, 0.15);
    border-radius: var(--radius-xs);
    border: 2px solid transparent;
    background-clip: padding-box;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: rgba(232, 238, 252, 0.25);
    background-clip: padding-box;
  }
  
  ::-webkit-scrollbar-corner {
    background: transparent;
  }
}

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

.card {
  animation: fadeIn 0.4s ease-out;
}

/* =========================
   SPECIAL ELEMENTS
========================= */
/* Code blocks for definitions */
.doc strong:first-of-type {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  background: rgba(11, 95, 255, 0.1);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(11, 95, 255, 0.2);
  font-size: 0.9em;
}

/* Quotes and important notes */
.doc > p:has(strong:first-child) {
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--fixid-blue);
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  margin: 16px 0;
}

/* Horizontal rule for section breaks */
.doc hr {
  border: none;
  height: 1px;
  background: var(--border-soft);
  margin: 24px 0;
  opacity: 0.3;
}

/* =========================
   END OF STYLES
========================= */