body {
    width: auto;
    margin-top: 10px;
    margin: auto;
    font-family: "Lato", sans-serif;
    color: #222222;
    padding: 10px;
    font-weight: 300;
    overflow-x: hidden;
    overflow-y: auto;
}

h2 {
    border-bottom: 2px solid #007bff;
}

a {
    text-decoration: none;
    color: #007bff;
}

a:hover {
    text-decoration: underline;
}

p a {
    text-decoration: underline;
    cursor: pointer;
    color: #009CDE;
}

ul, li {
    list-style-type: none;
    color: #222222;
    padding: 5px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
    font-size: 1rem;
    text-align: center;
}

th, td {
    padding: 0.5em 1em;
    border: 1px solid #ccc;
}

thead {
    background-color: #f5f5f5;
    font-weight: bold;
}

tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}


.menu-top {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    background-color: #ffffff; /* preserve original block shading */
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0 20px;
    height: 80px;
    transition: all 0.3s ease;
}

.menu-top.shrink {
    height: 40px;
}

.menu-top ul#menu {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.menu-top ul#menu > li {
    margin: 0 10px;
}

.menu-top ul#menu > li > a {
    color: #222222;
    text-decoration: none;
    display: block;
    line-height: 80px;
    transition: line-height 0.3s;
}

.menu-top.shrink ul#menu > li > a {
    line-height: 40px;
}

/* Optional: scale down the logo a bit when shrunk */
#logo {
    height: 60px;
    transition: transform 0.3s ease;
}
.menu-top.shrink #logo {
    transform: scale(0.5);
    transform-origin: left center;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%; /* Drop directly below the menu item */
    left: 0;
    flex-direction: column;
    background-color: #ffffff;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 10;
  }



.dropdown-content li a {
    padding: 10px 15px;
    color: #333;
    display: block;
    position: relative;
    top: 100%;
    left: 0;
}

.menu-top ul#menu > li.dropdown:hover .dropdown-content {
    display: flex;
}

/* Content Section */
.content {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    overflow: visible;
}

.section {
    padding: 20px;
    width: 80%;
    margin: auto;
}


/* Responsive Styling */
@media screen and (max-width: 750px) {
    .unit-nav li {
        font-size: 12px;
    }
    .button-1 {
        font-size: 0.6em;
    }
}

@media screen and (min-width: 1024px) {
    .unit-intro p {
        font-size: 1.8em;
    }
    .button-1 {
        font-size: 0.8em;
    }
}

.unit-nav ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    /* max-width: 600px; */
    text-align: left;
}

.unit-nav li {
    margin: 10px 0;
}

.unit-nav a {
    font-size: 1.2em;
    color: #0066cc;
    text-decoration: none;
    transition: all 0.2s ease;
}

.unit-nav a:hover {
    text-decoration: underline;
    color: #003399;
}

#sidebar-toggle {
    position: fixed;
    right: 1em;
    bottom: 1em;
    background: #007bff;
    color: white;
    padding: 10px 12px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    z-index: 1001;
  }
  
  #chat-sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100%;
    background: #f0f0f0;
    border-left: 1px solid #ccc;
    box-shadow: -2px 0 4px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
  }
  
  #chat-sidebar.open {
    right: 0;
  }
  
  #chat-header {
    background: #007bff;
    color: white;
    padding: 0.5em 1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  #chat-messages {
    flex: 1;
    padding: 1em;
    overflow-y: auto;
    font-size: 14px;
    background: white;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
  }
  
  #chat-input {
    display: flex;
    padding: 0.5em;
    background: #fafafa;
  }
  
  #chat-input input {
    flex: 1;
    padding: 0.4em;
    margin-right: 0.5em;
  }
  
  #chat-input button {
    padding: 0.4em 1em;
  }
  
  #online-users-list {
    padding: 0.5em 1em;
    font-size: 13px;
    max-height: 150px;
    overflow-y: auto;
  }
  
  #user-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  #sidebar-toggle {
    position: fixed;
    right: 1em;
    bottom: 1em;
    background: #007bff;
    color: white;
    padding: 10px 12px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    z-index: 1001;
  }
  
  #chat-sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100%;
    background: #f0f0f0;
    border-left: 1px solid #ccc;
    box-shadow: -2px 0 4px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
  }
  
  #chat-sidebar.open {
    right: 0;
  }
  
  #chat-header {
    background: #007bff;
    color: white;
    padding: 0.5em 1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  #chat-messages {
    flex: 1;
    padding: 1em;
    overflow-y: auto;
    font-size: 14px;
    background: white;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
  }
  
  #chat-input {
    display: flex;
    padding: 0.5em;
    background: #fafafa;
  }
  
  #chat-input input {
    flex: 1;
    padding: 0.4em;
    margin-right: 0.5em;
  }
  
  #chat-input button {
    padding: 0.4em 1em;
  }
  
  #online-users-list {
    padding: 0.5em 1em;
    font-size: 13px;
    max-height: 150px;
    overflow-y: auto;
  }
  
  #user-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  
  .chat-msg.teacher {
    background: #00d0a1;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    margin: 4px 0;
    font-weight: bold;
  }
  
  .chat-msg.student {
    background: #64bdff;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    margin: 4px 0;
  }
  
.chat-msg.teacher { background: #00d0a1; color: white; padding: 4px; border-radius: 4px; margin: 4px 0; }
.chat-msg.student { background: #64bdff; color: white; padding: 4px; border-radius: 4px; margin: 4px 0; }

.unit-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1em;
}
.unit-table th,
.unit-table td {
  border: 1px solid #ccc;
  padding: 0.5em;
  vertical-align: top;
}
.unit-table th {
  background: #f4f4f4;
  font-weight: bold;
}