body {
  font-family: Arial, sans-serif;
  margin: 0;
  background-image: url('upminbackground.png');
  background-size: cover;         
  background-position: center;    
  background-repeat: no-repeat;   
  background-attachment: fixed;
  color: #fff;
  padding: 2rem;
  padding-right: 220px;
  transition: background-color 0.5s, color 0.3s;
  line-height: 1.6;
  scroll-behavior: smooth;
  position: relative; 
  z-index: 0;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55); 
  z-index: -1;
}

#rcorners3 {
  position: fixed;
  margin-top: 10px;
  margin-bottom: 10px;
  margin-right: 200px; 
  right: 10px;
  left: 10px;
  width: calc(90% - 180px);       
  background: rgb(97, 9, 9, 1.0);
  border-radius: 0 0 25px 25px; 
  padding: 15px 30px;          
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  z-index: 1000;
}


#rcorners3 h1 {
  font-family: 'Merriweather', serif;
  font-weight: 700;
  font-size: 3.0rem;
  color: rgba(237, 237, 237);
  margin: 0;
}

#rcorners3 .subtitle {
  font-weight: 500;
  font-size: 1.1rem;
  color: rgba(237, 237, 237);
  letter-spacing: 0.05em;
  margin-top: 0;
}

header {
  padding: 20px;
}

nav {
  position: fixed;
  top: 0;
  right: 0;
  margin-top: 10px;
  margin-bottom: 40px;
  height: 90vh;
  width: 200px;
  background-color: rgb(97, 9, 9, 0.7);
  padding: 1rem;
  box-shadow: -2px 0 4px rgba(255, 255, 255, 0.1);
  border-radius: 10px 0 0 10px; 
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto; 
}


nav h1, nav h2 {
  margin: 0 0 10px;
}

nav a {
  display: block;
  margin: 8px 0;
  text-decoration: none;
  color: #f9f9fa;
  font-weight: bold;
  transition: all 0.3s ease;
}

nav a:hover {
  color: #686e7e;
  transform: translateX(5px);
}

main {
  max-width: 800px; 
  /* margin-left: 40px;
  margin-right: 100px; */
  padding-top: 230px; 
  padding-left: 200px;
  padding-right: 20px;
  padding-bottom: 20px;
}

#rcorners2 {
  color: rgb(97, 9, 9, 0.7);
  background: #f3f4f6;
  border-radius: 15px;
  padding: 10px;
  margin-top: 20px;
}

.collapsible-section {
  margin-bottom: 30px;
}

.subtopic {
  margin: 15px 0px;
}

.toggle-subtopic {
  background: rgba(201, 150, 150, 0.2);
  color: white;
  padding: 10px 15px;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-size: 16px;
  border-radius: 10px;
  transition: background 0.3s;
}

.toggle-subtopic:hover {
  background: #62a2b9;
}

.subtopic-content {
  display: none;
  padding: 15px;
  margin-top: 5px;
  background: rgb(97, 9, 9, 0.5);
  border-radius: 10px;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}

#themeToggle {
  position: left;
  margin-left: 10px;
  vertical-align: middle;
  top: 20px;
  right: 20px;
  background: #e0f2fe;
  border: none;
  padding: 10px;
  font-size: 18px;
  cursor: pointer;
  z-index: 999;
  transition: background 0.3s;
}

#themeToggle:hover {
  background: #bae6fd;
}

#backToTop {
  display: none;
  position: fixed;
  bottom: 25px;
  right: 25px;
  background-color: #1e40af;
  color: white;
  padding: 12px;
  border-radius: 50%;
  font-size: 20px;
  text-align: center;
  text-decoration: none;
  z-index: 999;
  transition: background 0.3s;
}

#backToTop:hover {
  background-color: #2563eb;
}

.dark-mode {
  background-color: #1e293b;
  color: #e2e8f0;
}

.dark-mode nav {
  background: #334155;
}

.dark-mode #rcorners3 {
  background: #475569;
}

.dark-mode #rcorners2 {
  background: #b3bed3;
}

.dark-mode nav a {
  color: #e2e8f0;
}

.dark-mode .toggle-subtopic {
  background: #64748b;
}

.dark-mode .subtopic-content {
  background: #334155;
}

button {
      background-color: rgb(97, 9, 9);
      color: white;
      border: none;
      padding: 12px 24px;
      font-size: 16px;
      border-radius: 12px;
      cursor: pointer;
      transition: background-color 0.3s ease, transform 2.5s ease;
}

button:hover {
      background-color: rgb(130, 20, 20);
      transform: scale(1.05);
}

@media (max-width: 768px) {
  body {
    padding: 1rem;
    padding-right: 200px; 
    background-position: center;
    background-attachment: scroll;
  }

  nav {
    position: fixed;
    top: 15px;
    bottom: 15px;
    right: 0;
    height: 100vh;
    width: 140px;
    padding: 0.5rem;
    border-radius: 10px 0 0 10px;
    overflow-y: auto;
  }

  #rcorners3 {
    width: calc(100% - 200px);
    margin-right: 180px;
    padding: 5px 10px;
  }

  main {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 400px;
  }

  #rcorners3 h1 {
    font-size: 2rem;
  }

  #rcorners3 .subtitle {
    font-size: 1rem;
  }

  #backToTop {
    bottom: 20px;
    right: 20px;
  }
}

