/* 
* - Quiz Application 
* - Author - Joy Dey
*/

/* Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Rubik:wght@300;400;500;600;700;800;900&display=swap");

/* Universal CSS */
:root {
  --main-color: #fca311;
  --main-white: #e0e0e0;
  --secondary-black: #787878;
  --main-black: #0a0a0a;
  --text-black: #0a0a0a;
  --light-main-color: #fca2116b;
  --light-blue: #daf0ff;
  --white: #fff;
}

.dark-mode {
  --main-color: #ffe646;
  --main-white: #1f1f1f;
  --secondary-black: #d8d8d8;
  --main-black: #e0e0e0;
  --light-blue: #ffe646;
  --white: #000;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  font-family: "Roboto", sans-serif;
  user-select: none;
}
html {
  font-size: 62.5%;
}
body {
  position: relative;
  overflow-x: hidden;
  color: var(--main-black);
  background-color: var(--main-white);
  transition: all 500ms;
  -webkit-transition: all 500ms;
  -moz-transition: all 500ms;
  -ms-transition: all 500ms;
  -o-transition: all 500ms;
}

img {
  max-width: 100%;
  display: block;
  object-fit: cover;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  font-family: "Rubik", sans-serif;
}
.container {
  max-width: 120em;
  margin: 0 auto;
  padding: 0 1em;
}
.highlight {
  color: var(--main-color);
}
.bold {
  font-weight: 900;
}
.btn {
  transition: box-shadow 300ms;
  -webkit-transition: box-shadow 300ms;
  -moz-transition: box-shadow 300ms;
  -ms-transition: box-shadow 300ms;
  -o-transition: box-shadow 300ms;
}
.btn:hover {
  box-shadow: 0 1rem 1rem rgba(0, 0, 0, 0.2);
}
.glass {
  box-shadow: 0 8px 32px 0.1 rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(0.5rem);
  -webkit-backdrop-filter: blur(0.5rem);
  border-radius: 1rem;
  -webkit-border-radius: 1rem;
  -moz-border-radius: 1rem;
  -ms-border-radius: 1rem;
  -o-border-radius: 1rem;
}
.floating {
  animation: float 3s ease-in-out infinite;
  -webkit-animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0% {
    transform: translatey(0px);
    -webkit-transform: translatey(0px);
    -moz-transform: translatey(0px);
    -ms-transform: translatey(0px);
    -o-transform: translatey(0px);
  }
  50% {
    transform: translatey(-30px);
    -webkit-transform: translatey(-30px);
    -moz-transform: translatey(-30px);
    -ms-transform: translatey(-30px);
    -o-transform: translatey(-30px);
  }
  100% {
    transform: translatey(0px);
    -webkit-transform: translatey(0px);
    -moz-transform: translatey(0px);
    -ms-transform: translatey(0px);
    -o-transform: translatey(0px);
  }
}

/* Header Section */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 2em 0;
  z-index: 10;
  background: var(--main-white);
  box-shadow: 1rem 0 1rem rgba(0, 0, 0, 0.4);
}
body.dark-mode header {
  box-shadow: 1rem 0 1rem rgba(255, 255, 255, 0.4);
}
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  color: var(--main-black);
  font-size: 3.8rem;
  font-weight: 700;
  font-family: "Rubik", sans-serif;
}
.switch-mode {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--main-black);
  outline: 0;
  border: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
  outline: 0;
}
/* switch mode */
.checkbox {
  opacity: 0;
  position: absolute;
}

.label {
  background-color: var(--main-black);
  border-radius: 80px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px;
  position: relative;
  height: 26px;
  width: 60px;
  transform: scale(1.5);
  -webkit-border-radius: 80px;
  -moz-border-radius: 80px;
  -ms-border-radius: 80px;
  -o-border-radius: 80px;
}

.label .ball {
  background-color: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  height: 22px;
  width: 22px;
  transform: translateX(2px);
  transition: transform 0.2s linear;
  -webkit-transform: translateX(2px);
  -moz-transform: translateX(2px);
  -ms-transform: translateX(2px);
  -o-transform: translateX(2px);
}

.checkbox:checked + .label .ball {
  transform: translateX(33px);
  -webkit-transform: translateX(33px);
  -moz-transform: translateX(33px);
  -ms-transform: translateX(33px);
  -o-transform: translateX(33px);
}
body.dark-mode .label .ball {
  background-color: var(--main-white);
}

.fa-moon {
  color: #fca311;
}

.fa-sun {
  color: var(--main-white);
}

/* Banner Section */
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5em;
  min-height: 100vh;
}
.banner-left,
.banner-right {
  flex-basis: 50%;
}
.banner-title {
  font-size: 5.9rem;
  font-weight: 600;
  line-height: 1;
}
.banner-description {
  margin: 2rem 0;
  font-size: 2.1rem;
  color: var(--secondary-black);
}
.banner button {
  border: 0;
  outline: 0;
  background: var(--main-color);
  color: var(--text-black);
  font-size: 2rem;
  padding: 1em 2em;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  transition: box-shadow 300ms;
  -webkit-transition: box-shadow 300ms;
  -moz-transition: box-shadow 300ms;
  -ms-transition: box-shadow 300ms;
  -o-transition: box-shadow 300ms;
}
.banner button span {
  margin-left: 1rem;
}
.banner button span i {
  transition: all 300ms;
  -webkit-transition: all 300ms;
  -moz-transition: all 300ms;
  -ms-transition: all 300ms;
  -o-transition: all 300ms;
}
.banner button:hover {
  box-shadow: 0 1rem 1rem rgba(0, 0, 0, 0.2);
}
.banner button:hover span i {
  transform: translateX(1rem);
  -webkit-transform: translateX(1rem);
  -moz-transform: translateX(1rem);
  -ms-transform: translateX(1rem);
  -o-transform: translateX(1rem);
}

/* Quiz Modal Condition */

.quiz-modal-container {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: background-color 300ms;
  -webkit-transition: background-color 300ms;
  -moz-transition: background-color 300ms;
  -ms-transition: background-color 300ms;
  -o-transition: background-color 300ms;
  z-index: -1;
}
.quiz-modal-container.active {
  background-color: rgba(0, 0, 0, 0.55);
  z-index: 11;
}
.quiz-modal-container.active-dark {
  background-color: rgba(255, 255, 255, 0.55);
  z-index: 11;
}

.quiz-modal-condition {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  padding: 4.8em;
  background-color: var(--white);
  transition: top 400ms ease;
  -webkit-transition: top 400ms ease;
  -moz-transition: top 400ms ease;
  -ms-transition: top 400ms ease;
  -o-transition: top 400ms ease;
}
/* active quiz modal */
.quiz-modal-condition.active {
  z-index: 12;
  top: 50%;
}
.modal-title {
  font-size: 4rem;
  margin-bottom: 2rem;
  font-weight: 700;
  margin-bottom: 3rem;
}
.modal-conditions p {
  font-size: 2.1rem;
  margin: 1.2rem 0;
  color: var(--secondary-black);
}
.modal-conditions p .highlight {
  color: var(--main-color);
  font-weight: 900;
}
.condition-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}
.condition-actions button {
  margin-top: 1.5rem;
  font-size: 1.9rem;
  padding: 0.5em 0.9em;
  cursor: pointer;
  outline: 0;
  font-weight: 700;
}
.exit-modal {
  color: var(--text-black);
  border: 0.4rem solid var(--main-color);
  transition: all 500ms;
  -webkit-transition: all 500ms;
  -moz-transition: all 500ms;
  -ms-transition: all 500ms;
  -o-transition: all 500ms;
}
.exit-modal:hover {
  background-color: var(--main-color);
}
.start-quiz {
  color: var(--text-black);
  background-color: var(--main-color);
  border: 0.4rem solid var(--main-color);
}

/* Loading Animation */
.loading-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--main-white);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 888;
  display: none;
}

.loading-text {
  color: var(--main-black);
  margin-bottom: 3rem;
  font-size: 4.3rem;
}
.loading-line-box {
  padding: 0.2rem;
  width: 50%;
  height: 2.8rem;
  border: 0.3rem solid var(--main-color);
  border-radius: 3rem;
  -webkit-border-radius: 3rem;
  -moz-border-radius: 3rem;
  -ms-border-radius: 3rem;
  -o-border-radius: 3rem;
}
.line {
  height: 100%;
  border-radius: 3rem;
  background-color: var(--main-color);
  animation: loading 2.5s forwards cubic-bezier(0, 0, 0, 0);
  -webkit-animation: loading 2.5s forwards cubic-bezier(0, 0, 0, 0);
  -webkit-border-radius: 3rem;
  -moz-border-radius: 3rem;
  -ms-border-radius: 3rem;
  -o-border-radius: 3rem;
}

@keyframes loading {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

/* Question Container */
.question-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--main-white);
  display: none;
}

.question-section.active {
  display: flex;
}

.question-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  padding: 3em;
  background-color: var(--white);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5em 0;
}
.timeline {
  position: relative;
  margin-top: 1em;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0.5rem;
  background: var(--main-color);
}
.time-container {
  display: flex;
  background-color: var(--light-blue);
  padding: 1.5em;
  font-weight: 700;
}

.time-container .time {
  font-size: 1.8rem;
  color: var(--text-black);
}
.time-container .text {
  font-size: 1.8rem;
  margin-left: 0.2em;
}
.user-score {
  padding: 1.5em 2em;
  background-color: var(--main-color);
}
.user-score p {
  font-size: 1.8rem;
  color: var(--text-black);
  font-weight: 700;
}

.question-center {
  margin-top: 3em;
}
.question-text {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.5;
}
.question-options {
  margin-top: 2em;
}
.single-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1em 0;
  background: var(--main-white);
  padding: 2em;
  cursor: pointer;
  transition: background 200ms;
  -webkit-transition: background 200ms;
  -moz-transition: background 200ms;
  -ms-transition: background 200ms;
  -o-transition: background 200ms;
}

.single-option.correct,
body.dark-mode .single-option.correct {
  background-color: #d4edda;
}
.single-option.correct span,
body.dark-mode .single-option.correct span {
  color: #155724;
  font-weight: 600;
}

.single-option.incorrect,
body.dark-mode .single-option.single-option.incorrect {
  background-color: #f8d7da;
}
.single-option.incorrect span,
body.dark-mode .single-option.incorrect span {
  color: #721c24;
  font-weight: 600;
}
.single-option.disabled {
  pointer-events: none;
}
.single-option:hover {
  background: var(--light-blue);
}
body.dark-mode .single-option:hover {
  background-color: rgba(255, 255, 255, 0.3);
}
.single-option span {
  font-size: 1.9rem;
  color: var(--text-black);
}
body.dark-mode .single-option span {
  color: #ddd;
  transition: all 0.5s ease;
  -webkit-transition: all 0.5s ease;
  -moz-transition: all 0.5s ease;
  -ms-transition: all 0.5s ease;
  -o-transition: all 0.5s ease;
}
body.dark-mode .single-option:hover span {
  color: #f8f8f8;
}
.single-option i {
  font-size: 1.6rem;
}
.cross-icon,
.tick-icon {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
}
.tick-icon {
  border: 0.2rem solid #228b22;
  border-radius: 50%;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  -ms-border-radius: 50%;
  -o-border-radius: 50%;
}
.cross-icon {
  border: 0.2rem solid #8b0000;
  border-radius: 50%;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  -ms-border-radius: 50%;
  -o-border-radius: 50%;
}
.tick-icon i {
  color: #228b22;
}
.cross-icon i {
  color: #8b0000;
}
.question-footer {
  margin-top: 3em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1em 0;
}
.question-left,
.question-progress {
  flex-basis: 50%;
}
.question-footer .question-left {
  font-size: 1.6rem;
}
.question-progress-container {
  width: 100%;
  height: 1em;
  border: 2px solid var(--main-color);
  border-radius: 1rem;
  margin-bottom: 1rem;
  -webkit-border-radius: 1rem;
  -moz-border-radius: 1rem;
  -ms-border-radius: 1rem;
  -o-border-radius: 1rem;
  position: relative;
}
.question-progress {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background-color: var(--main-color);
}
.question-action button {
  font-size: 1.9rem;
  padding: 0.5em 1em;
  background: var(--main-color);
  outline: 0;
  border: 0.3rem solid var(--main-color);
  cursor: pointer;
  font-weight: 500;
}

.answer-description {
  font-size: 1.9rem;
  padding: 1em;
  margin: 2rem 0;
  background-color: var(--main-color);
  display: none;
}

/* Result Section */
.result-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9;
  display: none;
}
.result-section.active {
  display: flex;
}

.result-box {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 10;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  -moz-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  -o-transform: translate(-50%, -50%);
  padding: 6em;
  text-align: center;
  width: 70%;
  padding: 3em;
  border: 0.9rem solid var(--main-color);
}
.result-expression {
  font-size: 3.2rem;
  font-weight: 700;
  margin-bottom: 1.5em;
}
.result-text {
  font-size: 2.7rem;
  font-weight: 700;
  margin-bottom: 1em;
}
.result-feedback {
  padding: 1em;
  font-size: 1.9rem;
  text-align: center;
  line-height: 1.4;
  font-weight: 500;
  color: var(--secondary-black);
}
.result-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 2em;
}
.restart,
.back-to-home {
  cursor: pointer;
  font-size: 2rem;
  padding: 0.7em 2em;
  border: 0;
  outline: 0;
  transition: all 0.5s;
  -webkit-transition: all 0.5s;
  -moz-transition: all 0.5s;
  -ms-transition: all 0.5s;
  -o-transition: all 0.5s;
  font-weight: 500;
}

.restart {
  color: var(--text-black);
  border: 0.4rem solid var(--main-color);
  transition: all 500ms;
  -webkit-transition: all 500ms;
  -moz-transition: all 500ms;
  -ms-transition: all 500ms;
  -o-transition: all 500ms;
}
.restart:hover {
  background-color: var(--main-color);
}
.back-to-home {
  color: var(--text-black);
  background-color: var(--main-color);
  border: 0.4rem solid var(--main-color);
}

/* Confetti CSS */
#my-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 8;
  background-color: var(--main-white);
  display: none;
}

/* Footer */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 1rem 0 1rem rgba(0, 0, 0, 0.4);
  z-index: 10;
  background-color: var(--white);
}
.copyright {
  font-size: 1.7rem;
  font-weight: 400;
  color: var(--secondary-black);
}

/* Responsive CSS Start */

/* 576 768 992 */
@media only screen and (max-width: 992px) {
  .container {
    padding: 0 2em;
  }
  .fas .fa-moon {
    color: #fca311;
  }

  /* heaer */
  .logo {
    font-size: 3rem;
  }

  /* Banner */
  .banner {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-y: scroll;
  }
  .banner-left,
  .banner-right {
    width: 100%;
    flex-basis: 100%;
  }
  .banner-title {
    margin-top: 3em;
  }

  .banner-right img {
    max-width: 80%;
    margin: 2em auto;
  }
  .banner-right {
    padding-bottom: 5em;
  }
  /* modal */
  .quiz-modal-condition {
    width: 80%;
  }

  /* Question */
  .question-section {
    width: 100%;
    justify-content: center;
    align-items: center;
    overflow-y: scroll;
  }
  .question-container {
    position: static;
    transform: translate(0);
    width: 100%;
    -webkit-transform: translate(0);
    -moz-transform: translate(0);
    -ms-transform: translate(0);
    -o-transform: translate(0);
  }

  /* result section */
  .result-section {
    overflow-y: scroll;
    justify-content: center;
    align-items: center;
    width: 100%;
  }
  .result-box {
    border: none;
    width: 100%;
  }
}

/* 576 px */
@media only screen and (max-width: 576px) {
  /* header */
  .logo {
    font-size: 2.4rem;
  }
  /* Banner */
  .banner {
    flex-direction: column;
  }
  .banner-right {
    margin-top: 4em;
  }
  .banner-right img {
    max-width: 100%;
  }
  .banner-title {
    font-size: 4rem;
  }
  .banner-description {
    font-size: 1.7rem;
  }

  /* Quiz modal */
  .quiz-modal-condition {
    width: 95%;
    padding: 3em;
  }
  .modal-title {
    font-size: 2.5rem;
  }
  .modal-conditions p {
    font-size: 1.6rem;
  }

  /* loading text */
  .loading-text {
    font-size: 3rem;
  }

  /* Question Container */
  .question-container {
    margin-top: 70em;
  }

  .question-header {
    margin-top: 5em;
    flex-direction: column;
    gap: 3em;
  }
  .time-container,
  .user-score {
    width: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
  }
  .time-container .time {
    text-align: center;
  }
  .timeline {
    margin: 2em 0;
  }
  .question-text {
    font-size: 3rem;
    margin: 1.7em 0;
  }
  .single-option span {
    font-size: 1.7rem;
  }
  .question-footer {
    flex-direction: column;
    margin-bottom: 4em;
    gap: 3em;
  }
  .question-left,
  .question-action {
    flex-basis: 100%;
    width: 100%;
  }
  .question-action {
    margin-bottom: 5em;
  }
  .question-action button {
    display: block;
    width: 100%;
  }
  .question-footer {
    gap: 5em;
  }

  /* result box */
  .result-box {
    margin-top: 15em;
  }
  .result-expression {
    font-size: 3rem;
  }
  .result-text {
    font-size: 2.5rem;
  }
  .result-feedback {
    padding: 0;
  }
  .feedback {
    font-size: 1.6rem;
    color: var(--main-black);
  }
  .result-actions {
    flex-direction: column;
    gap: 2em;
    margin-bottom: 5em;
  }
  .result-section button {
    width: 100%;
  }

  /* copyright */
  .copyright {
    font-size: 1.3rem;
  }
}
