/* global styles */
* {
  box-sizing: border-box;
}

body {
  font-family: Inter, sans-serif;
  background-color: #f0f0f0;
  font-size: 15px;
  color: black;
  max-width: 800px;
  margin: 0;
  padding: 20px;
  line-height: 1;
}

body.think-body {
  max-width: none;
  color: black;
}

body.think-body p,
body.think-body span,
body.think-body label {
  color: black;
}

p {
  margin: 0;
  padding-left: 10px;
  margin-bottom: 10px;
}

.name {
  padding-top: 10px;
}

a {
  color: inherit;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 10px;
  padding-left: 10px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

a:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

.home-body-content {
  background-color: rgba(128, 128, 128, 0.5);
  min-width: 250px;
}

#password-input {
  width: 150px;
  margin-bottom: 10px;
  margin-left: 10px;
}

#password-button {
  margin-left: 5px;
  margin-right: 10px;
  width: 60px;
  height: 30px;
  background-color: transparent;
  color: inherit;
  border: transparent;
}

.home-video-background-mobile {
  display: none;
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: -50px;
  z-index: -1;
}

.home-video-background {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.home-video-background video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.think-button {
  display: block;
  position: fixed;
  bottom: 10px;
  right: 20px;
}

.toggle-rocket-button {
  display: block;
  position: fixed;
  top: 35px;
  right: 20px;
  font-size: 15px;
}

.toggle-rocket-button-mobile {
  display: none;
  position: fixed;
  top: 10px;
  right: 10px;
  font-size: 15px;
  padding-top: 10px;
  flex-direction: column;
  gap: 5px;
}

.toggle-rocket-button-mobile a {
  margin-bottom: 0;
}

.think-button-mobile {
  display: none;
  position: fixed;
  bottom: 10px;
  right: 10px;
  padding-top: 10px;
  flex-direction: column;
  gap: 5px;
}

.think-button-mobile a {
  margin-bottom: 0;
}

/* homepage styles */
#bio {
  margin-bottom: 10px;
}

#thoughts {
  margin-top: 10px;
}

.bio-addon {
  padding-left: 10px;
  padding-right: 10px;
  font-size: 14px;
  width: 100%;
  line-height: 1.3;
}

.section-title {
  margin-bottom: 10px;
}

.thought {
  margin-top: 30px;
  margin-bottom: 30px;
  width: 100%;
  max-width: 600px;
}

.thought .title {
  font-weight: 500;
  color: #333;
  margin-bottom: 5px;
  padding: 10px;
}

.thought .date {
  font-size: 13px;
  color: #888;
  margin-bottom: 5px;
  padding-left: 10px;
}

.thought .content {
  font-size: 15px;
  color: #333;
  padding-left: 10px;
  padding-bottom: 10px;
  padding-right: 10px;
  line-height: 1.4;
}

.thought .content div {
  margin-bottom: 0.3em;
}

.thought .content a {
  margin-bottom: 0;
}

/* think page styles */

#input-section {
  flex: 1;
  padding-right: 10px;
  margin-bottom: 20px;
}

body.think-body.centered-input-active {
  justify-content: center;
}

body.think-body.centered-input-active #input-section {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}

#preview-section {
  flex: 1;
  border-left: 1px solid #ccc;
  padding-left: 20px;
}

#thought-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

input[type="text"],
input[type="date"],
#content {
  padding: 10px;
  border: 1.5px solid #ccc;
  background-color: inherit;
  font-family: inherit;
  width: 100%;
  max-width: 600px;
}

#content {
  min-height: 500px;
  overflow-y: auto;
}

label {
  display: block;
  padding-bottom: 10px;
}

button {
  padding: 10px;
  border: 1px solid #ccc;
  width: 100px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

button:hover {
  background-color: #eaeaea;
  transform: translateY(-1px);
}

#code-preview {
  white-space: pre-wrap;
  background-color: #f4f4f4;
  padding: 10px;
  border: 1px solid #ddd;
  font-family: monospace;
}

#preview-section {
  transition: transform 0.3s ease-out;
}

#preview-section.collapsed {
  transform: translateX(100%);
}

#toggle-preview {
  position: absolute;
  top: 10px;
  right: 10px;
}

/* responsiveness */

/* only for temporary, while i figure out how to make the video toggleable */
@media (min-width: 1px) {
  body,
  .thought .content,
  .thought .title,
  .thought .date,
  label {
    color: white;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 15px;
    padding: 20px;
  }
  .think-body {
    flex-direction: column;
  }
  #input-section,
  #preview-section {
    width: 100%;
    padding-right: 0;
  }
  #preview-section {
    border-left: none;
    padding-left: 0;
  }
  input[type="text"],
  input[type="date"],
  #content {
    width: 100%;
    max-width: none;
  }
  #toggle-preview {
    display: none;
  }
}

@media (min-width: 769px) {
  .think-body {
    flex-direction: row;
  }
  #input-section,
  #preview-section {
    width: 48%;
  }
}

/* mobile styles */
@media (max-width: 540px) {
  .home-video-background-mobile {
    display: block;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    z-index: -1;
  }
  #password-input {
    margin-left: 0px;
  }
  .think-button {
    display: none;
  }
  .think-button-mobile {
    display: flex;
  }
  .toggle-rocket-button-mobile {
    display: flex;
  }
  .toggle-rocket-button {
    display: none;
  }
  .home-video-container {
    display: none;
  }
  .home-video-background {
    display: none;
  }
  .name {
    padding-top: 0px;
  }
  .bio-addon {
    padding-left: 0px;
    padding-right: 0px;
  }
  p {
    padding-left: 0px;
  }
  a {
    padding-left: 0px;
  }
  .home-body-content {
    background-color: transparent;
  }
  .thought .title {
    padding-left: 0px;
  }
  .thought .date {
    padding-left: 0px;
  }
  .thought .content {
    padding-left: 0px;
  }

  body,
  .thought .content,
  .thought .title,
  .thought .date,
  label {
    color: white;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #333333;
    color: white;
  }

  body.think-body {
    color: white;
  }

  body.think-body p,
  body.think-body span,
  body.think-body label,
  .thought .title,
  .thought .date,
  .thought .content,
  label {
    color: white;
  }

  #input-section {
    color: white;
  }

  input[type="text"],
  input[type="date"],
  #content {
    border: 1.5px solid #666;
    background-color: #333;
    color: white;
  }

  button {
    border: 1px solid #666;
    background-color: #625252;
    color: white;
  }

  button:hover {
    background-color: #745d5d;
  }

  label {
    color: white;
  }

  #code-preview {
    background-color: #2a2a2a;
    border-color: #555;
    color: white;
  }

  #preview-section {
    border-left-color: #555;
  }
}

.text-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.text-link:hover {
  opacity: 0.8;
}
