@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

body {
  font-family: 'Montserrat', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.container {
  width: 80%;
  background: #ffffff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

header {
  text-align: center;
  margin-bottom: 30px;
}

h1 {
  font-size: 32px;
  font-weight: 700;
  color: #333333;
  margin-bottom: 5px;
}

header p {
  font-size: 18px;
  color: #666666;
}

.toc-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  grid-gap: 20px;
}

.toc-item {
  background: linear-gradient(90deg, #ff7e5f, #feb47b);
  color: #ffffff;
  padding: 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.toc-item:nth-child(2) {
  background: linear-gradient(90deg, #6a11cb, #2575fc);
}

.toc-item:nth-child(3) {
  background: linear-gradient(90deg, #11998e, #38ef7d);
}

.toc-item:nth-child(4) {
  background: linear-gradient(90deg, #f7971e, #ffd200);
}

.toc-item:nth-child(5) {
  background: linear-gradient(90deg, #e1f71efb, #2bff00ea);
}

.toc-item:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.toc-number {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 10px;
}

.toc-item p {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-content {
  width: 80%;
  max-height: 80vh;
  background: #ffffff;
  padding: 30px;
  border-radius: 10px;
  position: relative;
  animation: popupOpen 0.5s cubic-bezier(0.17, 0.67, 0.83, 0.67);
  transform-origin: top center;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .container {
    width: 90%;
  }
  header { 
    margin-top: 20rem;
  }

}

@keyframes popupOpen {
  0% {
    transform: scale(0.3) translateY(-50%);
    opacity: 0;
  }
  60% {
    transform: scale(1.1) translateY(0%);
    opacity: 1;
  }
  100% {
    transform: scale(1) translateY(0%);
  }
}

.close-btn {
  position: sticky;
  top: 0;
  right: 20px;
  font-size: 32px;
  color: #ffffff;
  cursor: pointer;
  background-color: rgba(255, 47, 0, 0.808);
  padding: 5px;
  border-radius: 5px;
}

.accordion {
  margin-top: 20px;
}

.accordion-item h3 {
  background: linear-gradient(90deg, #4facfe, #00f2fe);
  color: #ffffff;
  padding: 10px;
  cursor: pointer;
  margin: 0;
  border: 1px solid #ddd;
  transition: background 0.3s ease;
}

.accordion-item h3:hover {
  background: linear-gradient(90deg, #8e2de2, #4a00e0);
}

.accordion-item ul {
  list-style: none;
  padding: 10px;
  margin: 0;
  background: #fafafa;
  display: none;
  animation: slideDown 0.3s ease-in-out;
}

@keyframes slideDown {
  0% {
    transform: translateY(-10px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.accordion-item ul li {
  padding: 5px 0;
  border-bottom: 1px solid #eee;
}

.accordion-item ul li:last-child {
  border-bottom: none;
}

.popup-content::-webkit-scrollbar {
  display: none;
}

.popup-content::-webkit-scrollbar-track {
  background: transparent;
}

.popup-content::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 5px;
  width: 5px;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.popup-content:hover::-webkit-scrollbar-thumb,
.popup-content:active::-webkit-scrollbar-thumb {
  opacity: 1;
}

.button-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.button {
  display: inline-block;
  background: linear-gradient(90deg, #112c41, #0c103f);
  color: #ffffff;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  transition: background 0.3s ease;
}

.button:hover {
  background: linear-gradient(90deg, #8e2de2, #4a00e0);
}

.button--main-color {
  background: linear-gradient(90deg, #0091ff, #0091ff88);
  font-size: 1.5rem;
  font-variant: small-caps;
}

@media (max-width: 768px) {
  .button-container {
    flex-direction: column;
    align-items: center;
  }

  .button {
    width: 100%;
    max-width: 300px;
  }
}