html, body {
  height: 100%;
}

:root {
  --widget-panel-bg: rgba(55, 39, 58, 0.913);
  --brand-purple: #b62eff;
}

body {
  background-image: url("../img/backgroundresized.jpg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  font-family: "Nunito Sans", "Concert One", Arial, sans-serif;
}

/* Utility classes (matches Google Fonts examples) */
.concert-one-regular {
  font-family: "Concert One", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.nunito-sans {
  font-family: "Nunito Sans", Arial;
  font-weight: 400;
  font-style: normal;
  font-variation-settings: "wdth" 100, "YTLC" 500;
}

/* Use display font sparingly for personality */
h1, h2, h3, h4, h5, h6,
.navbar-brand {
  font-family: "Concert One", sans-serif;
}

.site-main {
  flex: 1;
}

/* Light surface panel so text stays readable on colored backgrounds */
.page-surface {
  background: rgba(181, 227, 184, 0.726);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
}

/* Navbar */
.current-status-badge {
  background: var(--brand-purple) !important;
  color: #ffffff !important;
}

.btn-brand-purple {
  background: var(--brand-purple);
  border-color: #a21cf0;
  color: #ffffff;
}

.btn-brand-purple:hover,
.btn-brand-purple:focus {
  background: #d05bff;
  border-color: #c84df7;
  color: #ffffff;
}

.btn-brand-purple:active {
  background: #a61fe6;
  border-color: #9216cc;
}

/* Auth pages (login/register): keep forms from stretching too wide */
.auth-form {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* Navbar: keep inline logout form compact */
.navbar .nav-item form.d-inline-flex {
  width: auto;
}

/* Subtle modern card polish */
.card {
  border-radius: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background-color: rgb(50, 50, 50);
  font-size: 1.35rem;
  color: var(--brand-purple);
}

/* Blog index: card title link should not be Bootstrap blue */
.posts-centered .card-title a {
  color: var(--brand-purple) !important;
}

.posts-centered .card-title a:hover,
.posts-centered .card-title a:focus {
  color: #d05bff !important;
  text-decoration: underline;
}

/* Blog index: increase excerpt text size */
.posts-centered .card-text {
  font-size: 1.5rem;
  line-height: 1.65;
}

/* Post detail: override Bootstrap muted timestamp */
.post-timestamp {
  color: var(--brand-purple) !important;
  opacity: 0.9;
}

/* Post detail: increase body text size */
.post-content {
  font-size: 1.6rem;
  line-height: 1.7;
}

/* Mood badges */
.mood-badge {
  border: 1px solid rgba(255, 255, 255, 0.15);
  letter-spacing: 0.01em;
}

.mood-happy {
  background-color: #16a34a;
  color: #ffffff;
}

.mood-curious {
  background-color: #f59e0b;
  color: #111827;
  border-color: rgba(0, 0, 0, 0.15);
}

.mood-angry {
  background-color: #dc2626;
  color: #ffffff;
}

.mood-sleepy {
  background-color: #4f46e5;
  color: #ffffff;
}

.mood-chaotic {
  background-color: #d946ef;
  color: #ffffff;
}

/* Fallback if a mood doesn't match one of the above */
.mood-badge:not(.mood-happy):not(.mood-curious):not(.mood-angry):not(.mood-sleepy):not(.mood-chaotic) {
  background-color: #6b7280;
  color: #ffffff;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Comments: make a readable, contrasted block */
.comment-card {
  background: rgba(207, 213, 207, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

/* Profile: improve contrast for joined date/location */
.profile-meta {
  color: rgba(255, 255, 255, 0.92) !important;
}

.comment-meta {
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.55);
}

/* Prevent stretched avatars */
.avatar-img {
  object-fit: cover;
}

/* Mood tracker: compact sidebar widget */
.posts-centered {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.mood-tracker-card {
  background: var(--widget-panel-bg);
}

.mood-tracker-card .h6 {
  font-size: 1.25rem;
  color: white;
  line-height: 1.2;
}

.mood-tracker-note {
  color: rgba(255, 255, 255, 0.8) !important;
  opacity: 0.9;
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.widget-toggle {
  line-height: 1;
  padding: 0.25rem 0.5rem;
}

/* Collapsed widget state */
.mood-tracker-card.is-collapsed .mood-tracker-body {
  display: none;
}

.chat-sidebar.is-collapsed {
  height: 56px;
}

@media (max-width: 991.98px) {
  .chat-sidebar.is-collapsed {
    height: auto;
  }
}

.chat-sidebar.is-collapsed .chat-body {
  display: none;
}

.mood-chart-wrap {
  height: 180px;
}

/* Home layout: keep posts centered; optionally dock mood tracker on far-left */
.home-layout {
  display: block;
}

.mood-tracker-dock {
  margin-bottom: 1rem;
}

/*
  Dock only on very wide screens so it can't overlap the centered feed.
  Feed is 820px max-width; dock is ~280px + margins.
*/
@media (min-width: 1450px) {
  .mood-tracker-dock {
    position: fixed;
    left: 1rem;
    top: 6rem;
    width: 280px;
    z-index: 10;
    margin-bottom: 0;
  }
}

/* Live chat widget */
.chat-sidebar {
  position: fixed;
  right: 20px;
  bottom: 110px;
  width: 320px;
  height: 420px;
  background: var(--widget-panel-bg);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
  padding: 12px;
  overflow: hidden;
  z-index: 20;
}

/* Make Bootstrap muted text readable inside the dark chat widget */
.chat-sidebar .text-muted {
  color: rgba(255, 255, 255, 0.75) !important;
}

.chat-sidebar a {
  color: #ffffff;
}

.chat-sidebar a:hover,
.chat-sidebar a:focus {
  color: #ffffff;
}

.chat-messages {
  height: 310px;
  overflow-y: auto;
  font-size: 14px;
  padding-right: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px;
}

.chat-messages p {
  color: #ffffff;
}

.chat-messages strong {
  color: var(--brand-purple);
}

/* Theme the input and buttons for dark backgrounds */
.chat-sidebar .form-control {
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.20);
}

.chat-sidebar .form-control::placeholder {
  color: rgba(255, 255, 255, 0.70);
}

.chat-sidebar .btn-primary {
  background-color: var(--brand-purple);
  border-color: #a21cf0;
}

.chat-sidebar .btn-primary:hover,
.chat-sidebar .btn-primary:focus {
  background-color: #d05bff;
  border-color: #c84df7;
}

.chat-sidebar .btn-outline-secondary {
  color: rgba(255, 255, 255, 0.90);
  border-color: rgba(255, 255, 255, 0.35);
}

.chat-sidebar .btn-outline-secondary:hover,
.chat-sidebar .btn-outline-secondary:focus {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.50);
}

/* On smaller screens, keep chat in normal flow so it never overlays posts */
@media (max-width: 991.98px) {
  .chat-sidebar {
    position: static;
    width: 100%;
    height: auto;
    margin-top: 1rem;
    right: auto;
    left: auto;
    bottom: auto;
  }

  .chat-messages {
    height: 220px;
  }
}

/* Mirror the left-docked mood tracker on very wide screens */
@media (min-width: 1450px) {
  .chat-sidebar {
    top: 6rem;
    bottom: auto;
    right: 1rem;
    width: 280px;
    height: 400px;
  }

  .chat-messages {
    height: 290px;
  }
}

footer.footer {
  border-top: 3px solid #ffc107;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.footer-social a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.footer-social a:hover {
  color: #ffffff;
  background: rgba(255, 193, 7, 0.25);
  transform: translateY(-1px);
}

.footer-social .social-icon {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}
