@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

:root{
  --purple: #A729F5;
  --dark-navy: #313E51;
  --navy: #3B4D66;
  --grey-navy: #626C7F;
  --light-bluish: #ABC1E1;
  --light-gray: #F4F6FA;
  --pure-white: #fff;
  --green: #26D782;
  --red: #EE5454;
}

body[data-theme="light"]{
  --bg-image-mobile: url('../images/bg-mobile-light.svg');
  --bg-image-desktop: url('../images/bg-desktop-light.svg');
  --bg-color: var(--light-gray);
  --fg-color: var(--pure-white);
  --text-color: var(--dark-navy);
  --small-text-color: var(--grey-navy);
  --icon-color: var(--grey-navy);
  --error-color: var(--red)

}

body[data-theme="dark"]{
  --bg-image-mobile: url('../images/bg-mobile-dark.svg');
  --bg-image-desktop: url('../images/bg-desktop-dark.svg');
  --bg-color: var(--dark-navy);
  --fg-color: var(--navy);
  --text-color: var(--pure-white);
  --small-text-color: var(--light-bluish);
  --icon-color: var(--pure-white);
  --error-color: var(--pure-white);
}
.dark-mode-image,
.light-mode-image {
  display: none;
  position: relative;
  z-index: -1;
}


body[data-theme="dark"] .dark-mode-image,
body[data-theme="light"] .light-mode-image{
  display: block;
} 

/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
}

body {
  -webkit-font-smoothing: antialiased;
  font-family: "Rubik", serif;
  background: var(--bg-image-mobile);
  background-repeat: no-repeat;
  background-color: var(--bg-color);
}

/* 5. Improve media defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* 6. Inherit fonts for form controls */
input, button, textarea, select {
  font: inherit;
}

/* 7. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* 8. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/*
  9. Create a root stacking context
*/
#root, #__next {
  isolation: isolate;
}

.mobile-none{
  display: none;
}

.theme-btn-container{
  display: flex;
  align-items: center;
  gap: 8px;
  i{
    color: var(--icon-color);
  }
}

#theme-btn{
  display: none;
}

#theme-label{
  width: 32px;
  height: 20px;
  padding: 4px;
  border-radius: 999px;
  background-color: var(--purple);
  display: inline-block;
  position: relative;
}

#theme-label::after{
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  background-color: var(--pure-white);
  border-radius: 50%;
  position: absolute;
  transition: transform .3s;
}

#theme-label:has(input:checked)::after{
  transform: translateX(12px);
}

.container{
  padding: 16px 24px;
  max-width: 1160px;
  margin-inline: auto;
}

.header{
  display: flex;
  justify-content: space-between;
  padding-bottom: 16px;
}

.quiz-name-container{
  display: flex;
  align-items: center;
  gap: 16px;
  h2{
    font-weight: 500;
    font-size: 18px;
    color: var(--text-color);
  }
  img{
    width: 40px;
    height: 40px;
  }
}

.main{
  padding-top: 32px;
}

.menu{
  .menu-info{
    margin-bottom: 40px;
  }
  .menu-title{
    margin-bottom: 16px;
    max-width: 453px;
  }

  .menu-subtitle{
    font-style: italic;
    font-weight: 400;
    font-size: 14px;
    line-height: 21px;
    color: var(--small-text-color);
  }

  .menu-subjects{
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .menu-subject{
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-radius: 12px;
    background-color: var(--fg-color);
    text-decoration: none;
  }  
  .subject-name{
    color: var(--text-color);
    font-weight: 500;
    font-size: 18px;
  }
  .subject-icon{
    width: 40px;
    height: 40px;
  }
}


.question-container{
  margin-bottom: 40px;
  .question-counter{
    color: var(--small-text-color);
    font-style: italic;
    font-size: 14px;
    line-height: 21px;
    font-weight: 400;
    margin-bottom: 12px;
  }
  .question-content{
    color: var(--text-color);
    font-weight: 500;
    font-size: 20px;
    line-height: 24px;
    margin-bottom: 24px;
  }

  .progress-container{
    background-color: var(--fg-color);
    width: 100%;
    height: 16px;
    border-radius: 999px;
    padding: 4px;
  }

  .progress{
    background-color: var(--purple);
    height: 100%;
    border-radius: 999px;
  }
}

.answers-wrapper{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
  .answer-btn{
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    background-color: var(--fg-color);
    border: 3px solid transparent;
    padding: 12px;
    p{
      color: var(--text-color);
      font-size: 18px;
      font-weight: 500;
      text-align: start;
    }
    span{
      width: 40px;
      height: 40px;
      flex-shrink: 0;
      background-color: var(--light-gray);
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--grey-navy);
      font-weight: 500;
      font-size: 18px;
    }
  }
}

.answer-btn.selected{
  border: 3px solid var(--purple);
  span{
    background-color: var(--purple);
    color: var(--pure-white);
  }
}

.purple-btn{
  width: 100%;
  background-color: var(--purple);
  font-weight: 500;
  font-size: 18px;
  color: var(--pure-white);
  border: none;
  padding-block: 19px;
  border-radius: 12px;
  cursor: pointer;
}

@media(width > 768px){
  body{
    background: var(--bg-image-desktop);
    background-repeat: no-repeat;
    background-color: var(--bg-color);
  }
  .container{
    padding: 40px 64px;
  }

  .menu{
    .menu-info{
      margin-bottom: 64px;
    }
    .subject-name{
      font-size: 28px;
    }
    .menu-subject{
      gap: 32px;
    }
    .subject-icon{
      width: 56px;
      height: 56px;
    }
  }
}


@media(width > 1200px){
  .container{
    padding-block: 40px;
    padding-inline: 0px;
  }
  .mobile-none{
    display: block;
  }
  .theme-btn-container{
    i{
      font-size: 21px;
    }
  }
  #theme-label{
    width: 48px;
    height: 28px;
  }
  #theme-label::after{
    width: 20px;
    height: 20px;
  }
  #theme-label:has(input:checked)::after{
    transform: translateX(20px);
  }
  .main{
    padding-top: 99px;
  }
  .menu{
    display: grid;
    grid-template-columns: 1fr 1.12fr;

    .menu-title{
      font-size: 64px;
      margin-bottom: 48px;
    }
    .menu-subtitle{
      font-size: 20px;
      line-height: 30px;
    }
    .menu-subjects{
      gap: 24px;
    }
    .menu-subject{
      padding: 20px;
      border-radius: 24px;
    }
  }
  .quiz{
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .question-container{
    max-width: 465px;
    position: relative;
  }
  .progress-container{
    position: absolute;
    bottom: 0;
  }
  .end-quiz{
    display: grid;
    grid-template-columns: 1fr 1fr;
    h2{
      max-width: 450px;
    }
  }
  .heading{
    font-size: 64px !important;
  }
}

.circle{
  position: absolute;
  bottom: 0;
  right: 0;
  transform: rotate(180deg);
  z-index: -1;
}

.error{
  color: var(--error-color);
  text-align: center;
  font-size: 18px;
  padding-top: 12px;
  i{
    color: var(--red);
  }
}

.hidden{
  display: none;
}

.correct{
  border-color: var(--green)!important;
  span {
    background-color: var(--green) !important;
  }
  i{
    color: var(--green);
    margin-left: auto;
  }
}

.incorrect{
  border-color: var(--red) !important;
  span{
    background-color: var(--red) !important;
  }
  i{
    color: var(--red);
    margin-left: auto;
  }
}

.correct-answer{
  color: var(--green);
  margin-left: auto;
}

.end-quiz{
  .card{
    background-color: var(--fg-color);
    border-radius: 12px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
  }
  .card-header{
    margin-bottom: 40px;
  }
  .quiz-result{
    font-size: 88px;
    font-weight: 500;
    color: var(--text-color);
  }
  .total-questions-count{
    font-size: 18px;
    font-weight: 400;
    color: var(--small-text-color);
  }

}

.heading{
  font-weight: 300;
  font-size: 40px;
  color: var(--text-color);
  span{
    font-weight: 500;
  }
}