/* Import Raleway font */
@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,400;0,800;1,400;1,800&display=swap');

/* Root variables */
:root {
  --theme-color: var(--bs-primary, #2780E3);
  --progressbar-position: top;
  --progress-bar-height: 10px;
  --progress-color: color-mix(in srgb, var(--theme-color) 80%, transparent);
}

/* Layout */

.container-fluid .content {
  max-width: 800px;
  margin: 0 auto !important;
  padding: 0 0 5px !important;
}

/* Typography */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
}

p, .form-group, .control-label {
  margin-bottom: 0.5rem;
}

.control-label, .radio label, .checkbox label {
  font-weight: normal;
  font-size: 1.1em;
}

/* Form elements */
.form-group {
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 1rem;
  background-color: #f9f9f9;
  margin-bottom: 1rem;
}

.form-group > label.control-label {
  margin-top: 0;
  margin-bottom: 0.3rem;
}

.form-control:focus {
  border-color: var(--theme-color);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--theme-color) 25%, transparent);
}

.question-container {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1rem;
}

.shiny-input-container:not(.shiny-input-container-inline) {
  width: 100%;
}

/* Hidden Asterisk */
.hidden-asterisk {
  display: none;
  color: red;
  font-size: 1.5em;
  position: absolute;
  top: 0;
  right: 0.5em;
}

/* Radio and Checkbox styling */
.radio-inline,
.checkbox-inline,
.radio label,
.checkbox label {
  padding-bottom: 0.25rem;
}

.radio-group-buttons .btn-group-container-sw,
.checkbox-group-buttons .btn-group-container-sw {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  row-gap: 5px;
}

.checkbox-group-buttons .btn-group-container-sw {
  column-gap: 5px;
}

.radio-group-buttons .btn,
.checkbox-group-buttons .btn,
.btn-group-container-sw .btn {
  border: 1px solid var(--theme-color);
  background-color: color-mix(in srgb, var(--theme-color) 10%, white);
  color: var(--theme-color);
  transition: all 0.3s ease;
  white-space: normal;
  word-wrap: break-word;
}

.radio-group-buttons .btn:hover,
.checkbox-group-buttons .btn:hover,
.btn-group-container-sw .btn:hover {
  z-index: 1;
  background-color: color-mix(in srgb, var(--theme-color) 20%, white);
}

.radio-group-buttons .btn:first-child,
.checkbox-group-buttons .btn:first-child,
.btn-group-container-sw .btn:first-child {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.radio-group-buttons .btn:last-child,
.checkbox-group-buttons .btn:last-child,
.btn-group-container-sw .btn:last-child {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  margin-right: 0;
}

.radio-group-buttons .btn.active,
.checkbox-group-buttons .btn.active,
.btn-group-container-sw .btn.active {
  background-color: color-mix(in srgb, var(--theme-color) 80%, white);
  color: white;
  z-index: 2;
}

/* Date range styling */
.shiny-date-range-input .input-group-addon {
  background: none;
  border: none;
  padding: 0 10px 0 5px;
}

/* Progress bar */
#progressbar {
  position: fixed;
  left: 0;
  right: 0;
  height: var(--progress-bar-height);
  z-index: 1000;
  background-color: #ECE8DF;
}

#progressbar.top {
  top: 0;
}

#progressbar.bottom {
  bottom: 0;
}

#progressbar > div {
  width: 0%;
  height: 100%;
  background-color: var(--progress-color);
  transition: width 0.4s ease;
}

/* Buttons */
.btn-primary,
.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus,
.action-button {
  background-color: var(--theme-color);
  border-color: var(--theme-color);
  color: #ffffff;
}

.action-button {
  background-color: color-mix(in srgb, var(--theme-color) 70%, transparent);
  transition: background-color 0.3s ease;
}

.action-button:hover,
.action-button:focus {
  background-color: var(--theme-color);
}

/* Links */
a:hover {
  color: color-mix(in srgb, var(--theme-color) 80%, black);
}

/* Utility classes */
p:last-child,
.form-group:last-child {
  margin-bottom: 0;
}

/* Media Queries */
@media screen and (max-width: 767px) {
  .radio-group-buttons .btn-group-container-sw,
  .checkbox-group-buttons .btn-group-container-sw {
    flex-direction: column;
  }
}

/* Matrix question styling */
.matrix-question-container {
    width: 100%;
    overflow-x: auto;
}

.matrix-question-container .form-group {
    border: none;
    background-color: transparent;
    padding: 0;
}

.matrix-question {
    width: 100%;
    border-collapse: collapse;
    font-size: 18px;
}

.matrix-question th, .matrix-question td {
    padding: 0;
    text-align: center;
    border: none;
    height: 10px;
    vertical-align: middle;
}

.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
  vertical-align: middle;
  padding: 4px;
}

.matrix-question th {
    background-color: transparent;
    font-weight: bold;
    font-size: 18px;
}

.table {
  --bs-table-striped-bg: #f9f9f9;
}

.matrix-question tr:nth-child(even) {
    background-color: #f9f9f9;
}

.matrix-question tr:nth-child(odd) {
    background-color: #f9f9f9;
}

.matrix-question .shiny-options-group {
    display: flex;
    justify-content: center; /* Center the radio buttons */
    width: 100%;
}

.matrix-question .shiny-options-group .radio {
    margin: 0;
    flex: 1;
    text-align: center;
}

.matrix-question .shiny-options-group .radio label {
    padding-left: 0;
    display: inline-block;
}

.matrix-question .shiny-options-group .radio input {
    margin: 0;
    position: relative;
    top: 2px;
}

/* Hide radio button labels */
.matrix-question .shiny-options-group .radio span {
    display: none;
}

/* Style for the sub-question labels */
.matrix-question td:first-child {
    text-align: left;
    font-weight: normal;
    padding-left: 15px; /* Add some left padding */
}

/* SweetAlert custom styling */
.swal2-popup {
  font-size: 1rem !important;
}

div:where(.swal2-container) .swal2-html-container {
  padding: 0 2em;
}

/* Exit pop-up */
.modal {
  display: block !important;
  opacity: 1 !important;
}

.modal-backdrop {
  opacity: 0.5 !important;
}

.modal-dialog {
  z-index: 1050 !important;
}

.modal-body .shiny-input-container .control-label {
  text-align: center;
  width: 100%;
}
