@import url(./styles/reset.css);
@import url(./styles/fonts.css);
@import url(./styles/helpers.css);
@import url(./styles/button.css);
@import url(./styles/inputs.css);
/* @import url(./styles/hotkeys.css); */
@import url(./styles/palette.css);
@import url(./styles/patterns/patterns.css);
@import url(./styles/animations.css);

@import url(./styles/question-list.css);
@import url(./styles/loader.css);

:root {
  --body-bg-color: #c0c0c0;

  --debug-color: black;
  --debug-bg: greenyellow;
  --input-color: gray;
}

::selection {
  background-color: var(--yellow);
}

html {
  min-height: 100%;
  background-color: gray;
}

body {
  max-width: 800px;
  background-color: var(--body-bg-color);
  box-shadow: 0 0 4px 0px black;
  box-sizing: border-box;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.tiktok-text {
  text-shadow: 1px 1px #f72456, -1px -1px #19f2e4;
}

/* @property --color {
  syntax: "<color>";
  inherits: false;
  initial-value: transparent;
} */

/* progress */
progress {
  border: 0;
  border-radius: 0;
  height: 10px;

  --progress-bar-bg: var(--gray);
  --progress-value-bg: var(--red);
}

/* this shit does not work for all browsers, consider to use div-progress instead */

progress::-webkit-progress-bar {
  background-color: var(--progress-bar-bg);
}

progress::-webkit-progress-value {
  background-color: var(--progress-value-bg);
  transition: all 300ms ease-in-out;
}

header {
  position: sticky;
  top: 0;

  /* background-color: var(--body-bg-color); */
  background-color: #a2a2a2;
  box-shadow: 0 0 5px 0 black;
}

.pattern-area {
  position: relative;
  display: grid;
  box-sizing: border-box;
  grid-template-columns: repeat(var(--size), 1fr);

  --pattern-size: 100px;

  font-size: 50px;
  text-align: center;

  gap: 10px;

  max-width: 340px;
  /* fixed height */
  height: 340px;
}

.pattern-area,
.answer-list {
  transition: opacity 100ms ease-in-out;
}

/* // */

.patterns-answers-container {
  display: flex;
  /* to prevent overflow on devices with w<320px like z fold */
  overflow: hidden;
  justify-content: space-evenly;

  /* landscape-like */
  flex-direction: row;

  @media (orientation: portrait) and (width < 600px) {
    flex-direction: column;
  }
}

.answer-list {
  grid-template-columns: repeat(2, 1fr);

  box-sizing: border-box;
  @media (orientation: portrait) and (width < 600px) {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (orientation: portrait) and (width < 600px) {
  body {
    width: 100vw;
  }
}

.answer-list {
  --pattern-size: 90px;

  @media (orientation: portrait) and (width < 600px) {
    --pattern-size: 70px;
  }
}

.answer-list {
  display: grid;

  gap: 10px;

  align-content: center;

  --color: var(--dimgray);
  --answer-letter-color: white;
}

.answer {
  display: flex;
  flex-direction: row;
  align-items: center;

  font-size: 50px;
  text-align: center;

  background-color: var(--color);
  border: 2px solid var(--color);

  border-radius: 4px;
  padding: 3px;

  transition: 200ms all, outline 0ms;

  &.selected {
    --color: var(--yellow);
    --answer-letter-color: black;

    border-color: black;
  }

  &.correct {
    --color: var(--green);
  }

  &.wrong {
    --color: var(--red);
  }
}

.answer-letter {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 25px;
  height: 100%;

  text-align: center;

  color: var(--answer-letter-color);

  font-size: 20px;
  text-transform: uppercase;

  transition: 200ms all;
}

.pattern-question-mark {
  position: relative;
  display: flex;
  box-sizing: border-box;

  align-items: center;
  justify-content: center;
  background-color: var(--dimgray);
  border: 3px solid black;
  border-style: dashed;

  color: black;
  cursor: help;

  &:after {
    display: flex;
    align-items: center;

    content: attr(symbol);
    position: relative;
    font-size: calc(var(--pattern-size) * 2 / 3);
    text-shadow: 2px 2px rgba(0, 0, 0, 0.2);

    animation: fadeIn 200ms ease-in forwards, rotateUp 200ms ease-in forwards,
      slideUp 200ms ease-in forwards;
  }

  /* for svg content */
  &:not(:empty) {
    border: none;
    background: none;
    stroke: black;
    /* stroke-dasharray: 6 3; */
    stroke-dasharray: 7 7;
    /* stroke-dashoffset: 6; */
    /* stroke-width: 3px; */
  }
}

.navigation-controls {
  flex: 1;
  justify-content: center;
  /* background: red; */

  .btn-container {
    container-type: inline-size;
    width: 100%;

    display: flex;
    flex-direction: row;

    /* background-color: lightgreen; */

    .btn-nav {
      .btn-nav-icon {
        @container (80px< width <95px) {
          display: none;
        }
      }
      .btn-nav-text {
        @container (width<80px) {
          display: none;
        }
      }
    }
  }
}

/* // */

hr {
  padding: 0;
  margin: 0;
  /* width: 100%; */
  border-width: 2px;
  box-sizing: border-box;
  align-self: stretch;
}

footer {
  position: sticky;
  overflow: hidden;
  bottom: 0;
  background-color: var(--body-bg-color);
  box-shadow: 0px 0px 5px 1px #0000003d;
}

.modal-overlay {
  background-color: color(srgb 1 0.921569 0.839216 / 0.3);
}

.popup-container {
  background-color: var(--body-bg-color);

  border: 3px solid var(--gray);
  border-radius: 5px;
  box-shadow: 0px 0px 5px 5px #00000040;
  max-height: 100vh;
  overflow-x: auto;
}

.quiz-details-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 10px;

  /* fieldset reset */
  border-width: 4px;
  /* border: none;
  padding: 0;
  margin: 0; */

  & > label > span {
    text-transform: capitalize;
    &:after {
      content: ":";
    }
  }

  input,
  select {
    /* max-width: 320px; */
  }

  @media (orientation: portrait) and (width < 600px) {
    grid-template-columns: repeat(1, 1fr);
  }
}
