/* Law Document - Core Styling */
:root {
  /* --color-primary: #2c3e50;
    --color-secondary: #34495e; */
  --color-primary: #363732;
  --color-secondary: #2c3e50;
  --color-accent: #3498db;
  --color-text: #333;
  --color-text-light: #666;
  /* --color-background: #fff; */
  --color-background: #f8f6f5;
  /* --color-background: #fdf1e6; */
  /* --color-background: #efe0d0; */
  --color-border: #e0e0e0;
  --color-table-header: #f5f7fa;
  --color-table-alternate: #f9f9f9;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --padding-standard: 1.5rem;
  --max-width: 800px;
}

/* Base styling */
.law-document {
  font-family: var(--font-main);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-background);
  margin: 0;
  padding: 2rem;
}

.law-content {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Header styling */
/* Header styling */
.law-header {
  margin: 0 auto 3rem auto;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 2rem;
  max-width: 1100px;
}

.law-title {
  color: var(--color-primary);
  margin: 0 0 1rem 0;
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.law-official-title,
.law-short-title {
  color: var(--color-text-light);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  line-height: 1.5;
  font-weight: 400;
}

.law-ministry-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Metadata Grid */
.law-meta-info {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.law-date-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.meta-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  font-weight: 600;
}

.meta-value {
  font-size: 1rem;
  color: var(--color-primary);
  font-weight: 500;
}

/* Statistics & Warnings */
.law-statistics-container {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.law-warnings-container {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.law-outdated-warning {
  background-color: #fff5f5;
  color: #c53030;
  border: 1px solid #feb2b2;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: 0 2px 4px rgba(197, 48, 48, 0.05);
}

.warning-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.warning-indicator {
  background-color: #c53030;
  color: white;
  min-width: 32px;
  min-height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.warning-text {
  display: flex;
  flex-direction: column;
}

.warning-text strong {
  font-size: 1.05rem;
  margin-bottom: 0.15rem;
}

.warning-text span {
  font-size: 0.95rem;
  opacity: 0.9;
}

.warning-cta-button {
  background-color: white;
  color: #c53030;
  border: 1px solid #feb2b2;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-weight: bold;
  text-decoration: none !important;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.warning-cta-button:hover {
  background-color: #fff;
  border-color: #c53030;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(197, 48, 48, 0.1);
}

@media (max-width: 768px) {
  .law-outdated-warning {
    flex-direction: column;
    align-items: stretch;
    padding: 1.2rem;
    gap: 1rem;
  }

  .warning-cta-button {
    text-align: center;
    padding: 0.8rem;
  }
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  background-color: #ffffff;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

/* Banner for notifying about changes and service referral */
.change-banner {
  background: var(--color-primary);
  color: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.change-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.change-banner.warning {
  background-color: #fff5f5;
  color: #c53030;
  border: 1px solid #feb2b2;
}

.change-banner-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  justify-content: space-between;
}

.change-banner .text-content {
  flex: 1;
}

.change-banner .text-content strong {
  font-size: 1.1rem;
  display: inline-block;
  margin-bottom: 0.2rem;
}

.change-banner .change-indicator {
  background-color: #fff;
  color: var(--color-primary);
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.change-banner.warning .change-indicator {
  background-color: #c53030;
  color: white;
}

.banner-cta-button {
  display: inline-block;
  background-color: white;
  color: var(--color-primary);
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  font-weight: bold;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background-color 0.2s, transform 0.2s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.change-banner.warning .banner-cta-button {
  color: #c53030;
}

.banner-cta-button:hover {
  background-color: #f8f8f8;
  color: var(--color-primary);
  transform: translateY(-1px);
}

.change-banner.warning .banner-cta-button:hover {
  color: #a02727;
}

/* Sticky CTA */
.sticky-cta {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem 1.25rem 3.5rem; /* Increased left padding for the close button */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.sticky-cta.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.sticky-cta-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sticky-cta-content span {
  font-weight: 500;
  color: var(--color-text);
  font-size: 0.95rem;
}

.sticky-cta-button {
  background-color: var(--color-primary);
  color: white !important;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.sticky-cta-button:hover {
  background-color: var(--color-secondary);
}

.sticky-cta-close {
  position: absolute;
  top: 0;
  left: 0; /* Moved to the left */
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #aaa;
  line-height: 1;
  padding: 10px 14px;
  border-radius: 8px 0 8px 0; /* Adjusted radius for top-left corner */
  transition: background-color 0.2s, color 0.2s;
  z-index: 1001;
}

.sticky-cta-close:hover {
  background-color: #fff1f1;
  color: #c53030;
}

.sticky-cta.sticky-cta-hidden {
  transform: translateY(120%) !important;
  opacity: 0 !important;
  pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .change-banner {
    padding: 1.2rem;
    margin-bottom: 1.5rem;
  }

  .change-banner-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .change-banner .change-indicator {
    display: none;
    /* Hide indicator on mobile to save space if needed, or keep it */
  }

  .banner-cta-button {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  .sticky-cta {
    bottom: 0;
    right: 0;
    left: 0;
    border-radius: 0;
    border-top: 1px solid var(--color-border);
    border-bottom: none;
    border-left: none;
    border-right: none;
    padding: 0.8rem 1rem;
    justify-content: center;
  }

  .sticky-cta-close {
    display: none;
    /* Hide dismiss button on mobile as it's less intrusive and acts as a nav bar */
  }

  .sticky-cta-content {
    width: 100%;
    justify-content: space-between;
  }

  .sticky-cta-content span {
    display: none;
    /* Only show the button on very small screens to save space */
  }

  .sticky-cta-button {
    width: 100%;
    text-align: center;
    padding: 0.8rem;
  }
}

/* Preface section */
.law-preface {
  margin-bottom: 2.5rem;
  font-style: italic;
  color: var(--color-text-light);
}

.chapter-title {
  color: var(--color-primary);
  font-size: 1.5rem;
  margin: 0;
  font-weight: 600;
  text-align: center;
}

.group-title {
  color: var(--color-secondary);
  font-size: 1.3rem;
  margin: 0;
  margin-top: 1rem;
  font-weight: 500;
  text-align: center;
  font-style: italic;
}

/* Paragraph styling */
.law-paragraph {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.paragraph-number {
  color: var(--color-primary);
  font-size: 1.5rem;
  margin: 1.5rem 0 1rem 0;
  font-weight: 600;
}

/* Stk (subsection) styling */
.law-stk {
  margin-bottom: 1.5rem;
}

.stk-number {
  font-size: 1.1rem;
  color: var(--color-secondary);
  margin: 1rem 0 0.5rem 0;
  font-weight: 500;
}

/* Content styling */
.law-content-item {
  margin-bottom: 1rem;
}

.law-content-label {
  font-weight: 600;
}

/* Indentation classes */
.indent-1 {
  padding-left: 1.5rem;
}

.indent-2 {
  padding-left: 3rem;
}

.indent-3 {
  padding-left: 4.5rem;
}

.indent-4 {
  padding-left: 6rem;
}

/* Table styling */
.law-table-container {
  margin: 1.5rem 0;
  overflow-x: auto;
}

.law-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.law-table-caption {
  font-weight: 600;
  padding: 0.8rem 0;
  color: var(--color-secondary);
  text-align: left;
}

.law-table-row {
  border-bottom: 1px solid var(--color-border);
}

.law-table-row.header-row {
  background-color: var(--color-table-header);
}

.law-table-row:nth-child(even):not(.header-row) {
  background-color: var(--color-table-alternate);
}

.law-table-cell {
  padding: 0.8rem;
  text-align: left;
  border: 1px solid var(--color-border);
}

.law-table-cell.header-cell {
  font-weight: 600;
}

/* Appendix styling */
.law-appendix {
  margin-top: 3rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
}

.law-appendix-item {
  margin-bottom: 2rem;
}

.appendix-title {
  color: var(--color-primary);
  font-size: 1.5rem;
  margin: 1.5rem 0 1rem 0;
}

/* Footer styling */
.law-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-light);
  font-size: 0.9rem;
}

.law-accession-number,
.law-publication-date {
  margin-bottom: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body.law-document {
    padding: 1rem;
  }

  .law-title {
    font-size: 1.8rem;
  }

  .paragraph-number,
  .appendix-title {
    font-size: 1.3rem;
  }

  .indent-1 {
    padding-left: 1rem;
  }

  .indent-2 {
    padding-left: 2rem;
  }

  .indent-3 {
    padding-left: 3rem;
  }

  .indent-4 {
    padding-left: 4rem;
  }
}

/* Print styles */
@media print {
  body.law-document {
    padding: 0;
    font-size: 11pt;
  }

  .law-content {
    max-width: none;
  }

  .law-paragraph {
    page-break-inside: avoid;
  }

  .law-table-container {
    page-break-inside: avoid;
  }
}