/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - Virus Propagation - Epidemic Simulation                  - */
/* -                                                          - */
/* - Author: Cylian                                           - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - Color Variables                                          - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
:root {
  --virus-color-susceptible: var(--color-green);
  --virus-color-exposed: var(--color-orange);
  --virus-color-infected: var(--color-red);
  --virus-color-recovered: var(--color-blue);
  --virus-color-dead: var(--color-gray); }

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - Breakpoint Variable                                      - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - Layout                                                   - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
layout-main main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  gap: 1.5rem; }

layout-main #virus-canvas {
  width: 100%;
  height: 100%;
  border: 1px solid var(--draw-color-surface);
  border-radius: 4px;
  background: var(--background-color-surface); }

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - Control Buttons                                          - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
.virus-controls {
  display: flex;
  flex-flow: column nowrap;
  gap: 1rem; }
  .virus-controls .control-group select {
    width: 100%;
    padding: .5rem;
    font-size: .9rem;
    border: 1px solid var(--draw-color-surface);
    border-radius: 4px;
    background: var(--background-color-surface);
    color: var(--text-color-surface);
    cursor: pointer; }
    .virus-controls .control-group select:focus {
      outline: none;
      border-color: var(--draw-color-primary); }
  .virus-controls .virus-actions {
    display: flex;
    flex-flow: row nowrap;
    justify-content: center;
    gap: .5rem; }
    .virus-controls .virus-actions .button {
      flex: 1;
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis; }
    .virus-controls .virus-actions .is-start {
      display: block; }
    .virus-controls .virus-actions .is-pause {
      display: none; }
    .virus-controls .virus-actions.is-running .is-start {
      display: none; }
    .virus-controls .virus-actions.is-running .is-pause {
      display: block; }

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - Stats Widget                                             - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
.virus-stats {
  display: flex;
  flex-flow: column nowrap;
  gap: .75rem; }
  .virus-stats .stat-row {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: .5rem; }
    .virus-stats .stat-row .swatch {
      display: inline-block;
      width: .75rem;
      height: .75rem;
      border-radius: 50%; }
      .virus-stats .stat-row .swatch.susceptible {
        background-color: var(--virus-color-susceptible); }
      .virus-stats .stat-row .swatch.exposed {
        background-color: var(--virus-color-exposed); }
      .virus-stats .stat-row .swatch.infected {
        background-color: var(--virus-color-infected); }
      .virus-stats .stat-row .swatch.recovered {
        background-color: var(--virus-color-recovered); }
      .virus-stats .stat-row .swatch.dead {
        background-color: var(--virus-color-dead); }
    .virus-stats .stat-row .label {
      flex: 1;
      font-weight: 300;
      color: var(--text-color-surface); }
    .virus-stats .stat-row .value {
      font-weight: 600;
      font-variant-numeric: tabular-nums;
      color: var(--text-color-surface); }

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - Options Widget                                           - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
.virus-options {
  display: flex;
  flex-flow: column nowrap;
  gap: 1rem; }
  .virus-options .control-group select {
    width: 100%;
    padding: .5rem;
    font-size: .9rem;
    border: 1px solid var(--draw-color-surface);
    border-radius: 4px;
    background: var(--background-color-surface);
    color: var(--text-color-surface);
    cursor: pointer; }
    .virus-options .control-group select:focus {
      outline: none;
      border-color: var(--draw-color-primary); }
  .virus-options .option-group {
    display: flex;
    flex-flow: column nowrap;
    gap: .25rem; }
    .virus-options .option-group label {
      display: flex;
      flex-flow: row nowrap;
      justify-content: space-between;
      align-items: center;
      font-size: .85rem;
      font-weight: 300;
      color: var(--text-color-surface); }
      .virus-options .option-group label .value {
        font-weight: 600;
        font-variant-numeric: tabular-nums; }
    .virus-options .option-group input[type="range"] {
      width: 100%;
      height: .5rem;
      accent-color: var(--draw-color-primary);
      cursor: pointer; }
    .virus-options .option-group input[type="checkbox"] {
      width: 1rem;
      height: 1rem;
      accent-color: var(--draw-color-primary);
      cursor: pointer; }
  .virus-options .checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: .5rem; }
    .virus-options .checkbox-group label {
      flex: none;
      cursor: pointer; }
      .virus-options .checkbox-group label:hover {
        color: var(--text-color-primary); }

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - Chart Widget                                             - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
.virus-chart {
  width: 100%; }
  .virus-chart .chart-container {
    width: 100%;
    height: 120px;
    border: 1px solid var(--draw-color-surface);
    border-radius: 4px;
    background: var(--background-color-surface); }
    .virus-chart .chart-container #virus-chart {
      width: 100%;
      height: 100%; }
  .virus-chart .chart-legend {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: .5rem; }
    .virus-chart .chart-legend .legend-item {
      display: inline-flex;
      flex-flow: row nowrap;
      align-items: center;
      gap: .25rem;
      font-size: .75rem;
      font-weight: 300;
      color: var(--text-color-surface); }
      .virus-chart .chart-legend .legend-item .swatch {
        display: inline-block;
        width: .5rem;
        height: .5rem;
        border-radius: 50%; }
        .virus-chart .chart-legend .legend-item .swatch.susceptible {
          background-color: var(--virus-color-susceptible); }
        .virus-chart .chart-legend .legend-item .swatch.exposed {
          background-color: var(--virus-color-exposed); }
        .virus-chart .chart-legend .legend-item .swatch.infected {
          background-color: var(--virus-color-infected); }
        .virus-chart .chart-legend .legend-item .swatch.recovered {
          background-color: var(--virus-color-recovered); }
        .virus-chart .chart-legend .legend-item .swatch.dead {
          background-color: var(--virus-color-dead); }

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - Responsive                                               - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
@media (max-width: 768px) {
  .virus-stats {
    flex-flow: row wrap;
    justify-content: center;
    gap: 1rem; }
    .virus-stats .stat-row {
      flex: 0 0 auto; }
  .virus-chart .chart-container {
    height: 100px; } }
