:root {
  /* Theme tokens (dark = default) */
  --bg: #051923;
  --surface: #003554;
  --text: #ffffff;
  --accent: #ee6c4d;
  --accent-strong: #e15f41;
  --accent-stronger: #d75a3e;
  --btn-bg: #003554;
  --btn-bg-hover: #002a43;
  --btn-bg-active: #002439;
  --btn-focus-rgb: 0, 53, 84;
}

:root[data-theme="light"] {
  /* Light mode placeholders */
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #0b1a24;
  --accent: #ee6c4d;
  --accent-strong: #e15f41;
  --accent-stronger: #d75a3e;
  --btn-bg: #003554;
  --btn-bg-hover: #002a43;
  --btn-bg-active: #002439;
  --btn-focus-rgb: 0, 53, 84;
}

body {
  background-color: var(--bg) !important;
  color: var(--text);
}

/* Fix Bootstrap's text-light in light mode */
:root[data-theme="light"] .text-light {
  color: var(--text) !important;
}

/* Message */
.message {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
  cursor: grab;
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: visible;
}

.message-content {
  position: relative;
  padding-right: 44px;
  padding-bottom: 30px;
}

.message-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.message-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.message-edited {
  margin-left: 6px;
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.5);
}

.edit-btn {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: #8d98a1;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.edit-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
}

.edit-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.edit-input {
  flex: 1 1 220px;
  min-width: 180px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #000000;
  border-radius: 8px;
  padding: 4px 10px;
}

.edit-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--btn-focus-rgb), 0.4);
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  font-size: 0.9rem;
  color: var(--accent);
  line-height: 1;
}

.favorite-btn {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: #8d98a1;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.favorite-btn:hover {
  color: #f2c94c;
  border-color: #f2c94c;
  transform: scale(1.05);
}

.favorite-btn.is-favorite {
  color: #f2c94c;
  border-color: #f2c94c;
  background: rgba(242, 201, 76, 0.1);
}

.reaction-bar {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, max-height 0.2s ease;
}

.message:hover .reaction-bar,
.message:focus-within .reaction-bar,
.message.message-has-reactions .reaction-bar {
  opacity: 1;
  max-height: 40px;
}

.message:not(:hover):not(:focus-within) .reaction-btn:not(.has-count) {
  display: none;
}

.reaction-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  padding: 2px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  box-shadow: none !important;
  outline: none !important;
  filter: none !important;
  text-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}

.reaction-btn:hover {
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

.reaction-btn.is-active {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none !important;
}

.reaction-btn:focus,
.reaction-btn:focus-visible,
.reaction-btn:active {
  outline: none;
  box-shadow: none !important;
  filter: none !important;
  text-shadow: none !important;
}

.reaction-btn * {
  box-shadow: none !important;
  filter: none !important;
  text-shadow: none !important;
}

.reply-toggle-btn {
  position: absolute;
  right: 44px;
  bottom: 10px;
  border: none;
  background: transparent;
  color: var(--accent);
  border-radius: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  z-index: 2;
  padding: 0;
}

.reply-toggle-btn:hover {
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.reply-toggle-btn:active {
  color: var(--accent-stronger);
}

.reply-toggle-btn.is-open {
  color: var(--accent-stronger);
}

.reply-toggle-btn:focus,
.reply-toggle-btn:focus-visible,
.reply-toggle-btn:active {
  outline: none;
  box-shadow: none;
}

.reaction-count {
  font-weight: 600;
}

.message.message-favorite {
  border-left: 4px solid #f2c94c !important;
}

.message-time-div{
    background-color: #f6f7fb;
    padding: 10px;
    display: flex;
    position: absolute;
    bottom: -32px;
    left: 10px;
    opacity: 0;
}

.message:hover > .message-content > .message-time-div,
.reply:hover .message-time-div {
    opacity: 1;
    transition: opacity 0.5s ease;
    transition-delay: 0.5s;
}

.message:has(.reply:hover) > .message-content > .message-time-div {
    opacity: 0;
}

.reply{
    width: 95%;
    margin-left: auto;
    font-size: 0.85rem;
    padding: 6px 10px !important;
    background: rgba(0, 0, 0, 0.08) !important;
    box-shadow: none !important;
}


.reply .message-time {
    font-size: 0.75rem;
}


@media (max-width: 576px) {
  .message {
    padding: 10px 12px;
    border-radius: 10px;
  }



}
.message-time {
  display: block;
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.45);
}
/* Hover */
.message:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.15);
}

/* Messages posted by authenticated users */
.message.message-authenticated {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}
.message.message-authenticated:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Own message (logged-in user) */
.message.message-own {
  background: rgba(212, 175, 55, 0.35);
  border-color: rgba(212, 175, 55, 0.6) !important;
}
.message.message-own:hover {
  background: rgba(212, 175, 55, 0.5);
}

/* När man drar */
.message.dragging {
  opacity: 0.5;
  transform: scale(0.95);
  cursor: grabbing;
}


/* Delete zone */
.dropzones {
  margin: 20px auto 0;
  width: 100%;
  max-width: 1320px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

#deleteZone,
#favoriteZone {
  padding: 28px;
  text-align: center;
  border-radius: 16px;
  font-weight: bold;
  transition: all 0.25s ease;
}

#deleteZone {
  border: 2px dashed #d75a3e;
  color: #d75a3e;
}

#favoriteZone {
  border: 2px dashed #f2c94c;
  color: #f2c94c;
}

/* Hover delete */
#deleteZone.hover {
  background: rgba(255, 0, 0, 0.2);
  border-color: red;
  color: white;
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
}

#favoriteZone.hover {
  background: rgba(242, 201, 76, 0.2);
  border-color: #ffd54f;
  color: #ffffff;
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(242, 201, 76, 0.3);
}

@media (max-width: 768px) {
  .dropzones {
    margin-left: 0;
    margin-right: 0;
    grid-template-columns: 1fr;
  }
}

/* ====== Section: Colors ====== */
/* orange */
.burnt-peach-bg {
  background-color: var(--accent);
}
.burnt-peach {
  color: var(--accent);
}
/* Blue */
.deep-space-blue {
  color: var(--surface);
}
.deep-space-blue-bg { 
  background-color: var(--surface);
}
/* Darker blue */
.ink-black {
  color: var(--bg);
}
.ink-black-bg {
  background-color: var(--bg);
}

.white {
  color: var(--text);
}
.white-bg {
  background-color: #ffffff;
}
/* ====== Section: Colors ====== */

.bg-main {
  background-color: var(--surface);
}

.main-chat-icon {
  margin-right: 8px;
  color: var(--accent);
  font-size: 1.2em;
  vertical-align: -0.1em;
}

.theme-toggle-icon {
  color: var(--accent);
  font-size: 1.1rem;
}

.theme-toggle-icon:hover {
  color: var(--accent-strong);
}

.theme-toggle-icon:focus,
.theme-toggle-icon:focus-visible {
  outline: none;
  box-shadow: none;
}

.nav-pills {
  --bs-nav-pills-link-active-bg: var(--accent) !important;
}


/* ====== Burger menu ====== */
.burger-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
}

.burger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

@media (max-width: 767px) {
  #navMenu {
    padding-bottom: 0.5rem;
  }

  #navMenu .nav {
    gap: 0.25rem;
    width: 100%;
  }

  #navMenu .nav-item {
    width: 100%;
  }

  #navMenu .nav-link,
  #navMenu .btn {
    width: 100%;
    text-align: left;
  }
}

@media (min-width: 768px) {
  #navMenu {
    width: auto !important;
    flex: 0 0 auto;
  }
}

.nav-link {
  color: var(--accent) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  min-height: 32px;
  border-radius: 0.375rem;
}

.active  {
  color: var(--surface) !important
}

.footer-social a {
  color: var(--text) !important;
  opacity: 0.7;
  font-size: 1.25rem;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.footer-social a:hover {
  color: var(--accent) !important;
  opacity: 1;
  transform: translateY(-2px);
}

/* ====== Terms and Conditions Modal ====== */
.terms-modal {
  display: flex;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.terms-modal.hidden {
  opacity: 0;
  visibility: hidden;
}

.terms-modal-content {
  background-color: var(--surface);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.terms-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.terms-modal-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.5rem;
}

.terms-close-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.terms-close-btn:hover {
  opacity: 1;
  color: var(--accent);
}

.terms-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  color: var(--text);
}

.terms-modal-body h4 {
  color: var(--accent);
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.terms-modal-body p {
  margin-bottom: 12px;
  line-height: 1.6;
  font-size: 0.95rem;
}

.terms-modal-body ul {
  margin: 12px 0 12px 20px;
  padding-left: 0;
}

.terms-modal-body ul li {
  margin-bottom: 6px;
  line-height: 1.5;
}

.terms-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.terms-checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.terms-checkbox-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}

.terms-checkbox-wrapper label {
  margin-bottom: 0;
  cursor: pointer;
  color: var(--text);
  user-select: none;
}

.terms-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.terms-modal-footer .btn {
  padding: 8px 24px;
  font-weight: 500;
  border-radius: 6px;
  min-width: 100px;
}

.btn-burnt-peach {
  background-color: var(--accent) !important;
  border-color: var(--accent) !important;
  color: white !important;
  transition: all 0.2s ease;
}

.btn-burnt-peach:hover {
  background-color: var(--accent-strong) !important;
  border-color: var(--accent-strong) !important;
}

.btn-burnt-peach:disabled {
  background-color: rgba(238, 108, 77, 0.5) !important;
  border-color: rgba(238, 108, 77, 0.5) !important;
  color: rgba(255, 255, 255, 0.6) !important;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-burnt-peach:disabled:hover {
  background-color: rgba(238, 108, 77, 0.5) !important;
  border-color: rgba(238, 108, 77, 0.5) !important;
}

/* Responsive */
@media (max-width: 576px) {
  .terms-modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .terms-modal-header {
    padding: 16px 16px;
  }

  .terms-modal-header h2 {
    font-size: 1.3rem;
  }

  .terms-modal-body {
    padding: 16px;
  }

  .terms-modal-footer {
    padding: 12px 16px;
    gap: 12px;
  }

  .terms-buttons {
    flex-direction: column;
  }

  .terms-modal-footer .btn,
  .terms-buttons .btn {
    width: 100%;
    min-width: auto;
  }
}


.footer-social .bi {
  display: inline-block;
}

footer .text-muted {
  color: var(--text) !important;
  opacity: 0.7;
}

.btn-burnt-peach {
  --bs-btn-color: #ffffff;
  --bs-btn-bg: var(--btn-bg);
  --bs-btn-border-color: var(--btn-bg);
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: var(--btn-bg-hover);
  --bs-btn-hover-border-color: var(--btn-bg-hover);
  --bs-btn-focus-shadow-rgb: var(--btn-focus-rgb);
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: var(--btn-bg-active);
  --bs-btn-active-border-color: #cc553a;
}

.bitcount-prop-double {
  font-family: "Bitcount Prop Double", system-ui;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-variation-settings:
    "slnt" 0,
    "CRSV" 0.5,
    "ELSH" 0,
    "ELXP" 0;
}

.emoji-post-group {
  gap: 0.7rem;
  align-items: center;
}

#emojis {
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
}

#emojis:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--btn-focus-rgb), 0.4);
}

#emojis {
  min-height: 38px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1rem;
}

#emojis:hover {
  border-color: rgba(255, 255, 255, 0.6);
}

#textColorPicker {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}


.color-picker-group {
  background-color: var(--accent);
  border: 1px solid var(--accent);
  color: white;
}

.color-picker-group .form-label {
  color: white;
  margin-bottom: 0;
}

#textColorPicker {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  padding: 0;
  border: none;
}

.color-swatch-wrapper {
  position: relative;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.color-swatch-preview {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 2px solid white;
  pointer-events: none;
}

#fireworkContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hiddsen;
  z-index: 9999;
}

.firework {
  position: absolute;
  font-size: 2rem;
  animation: explode 1s ease-out forwards;
}

@keyframes explode {
  0% {
    transform: scale(0.5) translateY(0);
    opacity: 1;
  }
  100% {
    transform: scale(1.8) translateY(-80px);
    opacity: 0;
  }
}
