/**
 * Policy Pages Common Styles
 * Used by EULA and Privacy Policy pages
 */

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

/* Base - Figma tokens */
:root {
  /* Font Size */
  --font-size-heading-xlarge: 24px;
  --font-size-heading-small: 18px;
  --font-size-heading-tiny: 14px;
  --font-size-body-medium: 16px;
  --font-size-body-small: 14px;
  --font-size-label-xsmall: 12px;

  /* Line Height */
  --line-height-heading-xlarge: 32px;
  --line-height-heading-small: 28px;
  --line-height-body-medium: 26px;
  --line-height-body-small: 24px;
  --line-height-body-xsmall: 20px;

  /* Font Weight */
  --font-weight-bold: 700;
  --font-weight-semibold: 600;
  --font-weight-medium: 500;
  --font-weight-regular: 400;

  /* Letter Spacing */
  --letter-spacing-tight: -0.4px;
  --letter-spacing-normal: -0.15px;
  --letter-spacing-wide: 0.6px;
  --letter-spacing-date: -0.1504px;

  /* Colors - Text */
  --color-text-gray-95: #15171a;
  --color-text-header: #101828;
  --color-text-gray-80: #3b4047;
  --color-text-select: #364153;
  --color-text-gray-60: #606a76;

  /* Colors - Border */
  --color-border-gray-10: #f0f1f2;
  --color-border-gray-15: #e8e9eb;
  --color-border-gray-20: #e0e2e5;

  /* Colors - Surface */
  --color-surface-white: #ffffff;
  --color-surface-gray-05: #f5f6f8;

  /* Spacing - Padding */
  --padding-14: 48px;
  --padding-12: 40px;
  --padding-10: 24px;
  --padding-8: 16px;
  --padding-7: 12px;
  --padding-6: 10px;
  --padding-5: 8px;
  --padding-4: 4px;
  --padding-2: 4px;
  --padding-1: 1px;

  /* Spacing - Gap */
  --gap-12: 40px;
  --gap-8: 16px;
  --gap-7: 12px;

  /* Radius */
  --radius-r5: 10px;
  --radius-full: 50%;

  /* Sizing */
  --size-header-height: 64px;
  --size-page-header-height: 57px;
  --size-container-width: 1280px;
  --size-table-width: 1200px;
  --size-back-button: 36px;
  --size-select-width: 160px;
  --size-select-height: 38px;
  --size-table-cell-width: 200px;
  --size-table-row-min-height: 72px;
  --size-icon: 20px;

  /* Responsive */
  --size-select-width-mobile: 120px;
  --size-table-cell-width-mobile: 120px;

  /* Misc */
  --transition-fast: 0.15s;
  --z-index-header: 100;
  --border-width: 1px;
  --stroke-width: 1.5;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--color-surface-white);
  color: var(--color-text-gray-95);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--size-header-height);
  background: var(--color-surface-white);
  border-bottom: var(--border-width) solid var(--color-border-gray-20);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-index-header);
}

.header-inner {
  width: var(--size-container-width);
  max-width: 100%;
  padding: 0 var(--padding-12);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--gap-8);
}

.back-button {
  width: var(--size-back-button);
  height: var(--size-back-button);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.back-button:hover {
  background: var(--color-surface-gray-05);
}

.header-title {
  font-size: var(--font-size-heading-small);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-heading-small);
  color: var(--color-text-header);
}

.version-select {
  width: var(--size-select-width);
  height: var(--size-select-height);
  border: var(--border-width) solid var(--color-border-gray-20);
  border-radius: var(--radius-r5);
  background: var(--color-surface-white);
  padding: 9px 33px 9px 12px;
  font-family: 'Pretendard', sans-serif;
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-body-xsmall);
  color: var(--color-text-select);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'><path d='M4 6L8 10L12 6' stroke='%23969DA7' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right var(--padding-5) center;
  background-size: 16px 16px;
}

/* Container */
.container {
  width: var(--size-container-width);
  max-width: 100%;
  margin: 0 auto;
  padding: var(--padding-14) var(--padding-12) 0;
  margin-top: var(--size-header-height);
  display: flex;
  flex-direction: column;
  gap: var(--gap-12);
}

/* Page Header */
.page-header {
  width: var(--size-table-width);
  height: var(--size-page-header-height);
  border-bottom: var(--border-width) solid var(--color-border-gray-10);
  padding-bottom: var(--padding-1);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

.page-header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title-wrapper {
  height: var(--line-height-heading-xlarge);
}

.page-title {
  font-size: var(--font-size-heading-xlarge);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-heading-xlarge);
  color: var(--color-text-gray-95);
}

.update-date-wrapper {
  width: auto;
  min-width: var(--size-select-width);
  display: flex;
  align-items: center;
  padding-left: var(--padding-6);
}

.update-date {
  font-family: 'Inter', 'Pretendard', sans-serif;
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-body-xsmall);
  color: var(--color-text-gray-60);
  letter-spacing: var(--letter-spacing-date);
  white-space: nowrap;
}

/* Section */
.section {
  display: flex;
  flex-direction: column;
  gap: var(--gap-7);
  width: var(--size-table-width);
  max-width: 100%;
}

.section-title {
  font-size: var(--font-size-heading-small);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-heading-small);
  color: var(--color-text-gray-95);
}

.section-content {
  font-size: var(--font-size-body-medium);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-body-medium);
  color: var(--color-text-gray-80);
}

/* 피그마: 모든 텍스트 블록 사이 gap 12px */
.section-content > p,
.section-content > ul,
.section-content > ol,
.section-content > .text-block,
.section-content > .bullet-block {
  margin-top: var(--gap-7);
}

.section-content > p:first-child,
.section-content > ul:first-child,
.section-content > ol:first-child,
.section-content > .text-block:first-child,
.section-content > .bullet-block:first-child {
  margin-top: 0;
}

/* Text Block (피그마: p + ul이 하나의 블록) */
.section-content .text-block > p,
.section-content .text-block > ul {
  margin-top: 0;
}

/* SemiBold text (피그마: Pretendard SemiBold 600) */
.section-content .semibold {
  font-weight: var(--font-weight-semibold);
}

.section-content ol {
  list-style-type: decimal;
  padding-left: 0;
}

.section-content ol li {
  margin-bottom: 0;
  margin-inline-start: var(--padding-10);
}

.section-content ul {
  list-style-type: disc;
  padding-left: 0;
}

.section-content ul li {
  margin-inline-start: var(--padding-10);
}

/* Bullet Block (피그마: 각 bullet 항목을 별도 블록으로) */
/* 피그마 gap: 12px between blocks */
.section-content .bullet-block {
  margin-top: var(--gap-7);
}

.section-content .bullet-block:first-child {
  margin-top: var(--gap-7);
}

/* Bullet Item (피그마: • + SemiBold 제목) */
.section-content .bullet-item {
  font-size: var(--font-size-body-medium);
  line-height: var(--line-height-body-medium);
  color: var(--color-text-gray-80);
  margin: 0;
}

.section-content .bullet-item strong {
  font-weight: var(--font-weight-semibold);
}

/* Dash Item (피그마: - + 일반 텍스트) */
.section-content .dash-item {
  font-size: var(--font-size-body-medium);
  line-height: var(--line-height-body-medium);
  color: var(--color-text-gray-80);
  margin: 0;
  padding-left: 16px;
}

/* Table */
.table-container {
  width: var(--size-table-width);
  max-width: 100%;
}

.table-header {
  display: flex;
  background: var(--color-surface-gray-05);
  border-top: var(--border-width) solid var(--color-border-gray-15);
  border-left: var(--border-width) solid var(--color-border-gray-15);
  border-right: var(--border-width) solid var(--color-border-gray-15);
  border-bottom: var(--border-width) solid var(--color-border-gray-15);
}

.table-header-cell {
  padding: var(--padding-7) var(--padding-10);
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-medium);
  line-height: var(--gap-8);
  color: var(--color-text-gray-60);
  letter-spacing: var(--letter-spacing-wide);
  border-left: var(--border-width) solid var(--color-border-gray-15);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.table-header-cell:first-child {
  width: var(--size-table-cell-width);
  border-left: none;
}

.table-header-cell:last-child {
  flex: 1;
}

.table-row {
  display: flex;
  background: var(--color-surface-white);
  border-left: var(--border-width) solid var(--color-border-gray-15);
  border-right: var(--border-width) solid var(--color-border-gray-15);
  border-bottom: var(--border-width) solid var(--color-border-gray-15);
}

.table-cell {
  padding: var(--padding-8) var(--padding-10);
  font-size: var(--font-size-body-small);
  line-height: var(--line-height-body-xsmall);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-gray-80);
  border-left: var(--border-width) solid var(--color-border-gray-15);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.table-cell:first-child {
  width: var(--size-table-cell-width);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-gray-95);
  border-left: none;
}

.table-cell:last-child {
  flex: 1;
  font-weight: var(--font-weight-regular);
  color: var(--color-text-gray-80);
}

.table-caption {
  width: 184px;
  padding: var(--padding-5) var(--padding-10) var(--padding-2);
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-body-small);
  color: var(--color-text-gray-60);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.table-note {
  font-size: var(--font-size-body-medium);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-body-medium);
  color: var(--color-text-gray-95);
}

.table-note ul {
  list-style-type: disc;
  padding-left: 0;
}

.table-note ul li {
  margin-inline-start: var(--padding-10);
}

/* EULA age table (피그마: capitalize + 세미볼드 좌측 컬럼) */
.age-table .table-header-cell,
.age-table .table-cell {
  text-transform: capitalize;
}

.age-table .table-cell {
  align-items: flex-start;
}

.age-table .table-cell:first-child {
  align-items: center;
  font-weight: var(--font-weight-semibold);
}

.age-table .table-cell:not(:first-child) {
  flex-direction: column;
}

.age-table .table-caption {
  width: 100%;
}

.age-table-cell--center {
  justify-content: center;
}

/* Footer Spacing */
.footer-space {
  height: var(--padding-12);
}

/* Bold text */
.bold {
  font-weight: var(--font-weight-bold);
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    padding: 0 var(--padding-8);
  }

  .container {
    padding: var(--padding-10) var(--padding-8) 0;
  }

  .table-header-cell:first-child,
  .table-cell:first-child {
    width: var(--size-table-cell-width-mobile);
  }

  .version-select {
    width: var(--size-select-width-mobile);
  }
}
