/* rem and em don not depend on html font size in media queries, Instead 1rem = 1em = 16px
rem: root font size
em:current font size
*/

/* *************only screen******* */

/* **************************** */
/* Below 1344px (Smaller Desktops) */
/* **************************** */

@media (min-width: 1200px) {
  body {
    max-width: 120rem;
    margin: 0 auto;
  }
  .canvas__div {
    padding: 20px;
  }

  .stuck-at-selector {
    position: absolute;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-flow: row;
    grid-gap: 0.5rem;
    right: 35px;
    bottom: -25px;
    padding: 4px;
  }
  .div1,
  .div2 {
    display: flex;
    justify-content: center; /* Center the image horizontally */
    align-items: center; /* Center the image vertically */
    position: relative;
  }

  .grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px;
    position: relative;
  }
  .timing-diagram {
    width: 100%;
    height: auto;
    max-width: 550px;
    overflow-x: auto;
    /* border: 1px solid #ccc; */
    margin: 0 auto;
  }

  #fault-0 {
    top: 20.5rem !important;
    left: 9rem !important;
  }

  #fault-1 {
    top: 10rem !important;
    left: 8rem !important;
  }

  #fault-2 {
    top: 6.2rem !important;
    left: 7rem !important;
  }

  #fault-3 {
    top: 13.8rem !important;
    left: 5rem !important;
  }

  #fault-4 {
    top: 19.6rem !important;
    left: 4rem !important;
  }

  #fault-5 {
    top: 15.6rem !important;
    left: 5rem !important;
  }

  #fault-6 {
    top: 3.3rem !important;
    left: 12rem !important;
  }

  #fault-7 {
    top: 18.6rem !important;
    left: 12.7rem !important;
  }

  #fault-8 {
    top: 14.8rem !important;
    left: 16rem !important;
  }
  #fault-9 {
    top: 6.6rem !important;
    left: 17.5rem !important;
  }
  #fault-10 {
    top: 8rem !important;
    left: 16.4rem !important;
  }

  #fault-11 {
    top: 19.7rem !important;
    left: 23rem !important;
  }

  #fault-12 {
    top: 5.6rem !important;
    left: 23rem !important;
  }

  #fault-13 {
    top: 10rem !important;
    left: 0.5rem !important;
  }

  #fault-14 {
    top: 6.2rem !important;
    left: 1.8rem !important;
  }

  #fault-15 {
    top: 3.2rem !important;
    left: 1.8rem !important;
  }

  #fault-16 {
    top: 14.6rem !important;
    left: 11rem !important;
  }
  .timing-diagram {
    width: 100%;
    height: auto;
    max-width: 550px;
    overflow-x: auto;
  }
}

/* **************************** */
/* Below 1200px (Lanscape Tablets) */
/* **************************** */

@media (max-width: 75em) {
  .title-div h1 {
    font-size: 2.5rem;
  }
  .task-title {
    font-size: 2rem;
  }
  .tool-menu {
    font-size: 2rem;
    gap: 2rem;
  }
  .icons {
    width: 3rem;
    height: 3rem;
  }
  .ctrl-icons {
    width: 3rem;
    height: 3rem;
  }

  .tool-list span {
    font-size: 1.2rem;
  }
  .canvas {
    display: block;
  }
  .div__control img {
    width: 3rem;
    height: 2.8rem;
  }
  .div1,
  .div2 {
    display: flex;
    justify-content: center; /* Center the image horizontally */
    align-items: center; /* Center the image vertically */
    position: relative;
  }

  .canvas__div {
    padding: 30px;
  }
  .practice {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem;
  }

  .grid-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
    position: relative;
  }
  .timing-diagram {
    width: 100%;
    height: auto;
    max-width: 550px;
    overflow-x: auto;
  }
  #circuit {
    width: 100%;
    max-width: 400px;
    height: auto; /* Maintain aspect ratio */
    display: block; /* Remove extra space below the image */
    margin: 0 auto; /* Center the image */
  }

  #fault-0 {
    top: 20.5rem;
    left: 9rem;
  }

  #fault-1 {
    top: 10rem;
    left: 12rem;
  }

  #fault-2 {
    top: 6.2rem;
    left: 6rem;
  }

  #fault-3 {
    top: 13.8rem;
    left: 9rem;
  }

  #fault-4 {
    top: 19.6rem;
    left: 4rem;
  }

  #fault-5 {
    top: 15.6rem;
    left: 9rem;
  }

  #fault-6 {
    top: 3.3rem;
    left: 12rem;
  }

  #fault-7 {
    top: 18.6rem;
    left: 21rem;
  }

  #fault-8 {
    top: 14.8rem;
    left: 27rem;
  }
  #fault-9 {
    top: 6.6rem;
    left: 10.5rem;
  }
  #fault-10 {
    top: 8rem;
    left: 27.4rem;
  }

  #fault-11 {
    top: 19.7rem;
    left: 37rem;
  }

  #fault-12 {
    top: 5.6rem;
    left: 38rem;
  }

  #fault-13 {
    top: 10rem;
    left: 0.5rem;
  }

  #fault-14 {
    top: 6.2rem;
    left: 2.8rem;
  }

  #fault-15 {
    top: 3.2rem;
    left: 2.8rem;
  }

  #fault-16 {
    top: 14.6rem;
    left: 18rem;
  }
  .col-sm-5 {
    position: relative;
    left: 0px;
    top: 0px;
  }
  .timing-diagram {
    width: 100%;
    height: auto;
    max-width: 700px;
    overflow-x: auto;
  }
}

/* **************************** */
/* Below 944px ( Tablets) */
/* **************************** */

@media (max-width: 59em) {
  body {
    width: 100%;
    margin: 0;
  }
  .tool-link:link,
  .tool-link:visited {
    gap: 0.5rem;
    font-size: 1.4rem;
    flex-direction: column;
  }

  .title-div h1 {
    font-size: 1.8rem;
  }
  .sidebar {
    position: fixed;
    padding: 0;
    bottom: 0;
    left: 0;
    flex-direction: row;
    width: 100%;
    backdrop-filter: blur(10rem);
    z-index: 101;
    justify-content: space-evenly;
    border-radius: 0;
    scroll-behavior: auto;
    margin: 0;
  }
  .main {
    grid-column: 1/-1;
  }
  .tool-menu {
    list-style: none;
    display: flex;
    flex-direction: row;
    gap: 4rem;
    width: 100%;
    font-size: 2.4rem;
    justify-content: space-evenly;
    padding: 1rem;
  }
  #image_container {
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.85);
    margin-left: -525px;
  }

  .canvas {
    display: block;
  }
  .main-section {
    grid-template-columns: 1fr;
  }
  .canvas__div {
    /* grid-template-columns: 1fr; */
    padding: 85px;
  }
  .canvas {
    display: block;
    border: none;
  }
  .footer {
    margin-bottom: 78px;
  }

  .timing-diagram {
    width: 100%;
    height: auto;
    max-width: 700px;
    overflow-x: auto;
    transform: scale(0.8);
  }
  #circuit {
    width: 100%;
    max-width: 400px;
    height: auto; /* Maintain aspect ratio */
    display: block; /* Remove extra space below the image */
    margin: 0 auto; /* Center the image */
  }
}

/* **************************** */
/* Below 820px (Smaller Tablets) */
/* **************************** */
@media (max-width: 48em) {
  .main-section {
    grid-template-columns: 1fr;
  }

  .canvas__div {
    padding: 80px;
  }
  .canvas {
    display: block;
    border: none;
  }
  .tool-list span {
    font-size: 1.6rem;
  }

  .footer {
    margin-bottom: 78px;
  }
  .div1,
  .div2 {
    display: flex;
    justify-content: center; /* Center the image horizontally */
    align-items: center; /* Center the image vertically */
    position: relative;
  }

  .title-div h1 {
    font-size: 1.6rem;
  }

  #circuit {
    /* width: 100%; */
    max-width: 400px;
    height: auto; /* Maintain aspect ratio */
    display: block; /* Remove extra space below the image */
    margin: 0 auto; /* Center the image */
  }
  .timing-diagram {
    width: 100%;
    height: auto;
    max-width: 500px;
    overflow-x: auto;
    /* border: 1px solid #ccc; */
    /* margin: 0 auto; */
  }
}

/* **************************** */
/* Below 704px (Smaller Tablets) */
/* **************************** */
@media (max-width: 44em) {
  body {
    width: 100%;
    margin: unset;
  }
  .title-div h1 {
    font-size: 1.4rem;
  }
  .task-title {
    font-size: 2rem;
  }
  .tool-menu {
    font-size: 2rem;
    gap: 2rem;
  }
  .icons {
    width: 3rem;
    height: 3rem;
  }
  .ctrl-icons {
    width: 3rem;
    height: 3rem;
  }

  .tool-list span {
    font-size: 1.2rem;
  }
  .canvas {
    display: block;
  }
  .div__control img {
    width: 3rem;
    height: 2.8rem;
  }
  .div1,
  .div2 {
    display: flex;
    justify-content: center; /* Center the image horizontally */
    align-items: center; /* Center the image vertically */
    position: relative;
  }

  .canvas__div {
    padding: 30px;
  }
  .practice {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem;
  }

  .grid-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
    position: relative;
  }
  .timing-diagram {
    width: 100%;
    height: auto;
    max-width: 400px;
    overflow-x: auto;
  }
  #circuit {
    width: 100%;
    max-width: 400px;
    height: auto; /* Maintain aspect ratio */
    display: block; /* Remove extra space below the image */
    margin: 0 auto; /* Center the image */
  }

  #fault-0 {
    top: 20.5rem;
    left: 9rem;
  }

  #fault-1 {
    top: 10rem;
    left: 12rem;
  }

  #fault-2 {
    top: 6.5rem;
    left: 7rem;
  }

  #fault-3 {
    top: 13.8rem;
    left: 9rem;
  }

  #fault-4 {
    top: 19.6rem;
    left: 4rem;
  }

  #fault-5 {
    top: 15.6rem;
    left: 9rem;
  }

  #fault-6 {
    top: 3.3rem;
    left: 12rem;
  }

  #fault-7 {
    top: 18.6rem;
    left: 21rem;
  }

  #fault-8 {
    top: 14.8rem;
    left: 27rem;
  }
  #fault-9 {
    top: 6.6rem;
    left: 17.5rem;
  }
  #fault-10 {
    top: 8rem;
    left: 27.4rem;
  }

  #fault-11 {
    top: 19.7rem;
    left: 37rem;
  }

  #fault-12 {
    top: 5.6rem;
    left: 38rem;
  }

  #fault-13 {
    top: 10rem;
    left: 0.5rem;
  }

  #fault-14 {
    top: 6.2rem;
    left: 2.8rem;
  }

  #fault-15 {
    top: 3.2rem;
    left: 2.8rem;
  }

  #fault-16 {
    top: 14.6rem;
    left: 18rem;
  }
  .col-sm-5 {
    position: relative;
    left: 0px;
    top: 0px;
  }
  .led {
    width: 5rem;
  }
  .timing-diagram {
    width: 100%;
    height: auto;
    max-width: 440px;
    overflow-x: auto;
    /* border: 1px solid #ccc; */
    margin: 0 auto;
  }
}

/* **************************** */
/* Below 540px (Smaller Tablets) */
/* **************************** */
@media (max-width: 34em) {
  .canvas__div {
    grid-template-columns: 1fr;
  }
  .div1,
  .div2 {
    width: 100%; /* Full width of container */
    position: relative; /* Position relative for internal absolute elements */
    padding: 15px; /* Add padding to prevent overlap */
    /* Add spacing between divs */
    box-sizing: border-box; /* Ensures padding doesn’t add to width */
  }

  .stuck-at-selector {
    position: absolute;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-flow: row;
    grid-gap: 0.5rem;
    bottom: -40px;
    padding: 4px;
  }

  .title-div h1 {
    font-size: 1.2rem;
  }

  .logo-div {
    width: 4.5rem;
  }
  .div__control {
    gap: 2rem;
  }
  .ctrl-icons {
    width: 2.5rem;
    height: 2.5rem;
  }
  .tool-menu {
    gap: 1.5rem;
  }
  .tool-list span {
    font-size: 1.2rem;
  }
  .task-title {
    font-size: 1.7rem;
  }
  canvas {
    width: 100%;
  }
  label,
  select,
  input,
  p {
    display: inline-block;
    font-size: 1.5rem;
  }
  .main {
    gap: 0.5rem;
  }
  .main-section {
    gap: 0.5rem;
  }
  .sidebar {
    border-radius: 0;
  }
  .canvas {
    display: block;
    border: none;
  }
  .div__control img {
    width: 2.7rem;
    height: 2.5rem;
  }
  .tooltip {
    font-size: 1rem;
  }
  .footer {
    margin-bottom: 78px;
  }

  .practice {
    margin: 0;
    padding: 0;
  }

  #buttonDiv {
    /* margin: 20px; */
    margin: 14%;
  }

  #heading1 {
    font-size: 15px;
  }
  #heading2 {
    font-size: 15px;
  }
  .faulty th,
  .faulty td {
    border: 1px solid black;
    text-align: center;
    padding: 0.11rem;
    font-size: 0.9rem;
    word-break: break-word;
  }
  .grid-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
    position: relative;
  }
  #circuit {
    width: 100%;
    max-width: 350px;
    height: auto; /* Maintain aspect ratio */
    display: block; /* Remove extra space below the image */
    margin: 0 auto; /* Center the image */
  }
  #fault-0 {
    top: 18rem;
    left: 9rem;
  }

  #fault-1 {
    top: 8.5rem;
    left: 12rem;
  }

  #fault-2 {
    top: 5.5rem;
    left: 6.5rem;
  }

  #fault-3 {
    top: 12rem;
    left: 9rem;
  }

  #fault-4 {
    top: 17.2rem;
    left: 4rem;
  }

  #fault-5 {
    top: 13.6rem;
    left: 9rem;
  }

  #fault-6 {
    top: 2.8rem;
    left: 12rem;
  }

  #fault-7 {
    top: 16.2rem;
    left: 18.5rem;
  }

  #fault-8 {
    top: 12.8rem;
    left: 23rem;
  }
  #fault-9 {
    top: 5.6rem;
    left: 15.5rem;
  }
  #fault-10 {
    top: 7rem;
    left: 23.4rem;
  }

  #fault-11 {
    top: 17.1rem;
    left: 33rem;
  }

  #fault-12 {
    top: 5rem;
    left: 33rem;
  }

  #fault-13 {
    top: 8.5rem;
    left: 0.5rem;
  }

  #fault-14 {
    top: 5.6rem;
    left: 3rem;
  }

  #fault-15 {
    top: 2.7rem;
    left: 2.8rem;
  }

  #fault-16 {
    top: 12.8rem;
    left: 17rem;
  }
  .led {
    width: 4rem;
  }
  .timing-diagram {
    width: 100%;
    height: auto;
    max-width: 400px;
    overflow-x: auto;
    /* border: 1px solid #ccc; */
    margin: 0 auto;
  }
}

@media (max-width: 30em) {
  .div1,
  .div2 {
    width: 100%; /* Full width of container */
    position: relative; /* Position relative for internal absolute elements */
    padding: 15px; /* Add padding to prevent overlap */
    /* Add spacing between divs */
    box-sizing: border-box; /* Ensures padding doesn’t add to width */
  }

  .title-div h1 {
    font-size: 1.2rem;
  }
  .ttable {
    width: 100%;
  }

  #circuit {
    width: 100%;
    max-width: 275px;
    height: auto; /* Maintain aspect ratio */
    display: block; /* Remove extra space below the image */
    margin: 0 auto; /* Center the image */
  }
  #fault-0 {
    top: 14rem;
    left: 9rem;
  }

  #fault-1 {
    top: 6.5rem;
    left: 10rem;
  }

  #fault-2 {
    top: 4.2rem;
    left: 7.5rem;
  }

  #fault-3 {
    top: 9.2rem;
    left: 7rem;
  }

  #fault-4 {
    top: 13.3rem;
    left: 5rem;
  }

  #fault-5 {
    top: 10.6rem;
    left: 7rem;
  }

  #fault-6 {
    top: 2rem;
    left: 12rem;
  }

  #fault-7 {
    top: 12.6rem;
    left: 14.5rem;
  }

  #fault-8 {
    top: 9.8rem;
    left: 18rem;
  }
  #fault-9 {
    top: 4.3rem;
    left: 12.5rem;
  }
  #fault-10 {
    top: 5.5rem;
    left: 18.4rem;
  }

  #fault-11 {
    top: 13.4rem;
    left: 25rem;
  }

  #fault-12 {
    top: 3.8rem;
    left: 26rem;
  }

  #fault-13 {
    top: 6.5rem;
    left: 0.5rem;
  }

  #fault-14 {
    top: 4.3rem;
    left: 2.7rem;
  }

  #fault-15 {
    top: 1.9rem;
    left: 2.7rem;
  }

  #fault-16 {
    top: 10rem;
    left: 12.2rem;
  }
  .timing-diagram {
    width: 100%;
    height: auto;
    max-width: 340px;
    overflow-x: auto;
    /* border: 1px solid #ccc; */
    margin: 0 auto;
    position: relative;
    left: 0px;
  }
}

@media (max-width: 27em) {
  .sidebar {
    position: fixed;
    padding: 0;
    bottom: 0;
    left: 0;
    flex-direction: row;
    width: 100%;
    backdrop-filter: blur(10rem);
    z-index: 101;
    justify-content: space-evenly;
    border-radius: 0;
    scroll-behavior: auto;
  }

  #buttonDiv {
    /* margin: 20px; */
    margin: 14%;
    margin-left: -14px;
  }
  .tool-menu {
    list-style: none;
    display: flex;
    flex-direction: row;
    gap: 3rem;
    width: 100%;
    font-size: 2.4rem;
    justify-content: space-evenly;
    padding: 1rem;
  }
  .canvas__div {
    min-height: calc(100vh - 7 * 5.6rem);
    overflow: hidden;
    margin: 0;
    padding: 0rem;
  }
  .apparatus-screen {
    grid-template-columns: 1fr;
  }
  .practice {
    margin: 0;
    padding: 0;
  }
  .quiz-div {
    padding: 0.5rem;
    width: 100%;
  }
  .answers {
    grid-template-columns: 1fr;
  }
  .practice-step-no {
    width: 3rem;
    height: 3rem;
  }
  .btn-next,
  .btn-reset,
  .btn-top {
    width: 3rem;
    height: 3rem;
  }
  .footer {
    margin-bottom: 78px;
  }

  .canvas__div {
    grid-template-columns: 1fr;
    padding: 0px;
  }

  .div1,
  .div2 {
    width: 100%; /* Full width of container */
    position: relative; /* Position relative for internal absolute elements */
    padding: 15px; /* Add padding to prevent overlap */
    /* Add spacing between divs */
    box-sizing: border-box; /* Ensures padding doesn’t add to width */
  }

  .title-div h1 {
    font-size: 1.1rem;
  }

  #circuit {
    width: 100%;
    max-width: 230px;
    height: auto; /* Maintain aspect ratio */
    display: block; /* Remove extra space below the image */
    margin: 0 auto; /* Center the image */
  }
  #fault-0 {
    top: 11.7rem;
    left: 9rem;
  }

  #fault-1 {
    top: 5.5rem;
    left: 8rem;
  }

  #fault-2 {
    top: 3.6rem;
    left: 5.9rem;
  }

  #fault-3 {
    top: 7.6rem;
    left: 5rem;
  }

  #fault-4 {
    top: 11rem;
    left: 5rem;
  }

  #fault-5 {
    top: 8.9rem;
    left: 5rem;
  }

  #fault-6 {
    top: 1.5rem;
    left: 10rem;
  }

  #fault-7 {
    top: 10.5rem;
    left: 12.5rem;
  }

  #fault-8 {
    top: 8.2rem;
    left: 15rem;
  }
  #fault-9 {
    top: 3.5rem;
    left: 10rem;
  }
  #fault-10 {
    top: 4.5rem;
    left: 15.4rem;
  }

  #fault-11 {
    top: 11rem;
    left: 21rem;
  }

  #fault-12 {
    top: 3rem;
    left: 21.5rem;
  }

  #fault-13 {
    top: 5.5rem;
    left: 0.5rem;
  }

  #fault-14 {
    top: 3.3rem;
    left: 2.3rem;
  }

  #fault-15 {
    top: 1.5rem;
    left: 2.3rem;
  }

  #fault-16 {
    top: 8rem;
    left: 10.2rem;
  }
  .timing-diagram {
    width: 100%;
    height: auto;
    max-width: 270px;
    overflow-x: auto;
    /* border: 1px solid #ccc; */
    margin: 0 auto;
    /* position: relative;
    left: -34px; */
  }
}

@media (max-width: 24em) {
  .ttable {
    width: 85%;
    position: relative;
    left: -35px;
  }
  .title-div h1 {
    font-size: 1rem;
  }
}

@media (max-width: 20em) {
  .title-div h1 {
    font-size: 0.9rem;
  }
}
/* 
  
  - Font sizes (px)
  10 / 12 / 14 / 16 / 18 / 20 / 24 / 30 / 36 / 44 / 52 / 62 / 74 / 86 / 98
  
  - Spacing system (px)
  2 / 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 / 80 / 96 / 128
  
   */
