body {
    font-family: Verdana, sans-serif;
    margin: 0;
    color: #343148;Content
}

h1 {
    color: #343148;
    margin-top: 10px;
    margin-bottom: 10px;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
    clear: both;
}

a {
    color: deepskyblue;
    text-decoration: none;
}

code {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 14px;
    color: #333
}

.box {
    float: left;
    border: 1px solid #ccc;
    width: 250px;
    height: 300px;
    border-radius: 10px;
    color: black;
}

.info {
    margin: 10px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, 250px);
    gap: 16px;
    justify-content: center;
    width: 100%;
}

.box-wrapper {
    display: flex;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    width: 100%;
}

.box-danger {
    background-color: #f8d7da;
    border: 2px solid #f5c6cb;
    border-radius: 10px;
    font-size: 0.95em;
    padding-right: 20px;
    padding-left: 20px;
    color: #721c24;
    margin-top: 10px;
    margin-bottom: 10px;
}

.box-warning {
    background-color: #fff3cd;
    border: 2px solid #ffeeba;
    border-radius: 10px;
    font-size: 0.95em;
    padding-right: 20px;
    padding-left: 20px;
    color: #856404;
    margin-top: 10px;
    margin-bottom: 10px;
}

.box-success {
    background-color: #d4edda;
    border: 2px solid #c3e6cb;
    border-radius: 10px;
    font-size: 0.95em;
    padding-right: 20px;
    padding-left: 20px;
    margin-top: 10px;
    color: #155724;
    margin-bottom: 10px;
}

.box-info {
    background-color: #d1ecf1;
    border: 2px solid #bee5eb;
    border-radius: 10px;
    font-size: 0.95em;
    padding-right: 20px;
    padding-left: 20px;
    margin-top: 10px;
    color: #0c5460;
    margin-bottom: 10px;
}

.solution {
    display: none;
    padding: 0.5em;
    margin-top: 0.5em;
    color: #333;
    background-color: #f9f9f9;
    border-left: 4px solid #ccc;
    font-size: 0.95em;
}

.solution.visible {
    display: block;
}

.box-exercise {
    border: 2px solid #f0ad4e;
    background-color: #fff8dc;
    padding: 1em;
    margin: 1em 0;
    color: #856404;
    font-size: 0.95em;
}

pre code {
    display: block;
    padding: 1em;
    background-color: #f5f5f5;
    overflow-x: auto;
    white-space: pre;
    font-family: monospace;
    line-height: 1.4;
    border-radius: 4px;
}

.box-code pre {
    margin: 0;
    padding: 0;
    overflow-x: scroll;
    white-space: pre-wrap;
    line-height: 1.0;
}

.box-code br {
    display: none;
}

table {
    border-collapse: collapse;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    width: 100%;
}

tr {
    border: 1px solid #ddd;
}

td {
    padding: 5px;
    border: 1px solid #ddd;
    text-align: left;
}

th {
    background-color: deepskyblue;
    color: white;
    padding: 5px;
    text-align: left;
    border: 1px solid #ddd;
}

.figcontainer {
    display: block;
    justify-content: center;
    text-align: center;
}

.figure {
    background: #edf5f4;
    border: 1px solid #bddbd7;
    padding: 10px;
    border-radius: 10px;
    display: inline-block;
    padding: 10px;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

figcaption {
    text-align: center;
    font-style: italic;
    font-weight: bold;
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

.toc {
    margin: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.title {
    background-color: deepskyblue;
    margin: 0;
    padding: 10px;
    text-align: center;
    color: white;
    font-size: 18px;
    border-radius: 5px;
    border-radius: 10px 10px 0 0;
}

.description {
    font-size: 14px;
    background: linear-gradient(to bottom, black, lightgray);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 10px;
    max-height: 150px;
    overflow: hidden;
    margin-bottom: 25px;
}

.sidebar-icon {
    display: none !important;
    position: fixed;
    top: 60px;
    left: 0;
    background-color: deepskyblue;
    color: white;
    padding: 10px;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    z-index: 1;
}

.topnav {
    position: fixed;
    top: 0;
    left: 0;
    height: 60px;
    z-index: 1000;
    width: 100%;
    overflow-x: hidden;
    background-color: white;
    border-bottom: 1px solid deepskyblue;
}

.topnav a {
    float: left;
    color: black;
    text-align: center;
    margin: 10px 12px;
    padding: 10px;
    text-decoration: none;
    display: inline-block;
    border-radius: 30px;
}

.topnav a:hover {
    background-color: deepskyblue;
    color: white;
}

.topnav a.right {
    float: right;
}

.topnav .topnav-icon {
    display: none;
}

@media screen and (max-width: 600px) {
    .topnav {
        height: auto;
        width: 100%;
    }
    .topnav a:not(:first-child) {
        display: none;
    }
    .topnav a.topnav-icon {
        float: right;
        display: block;
    }
}

@media screen and (max-width: 600px) {
    .topnav.responsive {
        position: relative;
    }
    .topnav.responsive a.topnav-icon {
        position: absolute;
        right: 0;
        top: 0;
    }
    .topnav.responsive a {
      float: none;
      display: block;
       text-align: left;
    }
}

a.button {
    background-color: deepskyblue;
    color: white;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 7px;
    padding-bottom: 7px;
    text-decoration: bold;
    margin: 10px;
    border-radius: 5px;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    font-weight: bold;
    min-width: 50px;
}

button {
    border: 0;
    background: none;
    box-shadow: none;
    background-color: deepskyblue;
    color: white;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 7px;
    padding-bottom: 7px;
    text-decoration: bold;
    margin: 10px;
    border-radius: 5px;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    font-weight: bold;
    min-width: 50px;
    font-size: 18px;
}

.list {
    border: thin solid #ccc;
    border-width: 1px 0;
    margin-bottom: -1px;
    padding-left: 25px;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-right: 25px;
    color: black;
    text-decoration: none;
    display: block;
    clear: both;
}

.date {
    font-size: 12px;
}

.user {
    font-size: 14px;
    color: steelblue;
}

.main {
    position: relative;
    background-color: #fff;
    margin-right: auto;
    margin-left: auto;
    margin-bottom: 20px;
    margin-top: 60px;
    max-width: 1600px;
    min-height: 100vh;
    /*border: 5px solid yellow;*/
    /*border-right: 1px solid #ddd;
    border-left: 1px solid #ddd;*/
    padding-left: 350px;
    padding-right: 350px;
    line-height: 1.6;
    box-sizing: border-box;
}

.bottom {
    position: absolute;
    bottom: 0;
}

/* Form styling */
input[type=text], input[type=password], input[type=email] {
    width: calc(100% - 20px);
    padding: 10px;
    margin: 10px 0;
    margin-left: 10px%;
    margin-right: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    clear: both
}

input[type=button], input[type=submit], input[type=reset] {
    background-color: deepskyblue;
    border: none;
    color: white;
    width: 100%;
    padding: 16px 32px;
    text-decoration: none;
    margin: 4px 2px;
    cursor: pointer;
}

textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: none;
    height: 150px;
    font-size: 14px;
}

textarea#content {
    height: 600px;
}

.frame {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
    background-color: #f9f9f9;
}

.error {
    color: red;
    font-size: 14px;
    margin-top: 10px;
}


/* Sidebar styling */
.sidebar {
    background-color: white;
    border-right: 1px solid #ddd;
    position: fixed;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 10px;
    /*font-size: 14px;*/
    top: 60px; /* Adjust for topnav height */
    left: 0px;
    width: 300px;
    transition: transform 0.3s ease;
    height: calc(100vh - 60px); /* Adjust for topnav height */
    overflow-y: auto;
    transition: transform 0.3s ease;
    scrollbar-color: #ddd #f9f9f9;
    scrollbar-width: thin;
    z-index: 1000;
}

.sidebar ul {
    list-style-type: none;
    margin: 0;
    padding-left: 10px;
}

.sidebar li a {
    color: #444;
    text-decoration: none;
    display: block;
    padding: 10px;
    border-left: 1px solid #ddd;
    /*border-bottom: 1px solid #ddd;*/
}

.sidebar li a:hover {
    color: black;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.sidebar a.active {
    color: steelblue;
    font-weight: bold;
    border-left: 1px solid steelblue;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.sidebar.drag-over {
    border: 2px dashed #888;
    background-color: #f0f0f0;
}

.sidebar-right {
    background-color: white;
    border-left: 1px solid #ddd;
    position: fixed;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 10px;
    top: 60px; /* Adjust for topnav height */
    right: 0px;
    width: 300px;
    transition: transform 0.3s ease;
    overflow-y: auto;
    transition: transform 0.3s ease;
    scrollbar-color: #ddd #f9f9f9;
    scrollbar-width: thin;
}

.sidebar-right ul {
    list-style-type: none;
    margin-left: 1em;
    padding-left: 1em;
}

.sidebar-right li {
    margin: 0.25em 0;
    padding: 0.25em;
}

/* When the sidebar is not open (on small screens), translate it off the screen */
@media screen and (max-width: 1200px) {
    .sidebar-icon {
        display: block !important;
    }
    
    .sidebar-right {
        top: 0px;
        padding: 5px;
        position: relative;
        display: block;
        width: auto;
        margin: 10px;
    }
    
    .sidebar {
        width: 0px;
        padding: 0px;
    }

    .main {
        padding-left: 10px;
        padding-right: 10px;
        max-width: 1000px;
    }
}

/* Optional: If you want to ensure the sidebar is always visible on large screens (>=800px) */
@media screen and (min-width: 1200px) {
  .sidebar {
      width: 300px !important; /* Always visible */
  }
}

#toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-items: center;
    background: #f9f9f9;
    padding: 8px;
    border-radius: 5px;
}

#toolbar button,
#toolbar select {
    padding: 6px;
    font-size: 14px;
    border: 0;
    background: none;
    box-shadow: none;
    border-radius: 0px;
}

#toolbar button:hover,
#toolbar select:hover {
    background: #ddd;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s ease;
    
}

#editor {
    border: 1px solid #ccc;
    padding: 10px;
    margin-top: 10px;
    border-radius: 5px;
    background: white;
    overflow-x: auto;
    max-height: 500px;
}

#editor.fullscreen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    margin: 0;
    z-index: 9999;
    height: 100vh;
    width: 100vw;
    padding: 20px;
    background: white;
}

.code {
    background: #f4f4f4;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: monospace;
    font-size: 14px;
    margin: 10px 0;
}

.popup {
    display: none;
    position: fixed;
    background: #fff;
    border: 1px solid #ccc;
    padding: 10px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    max-width: 90%;
}

.submit {
    background-color: deepskyblue;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    margin-top: 10px;
}

.image-list {
    float: left;
    box-sizing: border-box;
    justify-content: center;
    border: 1px solid #ddd;
    padding: 10px;
    background-color: #f9f9f9;
    width: 100%;
}

.image-list.drag-over {
    border: 2px dashed #888;
    background-color: #f0f0f0;
}

.gallery {
    float: left;
    justify-content: center;
    margin: 5px;
    border-radius: 5px;
    padding: 10px;
    border: 1px solid #ccc;
    width: 150px;
}

.gallery:hover {
    border: 1px solid #777;
}

.gallery img {
    width: 100%;
    height: auto;
}

.desc {
    padding: 15px;
    text-align: center;
}

.content {
    /*border: 5px solid red;*/
    padding-bottom: 10px;
    clear: both;
    line-height: 1.6;
    /*max-width: 800px;
    margin-left: auto;
    margin-right: auto;*/
}

.image-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 6px 10px;
    margin-bottom: 5px;
    border-radius: 5px;
    /*font-size: 14px;*/
}

.image-item a {
    flex-grow: 1;
    text-decoration: none;
    color: #333;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin-right: 10px;
}

.image-item button {
    all: unset;
    padding: 2px 4px;
    font-size: 16px;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    margin-left: 5px;
}

.image-item button:hover {
    background-color: #f0f0f0;
    border-radius: 4px;
}

.toggle {
    margin:0 0 0 2rem;
    position: relative;
    display: inline-block;
    width: 4rem;
    height: 2.0rem;
}

.toggle input {
    display: none;
}

.roundbutton {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    background-color: #33455e;
    display: block;
    transition: all 0.3s;
    border-radius: 1.0rem;
    cursor: pointer;
}

.roundbutton:before {
    position: absolute;
    content: "";
    height: 1.0rem;
    width: 1.1rem;
    border-radius: 100%;
    display: block;
    left: 0.5rem;
    bottom: 0.5rem;
    background-color: white;
    transition: all 0.3s;
}

input:checked + .roundbutton {
    background-color: #FF6E48;
}

input:checked + .roundbutton:before  {
    transform: translate(2.0rem, 0);
}
