﻿:root {
  --primary-red: #c91429;
  --primary-hover: #a81022;
  --pure-white: #ffffff;
  --text-main: #000000;
  --border-subtle: #f0d5d8;
  --card-bg-light: #fffafb;
}

body {
  background-color: var(--pure-white) !important;
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
}

.sm_icons_text {
  background-color: transparent;
  border: none;
}

/* Outer container */
.factsheet-container {
  min-width: unset !important;
  max-width: 1150px;
  margin-left: auto;
  margin-right: auto;
  padding: 48px 12px;
}

/* Outer Wrapper Card */
.main-card {
  background-color: #FFF4D9 !important;
  border: 1.5px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(201, 20, 41, 0.05);
}

/* Header */
.fs-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.page-title-fs {
  color: var(--primary-red);
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 28px;
  text-align: center;
  margin-top: 0;
  margin-bottom: 24px;
  text-transform: uppercase;
}

/* Filters row */
.fs-filters {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.fs-year-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.fs-year-group label {
  font-weight: 700;
}

.fs-search-group {
  width: 100%;
  flex: 1;
}

@media (min-width: 576px) {
  .fs-filters {
    flex-direction: row;
  }

  .fs-year-group {
    width: auto;
    justify-content: end;
  }

  .fs-search-group {
    width: 50%;
  }
}

@media (min-width: 768px) {
  .fs-search-group {
    width: 41.666667%;
  }
}

/* Input group */
.fs-input-group {
  display: flex;
  max-width: 500px;
  flex-wrap: nowrap;
}

.search-icon-box {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-right: none;
  background: var(--pure-white);
  color: var(--primary-red);
  border-radius: 999px 0 0 999px;
}

/* Form controls */
.fs-select,
.fs-input {
  display: block;
  width: 100%;
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-main) !important;
  background-color: var(--pure-white);
  border: 1px solid var(--border-subtle);
  appearance: none;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.fs-select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 12px;
}

.fs-select:focus,
.fs-input:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 4px rgba(201, 20, 41, 0.15);
  outline: 0;
  color: var(--text-main);
}

.fs-select.fs-select-year {
  width: 130px;
}

.fs-select.fs-pill,
.fs-input.fs-pill {
  border-radius: 999px;
}

.fs-input.fs-pill-end {
  border-left: 0;
  border-radius: 0 999px 999px 0;
}

/* Buttons */
.fs-btn {
  display: inline-block;
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.fs-btn.fs-btn-py-2 {
  padding-top: 8px;
  padding-bottom: 8px;
}

.fs-btn.fs-text-nowrap {
  white-space: nowrap;
}

.btn-brand-primary {
  background-color: var(--primary-red);
  color: var(--pure-white);
  border-color: var(--primary-red);
}

.btn-brand-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--pure-white);
}

/* Spinner */
@keyframes fs-spin {
  to {
    transform: rotate(360deg);
  }
}

.fs-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: text-bottom;
  border: 2px solid #fff;
  border-right-color: transparent;
  border-radius: 50%;
  animation: fs-spin 0.75s linear infinite;
}

.fs-spinner.fs-spinner-sm {
  width: 16px;
  height: 16px;
}

.fs-hidden {
  display: none !important;
}

/* Body layout */
.fs-body {
  display: flex;
  flex-wrap: wrap;
}

.fs-col {
  width: 100%;
  padding: 24px;
}

@media (min-width: 768px) {
  .fs-col {
    width: 50%;
  }
}

.fs-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fs-stack.fs-mt-4 {
  margin-top: 24px;
}

@media (min-width: 768px) {
  .fs-stack {
    margin-top: 88px;
  }
}

.fs-investor-controls {
  display: flex;
  gap: 16px;
}

.fs-investor-select-wrap {
  flex: 1 1 auto;
}

@media (min-width: 576px) {
  .fs-investor-controls {
    flex-direction: row;
    align-items: center;
  }
}

.section-title {
  font-size: 13.6px;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--primary-red);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.section-title.fs-text-center {
  text-align: center;
}

.section-title.fs-mb-3 {
  margin-bottom: 16px;
}

/* Empty / status text */
.fs-empty {
  text-align: center;
  padding: 24px 0;
  color: #6c757d;
}

.fs-text-danger {
  color: #dc3545;
}

.fs-fw-semibold {
  font-weight: 600;
}

/* Factsheet List */
.factsheet-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  color: var(--text-main);
}

.factsheet-item:hover {
  background-color: rgba(201, 20, 41, 0.06);
}

.fs-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-btn-pdf {
  color: var(--primary-red);
  text-decoration: none;
  font-size: 13.6px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 4px;
  background-color: rgba(201, 20, 41, 0.08);
  transition: all 0.2s ease;
}

.action-btn-pdf:hover {
  background-color: var(--primary-red);
  color: var(--pure-white);
}

.action-btn-share {
  color: var(--primary-red);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.action-btn-share:hover {
  background-color: rgba(201, 20, 41, 0.1);
  color: var(--primary-hover);
}

/* Footer */
.fs-footer {
  padding: 24px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--card-bg-light);
}

.fs-resources {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.fs-resource-col {
  width: 100%;
}

@media (min-width: 768px) {
  .fs-resource-col {
    width: calc((100% - 32px) / 3);
  }
}

.resource-link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  font-size: 15.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background: var(--pure-white);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.resource-link .resource-icon {
  color: var(--primary-red);
  font-size: 17.6px;
  transition: color 0.2s ease;
}

.resource-link:hover {
  border-color: var(--primary-red);
  background-color: var(--primary-red);
  color: var(--pure-white);
}

.resource-link:hover .resource-icon {
  color: var(--pure-white);
}

/* Dividers */
.border-red-subtle {
  border-color: var(--border-subtle) !important;
}

.border-divider-end {
  border-right: 1.5px solid var(--border-subtle);
}

@media (max-width: 767.98px) {
  .border-divider-end {
    border-right: none;
    border-bottom: 1.5px solid var(--border-subtle);
  }
}

/* Modal helpers (outside factsheet-container) */
.fs-p-0 {
  padding: 0 !important;
}

.fs-ratio-16x9 {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.fs-ratio-16x9 > * {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Bootstrap 3 explainer modal overrides */
#factsheetExplainerModal.modal {
  z-index: 10050;
}

.modal-open #factsheetExplainerModal.modal {
  background-color: transparent !important;
}

#factsheetExplainerModal.modal.in {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 16px !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
}

#factsheetExplainerModal .modal-dialog {
  margin: 0;
  width: 100%;
  max-width: 900px;
}

#factsheetExplainerModal.modal.in .modal-dialog {
  transform: translate(0, 0) !important;
}

#factsheetExplainerModal .modal-header {
  position: relative;
}

#factsheetExplainerModal .modal-header .close {
  margin-left: 0 !important;
  position: absolute;
  right: -100%;
  top: 50% !important;
  transform: translate(-30px, -30%);
}

body > .modal-backdrop.fs-explainer-backdrop {
  z-index: 10040;
}
