/* base.css */
.theme-toggle-button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: inherit;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
}

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
  min-height: auto;
}

header {
  width: 100%;
  background-color: var(--header-color);
  padding: 1rem 2rem;
  border-bottom: var(----header-border-bottom)
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

  .header-cookies {
    display: flex;
  }

.logo-img {
  width: 40px;
  height: 40px;
  margin-left: 5px;
}

.logo-text {
  font-family: 'Old Standard TT', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--logo-text-color);
  text-shadow: var(--logo-text-shadow);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 1rem;gap:
  0.5rem;
  margin-right: 5px;
}

.header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.description {
  color: var(--description-color);
  font-size: 0.9rem;
  flex-grow: 1;
  text-align: right;
  /*margin-right: 0.5rem;*/
}

.lang-switcher {
}

.lang-switcher select {
  background-color: var(--lang-btn-bg-color);
  color: var(--lang-btn-text-color);
  border: 1px solid #444;
  border-radius: 5px;
  padding: 0.3rem 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.lang-switcher select:focus {
  outline: none;
  border-color: #ff3b3b;
  box-shadow: 0 0 5px rgba(255, 59, 59, 0.6);
}

/* Button style*/
.create-button {
    background: #b31217;
    font-size: 1rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    font-family: 'Arial Black', sans-serif;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(179, 18, 23, 0.6);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    margin-top: 15px;

    color: white;
    text-shadow:
      0 0 5px rgba(128, 128, 128, 0.4),
      0 0 10px rgba(128, 128, 128, 0.5),
      0 0 15px rgba(128, 128, 128, 0.6);
}

.create-button:hover {
  background: #e74c3c;
  box-shadow: 0 0 15px rgba(231, 76, 60, 0.8);
}

/* Modal hidden by default*/
.modal,
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.modal-backdrop {
  background: rgba(0, 0, 0, 0.6);
  z-index: 10;
}

.modal {
  position: fixed;          /* fix modal position */
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;

  justify-content: center;
  align-items: center;
  z-index: 20;
}

/* Show modal when checkbox is checked*/
#modal-toggle:checked ~ .modal,
#modal-toggle:checked ~ .modal-backdrop {
  display: flex;
}

.modal-content {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #ff3b3b;
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 500px;
  width: 80%;
  backdrop-filter: blur(10px);
  color: white;
  box-sizing: border-box;
}

.modal-content-label {
    color: var(--modal-content-label);
    cursor: help;
}

.modal-content textarea {
  width: 95%;
  height: 100px;
  background: rgba(255, 255, 255, 0.05);
  border: var(--modal-textarea-border);
  color: var(--modal-input-clr);
  padding: 0.5rem;
  margin-top: 1rem;
  border-radius: 8px;
  resize: none;
}

textarea:focus-visible {
    outline: none; !important
    border: var(--modal-input-focus-border);
    box-shadow: var(--modal-input-focus-box-shadow);
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}

.close-button,
.submit-button {
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: none;
  align-content: center;
}

.close-button {
  background: var(--modal-close-btn-bg);
  color: var(--modal-close-btn-clr);
  border: var(--modal-close-btn-border);
}

.submit-button {
  background: #b31217;
  color: white;
}

/* posts Styles */
.posts {
  min-width: 50%;
  max-width: 50%;
}

.post {
  min-height: 100px;
  margin-top: 20px;
  background: var(--posts-background);
  backdrop-filter: blur(8px);
  border-radius: 15px;
  border: var(--posts-border);
  box-shadow: var(--posts-box-shadow);
  color: var(--posts-color);
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.posts-content {
  max-width: 100%;
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.posts-user {
  font-weight: bold;
  color: var(--posts-usr-color);
  margin-bottom: 0.5rem;
}

.posts-actions {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin-top: 15px;
}

.posts-actions button,
.comment-actions button {
  background-color: transparent;
  color: #eee;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  margin-right: 0.5rem;
  cursor: pointer;
  margin-left: 10px;
}

.comment-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.5rem;
  backdrop-filter: blur(8px);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.05);
}

.comment-input {
  flex: 1;
  min-width: 0px;
  width: 100%;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 1rem;
  font-size: 1rem;
  background-color: var(--comment-input-box-shadow);
  color: var(--text-color);
  outline: none;
  box-shadow: var(--comment-input-box-shadow);
}

.comment-input::placeholder {
  color: var(--text-muted);
}

.posts-comments {
  margin-top: 1rem;
  padding-left: 1rem;
  color: var(--posts-cmnts-color);
  border-top: var(--posts-cmnts-border-top);
}


.posts-comment {
  border-radius: 12px;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: var(--comment-border-bottom);
  list-style:none;
}

.posts-button {
  font-size: 0.9rem;
  /*padding: 8px 16px;
  border: none;
  border-radius: 8px;

  background: rgba(255, 0, 0, 0.2);
  */
  box-shadow: var(--posts-btn-shadow);
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  flex-shrink: 0;
  padding: 0.5rem;
  border-radius: 1rem;
  border: none;
  color: white;
  cursor: pointer;
}

.posts-button-text {
  color: var(--posts-btn-text);
}

.posts-button:hover {
  background-color: #b31217;
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(255, 59, 59, 0.6);
}

.posts-button:active {
  background-color: #c02828;
  transform: scale(0.98);
}

.row {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100%;
}

.toggle-container {
  flex-direction: column;
      display: flex;
      align-items: center;
      justify-content: space-evenly;
}
.switch {
  position: relative;
  display: inline-block;
  width: 53px;
  height: 25px;
  align-items: center;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: #ff3b3b;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

footer {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  height: 60px;
}

.toast button {
  margin-top: 0.5rem;
  background: var(--posts-background);
  color: var(--posts-color);
  border: none;
  padding-left: 0px;
  padding-right: 0px;
  cursor: pointer;
  border-radius: 0.3rem;
  text-decoration: underline;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast {
  /*bottom: 5%;
  right: 5%; */
  /* transform: translateX(-50%); */
  transform: translate3d(-2rem, -2rem, 1rem);
  background-color: var(--posts-background);
  box-shadow: var(--posts-box-shadow);
  color: var(--posts-color);
  padding: 12px 24px;
  border-radius: 8px;
  opacity: 0.95;
  font-size: 0.95rem;
  /*z-index: 1000;*/
  transition: opacity 0.3s ease-in-out;
}


.toast-container {
  position: fixed;
  bottom: 20%;
  right: 1rem;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 0.75rem; /* Space between toasts */
  z-index: 10000;
}

/* Hide container */
.toast-container.hidden {
  display: none;
}

#toast-toggle-button {
  position: fixed;
  bottom: 10%;
  right: 10%;
  background: var(--posts-background);
  color: var(--posts-color);
  border: none;
  border-radius: 50%;
  padding: 1rem;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--posts-box-shadow);
  z-index: 10001;
}

#toast-count {
  color: var(--posts-color);
  font-weight: bold;
  border-radius: 50%;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
  margin-left: 0.4rem;
}

@media (max-width: 800px) {
  .posts {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    box-sizing: border-box;
  }

  .posts-comment {
    flex-direction: column;
    gap: 0.5rem;
  }

  .posts-user,
  .posts-content,
  .comment-actions {
    width: 100%;
  }
  .header-cookies {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
  }

  .toast {
    background-color: #b31217;
    box-shadow: none;
    color: white;
  }
  #toast-toggle-button {
    background: #b31217;
    box-shadow: 0 0 10px rgba(179, 18, 23, 0.6);
    color: white;
  }
  #toast-count {
    color: white;
  }
  .toast button {
    color: white;
  }
}

/* ===== Error Page Styling ===== */

.error-container {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start; /* was center */
  width: 100%;
  min-height: 40vh;
  margin-top: 4rem; /* give it a little spacing from header */
  margin-bottom: 4rem;
}

.error-box {
  text-align: center;
  background: rgba(255, 0, 0, 0.05);
  border: 1px solid rgba(255, 0, 0, 0.4);
  border-radius: 1rem;
  padding: 1.5rem 4rem;
  box-shadow: 0 0 25px rgba(255, 0, 0, 0.3);
  animation: pulseGlow 2s infinite alternate;
  backdrop-filter: blur(6px);
}

.error-code {
  font-family: 'Old Standard TT', serif;
  font-size: 6rem;
  color: #ff3b3b;
  text-shadow:
    0 0 10px rgba(255, 59, 59, 0.8),
    0 0 30px rgba(255, 59, 59, 0.4);
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
}

.error-message {
  color: var(--text-color);
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 4px rgba(255, 59, 59, 0.2);
}

.error-home {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: 10px;
  background: #b31217;
  color: white;
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 0 15px rgba(179, 18, 23, 0.7);
  transition: all 0.3s ease;
}

.error-home:hover {
  background: #e74c3c;
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(231, 76, 60, 0.8);
}

@keyframes pulseGlow {
  from {
    box-shadow: 0 0 15px rgba(255, 59, 59, 0.3);
  }
  to {
    box-shadow: 0 0 30px rgba(255, 59, 59, 0.7);
  }
}

/* mobile */
@media (max-width: 800px) {
  .error-box {
    padding: 2rem;
    margin: 1rem;
  }
  .error-code {
    font-size: 4rem;
  }
}
