/* Global variables. */
:root {
  /* Fonts */
  --title-font: "Montserrat", sans-serif;
  --heading-font: "Georgia", serif;
  --body-font: "Montserrat", sans-serif;;
  --mono-font: Consolas, Menlo, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
  --standard-border-radius: 5px;

  /* Colours */
  --primary: #1b7679;
  --primary-light: #e5fafa;
  --secondary: #ea8651;
  --tertiary: #fccf61;
  --light: #ffffff;
  --light-2: #f4f4f4;
  --dark-2: #5e5755;
  --dark: #212121;

  /* to replace */
  --bg: #fff;
  --accent-bg: #f5f7ff;
  --text: #212121;
  --text-light: #585858;
  --border: #898EA4;
  --accent: #0d47a1;
  --accent-hover: var(--secondary);
  --accent-text: var(--bg);
  --code: #d81b60;
  --preformatted: #444;
  --marked: #ffdd33;
  --disabled: #efefef;
}



/* Reset */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


/* Layout */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--title-font);
}

#main-container {
  display: flex;
  flex: 1;
}

#sidebar {
  width: 350px;
  padding: 1rem;
}

#main-content {
  flex: 1;
  padding: 1rem 4rem;
}

footer {
  margin-top: auto;
}


/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--primary);
  color: var(--light);
  padding: 1rem 2rem;
}
header .header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--light);
}
header .header-title-group {
  display: block;
}

header .header-title-group h1 {
  display: inline-block;
  font-family: var(--title-font);
  color: var(--light);
  margin: 10px;
}
header .header-title-group span {
  margin: 10px;
}

header .header-title-group .tagline {
  display: block;
  font-family: var(--title-font);
}

/* Sidebar and Nav */

#sidebar {
  border-right: solid 2px var(--light-2);
  background-color: var(--light);
  padding-top: 2rem;
}

.nav li {
  list-style: none;
  padding-bottom: 0;
}
.nav a {
  padding: 20px;
  border-bottom: solid 2px var(--light-2);
  color: var(--dark-2);
  background: var(--light);
  display: block;
  transition: background 0.1s ease-in-out;
  text-decoration: none;
  font-family: var(--title-font);
}

.nav .nav-header {
  padding: 20px 20px 5px 20px;
/*  border-bottom: solid 2px var(--light-2);*/
  color: var(--dark-2);
  background: var(--light);
  display: block;
  text-decoration: none;
  font-family: var(--title-font);
  font-weight: bold;
}

.nav a:hover {
  background: var(--light-2);
}
.nav a:visited {
  color: var(--dark-2);
}

#community_filter_form {
  padding: 5px 20px;
}

#community_filter_form select {
  width: 100%;
}

/* Footer */
footer {
  background: var(--primary);
  color: var(--light);
  text-align: center;
}

/* Basic Text Elements */
/* Format headers */
h1 {
  font-size: 3rem;
  color: var(--dark-2);
  font-family: var(--title-font);
}

h2 {
  font-size: 2.6rem;
  margin-top: 3rem;
  color: var(--primary);
  font-family: var(--heading-font);
}

h3 {
  font-size: 2rem;
  margin-top: 3rem;
  color: var(--primary);
  font-family: var(--heading-font);
}

h4 {
  font-size: 1.44rem;
  color: var(--secondary);
  font-family: var(--title-font);
}

h5 {
  font-size: 1.15rem;
  color: var(--primary);
  font-family: var(--title-font);
}

h6 {
  font-size: 0.96rem;
  color: var(--dark-2);
  font-family: var(--title-font);
}

p {
  margin: 1.5rem 0;
}

/* Prevent long strings from overflowing container */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* Fix line height when title wraps */
h1,
h2,
h3 {
  line-height: 1.1;
}

code {
    background: #eaeaea;
    padding: 8px;
    border-radius: 6px;
    display: inline-block;
}

/* Format links & buttons */
a,
a:visited {
  color: var(--primary);
}

a:hover {
  text-decoration: none;
}

button,
.button,
a.button, /* extra specificity to override a */
input[type="submit"],
input[type="reset"],
input[type="button"] {
  border: 1px solid var(--primary);
  background-color: var(--primary);
  color: var(--light-2);
  padding: 0.5rem 0.9rem;
  text-decoration: none;
  line-height: normal;
  font-family: var(--title-font);
}

button, .button-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  white-space: nowrap;
  flex-wrap: nowrap;
}
.material-symbols-outlined {
    font-size: 20px; /* Adjust icon size */
    margin-right: 6px; /* Space between icon and text */
    display: flex;
    align-items: center;
}

.button-outline {
  border: 1px solid var(--primary);
  background-color: var(--bg);
  color: var(--primary);
  padding: 0.5rem 0.9rem;
  text-decoration: none;
  line-height: normal;
  font-family: var(--title-font);
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: var(--standard-border-radius);
  box-shadow: none;
  max-width: 100%;
}

.button-outline:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}

.button[aria-disabled="true"],
input:disabled,
textarea:disabled,
select:disabled,
button[disabled] {
  cursor: not-allowed;
  background-color: var(--disabled);
  border-color: var(--disabled);
  color: var(--text-light);
}

li {
  padding-bottom: 0.2rem;
}

/* Form Elements */

form ul {
    margin-left: 2rem;
}

input[type="range"] {
  padding: 0;
}

/* Set the cursor to '?' on an abbreviation and style the abbreviation to show that there is more information underneath */
abbr[title] {
  cursor: help;
  text-decoration-line: underline;
  text-decoration-style: dotted;
}

button:enabled:hover,
.button:not([aria-disabled="true"]):hover,
input[type="submit"]:enabled:hover,
input[type="reset"]:enabled:hover,
input[type="button"]:enabled:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  cursor: pointer;
}

.button:focus-visible,
button:focus-visible:where(:enabled),
input:enabled:focus-visible:where(
  [type="submit"],
  [type="reset"],
  [type="button"]
) {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.action-form {
  display: inline-block;
}

/*
 *   Format tables
 */
table {
  border-collapse: collapse;
  margin: 1.5rem 0;
}

figure > table {
  width: max-content;
  margin: 0;
}

td,
th {
  border: 0;
  text-align: start;
  padding: 0.75rem;
}

th {
  background-color: var(--primary);
  color: var(--light);
  font-weight: bold;
}

tr:nth-child(even) {
  /* Set every other cell slightly darker. Improves readability. */
  background-color: var(--primary-light);
}

table caption {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

/*
 * Form Controls
 */
/* Reset default appearance */
textarea,
select,
input,
progress {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

textarea,
select,
input,
button,
.button {
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: var(--standard-border-radius);
  box-shadow: none;
  max-width: 100%;
  display: inline-flex;
}

textarea,
select,
input {
  color: var(--text);
  background-color: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--title-font);
}
label {
  display: block;
  font-family: var(--title-font);
}
textarea:not([cols]) {
  width: 100%;
}

/* Add arrow to drop-down */
select:not([multiple]) {
  background-image: linear-gradient(45deg, transparent 49%, var(--text) 51%),
    linear-gradient(135deg, var(--text) 51%, transparent 49%);
  background-position: calc(100% - 15px), calc(100% - 10px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-end: 25px;
}
*[dir="rtl"] select:not([multiple]) {
  background-position: 10px, 15px;
}

/* checkbox and radio button style */
input[type="checkbox"],
input[type="radio"] {
  vertical-align: middle;
  position: relative;
  width: min-content;
}

input[type="checkbox"] + label,
input[type="radio"] + label {
  display: inline-block;
}

input[type="radio"] {
  border-radius: 100%;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background-color: var(--accent);
}

input[type="checkbox"]:checked::after {
  /* Creates a rectangle with colored right and bottom borders which is rotated to look like a check mark */
  content: " ";
  width: 0.18em;
  height: 0.32em;
  border-radius: 0;
  position: absolute;
  top: 0.05em;
  left: 0.17em;
  background-color: transparent;
  border-right: solid var(--bg) 0.08em;
  border-bottom: solid var(--bg) 0.08em;
  font-size: 1.8em;
  transform: rotate(45deg);
}
input[type="radio"]:checked::after {
  /* creates a colored circle for the checked radio button  */
  content: " ";
  width: 0.25em;
  height: 0.25em;
  border-radius: 100%;
  position: absolute;
  top: 0.125em;
  background-color: var(--bg);
  left: 0.125em;
  font-size: 32px;
}

/* Makes input fields wider on smaller screens */
@media only screen and (max-width: 720px) {
  textarea,
  select,
  input {
    width: 100%;
  }
}

/* Set a height for color input */
input[type="color"] {
  height: 2.5rem;
  padding:  0.2rem;
}

/* do not show border around file selector button */
input[type="file"] {
  border: 0;
}

/* Form Layout */
form p label {
  font-weight: bold;
  display: inline-block;
}
form p input {
  margin: auto 1rem;
}
form p span.form-helptext {
  color: var(--dark-2);
  font-style: italic;
  font-size: 80%;
}

/* Login */
.login-box {
  width: 500px;
  padding: 30px;
  background: white;
  border-radius: var(--standard-border-radius);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Soft shadow */

  /* Centering the box */
  margin: 80px auto;
}
.login-box h2 {
    margin: 0 0 20px 0;
}
.login-box input {
    width: 100%;
}

/* Main Page */
.pagetitle {
  border-bottom: solid 2px var(--light-2);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.pagetitle h1 {
  margin: 0.5rem 0;
  color: var(--secondary);
}

.pagetitle .page-helptext {
  font-style: italic;
  color: var(--dark-2);
}

/* Automated DMs - Message Log */
.event-table {
  width: 100%;
}

.event-table .event-table--not-found {
  text-align: center;
  font-weight: bold;
}

/* Automated DMs - Template Cards */
#card-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: auto;
  grid-gap: 1rem;
  margin-top: 1rem;
}

.template-card {
  border: 1px solid var(--border);
  border-radius: var(--standard-border-radius);
  padding: 1rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Soft shadow */
  display: flex;
  flex-direction: column;
}

.template-card h1 {
  font-size: 18px;
}

.template-card .template-card-content {
  flex-grow: 1;
}

.template-card .template-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.template-card .template-card-actions .button-outline, .template-card .template-card-actions .icon-btn {
  margin-bottom: 0;
}

/* Paragraph Forms */
p.form-element {
  max-width: 900px;
}
p.form-element label {
  display: block;
  margin: 0.5rem 0;
}
p.form-element input, p.form-element textarea {
  margin: 0 0 0.5rem 0;
  width: 100%;
  max-width: 600px;
}
