/* === GLOBAL RESET & TYPOGRAPHY === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #1b1b1b;
  color: #e8e8e8;
  line-height: 1.6;
}

a {
  color: #77bbdd;
  text-decoration: none;
}

a:visited {
  color: #b477dd;
}

a:hover {
  text-decoration: underline;
}

/* === FORM ELEMENTS === */
input,
textarea,
button {
  font-family: inherit;
  font-size: 1rem;
  background: #2a2a2a;
  color: #e8e8e8;
  border: 1px solid #444;
  padding: 8px 12px;
  border-radius: 4px;
  width: 100%;
  max-width: 100%;
  transition:
    border-color 0.2s,
    background-color 0.2s;
}

#content-summary {
  display: flow-root;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #77bbdd;
  background: #333;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

button {
  cursor: pointer;
  background: #327cad;
  color: white;
  border: none;
  font-weight: bold;
}

button:hover {
  background: #1c6ea4;
}

/* === LAYOUT: TOPBAR & SIDEBAR === */
#topbar {
  position: fixed;
  top: 0;
  left: 250px;
  right: 0;
  height: 60px;
  background: #252525;
  display: flex;
  justify-content: flex-end;
  border-bottom: 1px solid #333;
  z-index: 100;
}

.searchbar {
  background-color: #5286a0;
  width: 300px;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 10px;
}

.searchbar input {
  height: 2rem;
  background: #fff;
  color: #000;
}

#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 250px;
  height: 100vh;
  background: #252525;
  overflow-y: auto;
  padding-top: 20px;
  border-right: 1px solid #333;
  z-index: 101;
}

#sidebar-logo {
  background-image: url("/images/logo.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 80%;
  height: 120px;
  display: block;
  margin: 0 auto 20px auto;
}

.link-list {
  list-style: none;
}

.link-list li a {
  display: block;
  color: #ddd;
  padding: 12px 20px;
  transition: background 0.15s;
}

.link-list li a:hover {
  background: #323232;
  text-decoration: none;
  border-left: 3px solid #77bbdd;
}

/* === LAYOUT: MAIN CONTENT === */
#content {
  margin-left: 250px;
  margin-top: 60px;
  padding: 30px;
  max-width: 1200px;
}

/* Page Headers (Applies to both <h1> on view page and <input> on form page) */
#content-header {
  margin-bottom: 25px;
}

#content-header h1,
#content-header input#title {
  font-family: "Times New Roman", Times, serif;
  font-size: 2rem;
  font-weight: normal;
  margin-bottom: 10px;
}

#content-header input#title {
  background: transparent;
  border: none;
  border-bottom: 2px solid #444;
  border-radius: 0;
  padding: 5px 0;
}

#content-header input#title:focus {
  border-bottom-color: #77bbdd;
}

#content-header hr {
  border: none;
  height: 1px;
  background: #77bbdd;
}

/* General Paragraphs & Content Spacing */
#content-summary p,
#content-body p {
  margin-bottom: 1em;
}

/* Add Buttons next to section headers in form */
#content-summary h3,
#content-body h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #444;
  padding-bottom: 5px;
  margin-bottom: 15px;
  color: #77bbdd;
}

#content-summary button,
#content-body button {
  width: auto;
  padding: 5px 10px;
  font-size: 0.85rem;
}

/* === WIKI VIEW SPECIFICS: TOC & SECTION LISTS === */

/* Table of Contents */
#toc {
  width: 100%;
  max-width: 300px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 25px;
}

#toc b {
  display: block;
  margin-bottom: 10px;
  font-size: 1.1rem;
  color: #77bbdd;
}

#toc ol {
  list-style: decimal inside;
}

#toc ol li {
  margin-bottom: 5px;
}

/* Section Contents */
#content-body {
  padding-top: 10px;
  clear: right;
}

#content-list {
  list-style: none;
}

#content-list > li {
  font-size: 1.5rem;
  font-family: "Times New Roman", Times, serif;
  color: #77bbdd;
  font-weight: bold;
  margin-top: 30px;
  margin-bottom: 5px;
  clear: right;
}

#content-list hr {
  border: none;
  height: 1px;
  background: #444;
  margin-bottom: 15px;
}

#content-list p {
  font-family: Arial, Helvetica, sans-serif;
  color: #e8e8e8;
  font-size: 1rem;
  font-weight: normal;
}

#content-list img {
  float: right;
  clear: right;
  max-width: 250px;
  height: auto;
  margin: 0 0 15px 15px;
  border-radius: 4px;
}

/* === TABLE / INFOBOX === */
#infobox {
  float: right;
  width: 100%;
  max-width: 350px;
  margin: 0 0 20px 30px;
  background: #252525;
  padding: 15px;
  border: 1px solid #1c6ea4;
  border-radius: 6px;
  text-align: center;
  border-collapse: collapse;
}

#infobox img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 5px;
}

#infobox td,
#infobox th {
  border: 1px solid #444;
  padding: 8px;
}

#infobox tbody td {
  font-size: 0.9rem;
}

#infobox tr:nth-child(even) {
  background: #1f1f1f;
}

#infobox thead {
  background: linear-gradient(to bottom, #327cad 0%, #1c6ea4 100%);
}

#infobox thead th {
  font-size: 1rem;
  font-weight: bold;
  color: #ffffff;
  padding: 10px;
}

/* === FOOTER === */
#footer {
  margin-left: 250px;
  text-align: center;
  padding: 30px;
  color: #898989;
  border-top: 1px solid #333;
}

/* === MOBILE & TABLET RESPONSIVENESS === */
@media (max-width: 900px) {
  #sidebar {
    position: relative;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
  }

  #topbar {
    position: relative;
    left: 0;
    width: 100%;
    justify-content: center;
  }

  #content,
  #footer {
    margin-left: 0;
    margin-top: 0;
    padding: 20px;
  }

  #infobox {
    float: none;
    max-width: 100%;
    margin: 20px 0;
  }

  #toc {
    max-width: 100%;
  }

  #content-list img {
    float: none;
    max-width: 100%;
    margin: 10px 0;
    display: block;
  }

  #content-summary h3,
  #content-body h3 {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
