html,
body {
  height: 100%;
  margin: 0;
  font-family: "Arial", sans-serif;
  background: #ffffff;
}

* {
  box-sizing: border-box;
}

.wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  height: 100vh;
  max-width: 1500px;
  margin: auto;
  padding: 20px;
}

.content {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  width: 100%;
}

.header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.logo-img {
  width: 50px;
  height: auto;
  margin-right: 10px;
}

.logo {
  font-size: 34px;
  color: #000;
  margin: 0;
}

.back-button {
  position: fixed;
  right: 20px;
  top: 20px;
  cursor: pointer;
}

/* Media Query for Small Devices */
@media (max-width: 768px) {
  .logo-img {
    width: 60px;
    margin-bottom: 5px;
  }

  .logo {
    font-size: 1.5rem;
  }

  .back-button {
    width: 70px;
    height: auto;
    position: fixed;
    top: 10px;
    right: 10px;
    cursor: pointer;
  }

  .header,
  .content,
  .wrapper {
    padding: 0 15px;
  }

  .back-button {
    top: 10px;
    right: 10px;
  }
}

.button-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
  z-index: 1000;
}

.main-button {
  background-color: #f8cad3;
  color: #880720;
  border: none;
  padding: 15px 20px;
  margin: 0 10px;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.3s ease;
  border-radius: 15px;
  z-index: 1;
}

.main-button:hover {
  background-color: #efb3bf;
  color: white;
}

#class-list-container {
  width: 100%;
  z-index: 1;
}

#class-title-container {
  text-align: center;
  margin-top: 20px;
  font-size: 20px;
}

.select-message {
  font-size: 18px;
  color: #333;
  margin: 10px 0;
}

.instructor-container {
  background-color: #f8cad3;
  color: #880720;
  display: inline-block;
  padding: 10px 15px;
  margin: 5px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.instructor-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Spacing adjustment for class buttons */
.class-button {
  margin: 10px 5px; /* Adds margin between each class button */
  padding: 12px 18px;
  display: inline-block;
  border: none;
  cursor: pointer;
  border-radius: 10px;
  font-size: 20px;
}

/* Make each class button occupy a full line on smaller devices */
@media (max-width: 768px) {
  .class-button {
    display: block;
    width: 100%;
    margin: 10px 0; /* Adds spacing between buttons on small screens */
  }
}

.search-button-container {
  display: none;
}

.search-inline-btn {
  padding: 12px 24px;
  font-size: 16px;
  margin: 0;
  align-self: center;
}

.custom-modal {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.custom-modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 90%;
  max-width: 600px;
  margin: auto;
  padding: 20px;
  box-sizing: border-box;
  background-color: #fefefe;
  margin: 10% auto;
  padding: 20px;
  overflow: hidden;
  border: 1px solid #888;
  width: 80%;
  max-width: 600px;
  height: auto;
  aspect-ratio: 1 / 1;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  border-radius: 20px;
}

@media (max-width: 768px) {
  .custom-modal-content {
    width: 95%;
    padding: 10px;
  }
}

#donutchart {
  width: 100%;
  height: auto;
}

.custom-modal-header {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  padding: 10px;
}

.custom-close-button {
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  background: none;
  color: #aaa;
  margin-left: auto;
}

.custom-close-button:hover,
.custom-close-button:focus {
  color: black;
}

#donutchart {
  width: 80%;
  height: 80%;
  margin: auto;
}

@media (max-width: 768px) {
  #donutchart {
    width: 80%;
    height: 300px;
  }

  .custom-modal-content {
    width: 95%;
  }
}

@media (max-width: 480px) {
  #donutchart {
    height: 250px;
  }
}

@media (max-width: 850px) {
  .wrapper {
    flex-direction: column;
    align-items: center;
    padding: 10px;
  }

  .content,
  .header {
    width: 100%;
  }

  .logo-img {
    width: 40px;
  }

  .logo {
    font-size: 24px;
  }

  .back-button {
    right: 10px;
    top: 10px;
  }

  .main-button {
    padding: 10px 15px;
    font-size: 16px;
  }

  .instructor-container {
    margin: 10px;
  }

  .custom-modal-content {
    width: 95%;
    margin-top: 5%;
    padding: 10px;
  }

  #donutchart {
    width: 100%;
    height: 300px;
  }
}

.gradeDistributions-image-container {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 2;
}

@media (max-width: 768px) {
  .gradeDistributions-image-container {
    display: none;
  }
}

@media (max-width: 600px) {
  .custom-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    max-width: 90%;
    padding: 20px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1050;
  }

  .custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1040;
  }

  .custom-modal-content {
    width: 80%;
    padding: 10px;
  }
}

#donutchart {
  margin-left: 70px;
}

@media (max-width: 768px) {
  #donutchart {
    margin-left: 20px;
  }
}

.recent-searches {
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.recent-label {
  font-size: 12px;
  color: #aaa;
}

.recent-chip {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  color: #555;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.recent-chip:hover {
  background: #F8CAD3;
  color: #880720;
  border-color: #F8CAD3;
}

.rmp-link {
  display: block;
  text-align: center;
  font-size: 13px;
  color: #880720;
  margin: 8px 0 0;
  text-decoration: none;
  opacity: 0.7;
}

.rmp-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.semester-section {
  margin: 28px 0 8px;
}

.semester-section h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #999;
  border-bottom: 1px solid #eee;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#class-list-container {
  padding: 0 10px 40px;
}
