:root {
  --primary-green: #228B22;
  --secondary-green: #4caf50;
  --light-green: #b6e2a1;
  --gold: #ffd700;
  --gold-dark: #c9a700;
  --blue: #4fc3f7;
  --orange: #ff9800;
  --card-bg: rgba(255,255,255,0.97);
  --shadow: 0 8px 32px rgba(45,90,39,0.10), 0 1.5px 8px #ffd70022;
  --shadow-hover: 0 16px 40px #228b2240, 0 2px 12px #ffd70022;
  --gradient-green: linear-gradient(135deg, #228B22 0%, #4caf50 100%);
  --gradient-gold: linear-gradient(90deg, #ffd700 0%, #fffbe7 100%);
  --gradient-card: linear-gradient(120deg, #f9fbe7 80%, #e8f5e9 100%);
  --gradient-blue: linear-gradient(90deg, #4fc3f7 0%, #b6e2fa 100%);
  --gradient-orange: linear-gradient(90deg, #ff9800 0%, #ffd180 100%);
  --glass: rgba(255,255,255,0.5);
}
body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: linear-gradient(135deg, #222e23 0%, #228B22 100%);
  margin: 0;
  direction: rtl;
}
.main-header {
  background: var(--gradient-green);
  color: #fff;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow);
  min-height: 64px;
  gap: 1rem;
  flex-wrap: nowrap;
}
.header-left, .header-center, .header-right { display: flex; align-items: center; gap: 2.2rem; }
.header-right { flex: 0 0 auto; }
/* Equalize header side widths so center stays perfectly centered */
.header-left, .header-right { flex: 0 0 900px; min-width: 900px; }
.header-right { gap: 1.2rem; }
@media (max-width: 1200px) {
  .header-left, .header-right { flex: 0 0 400px; min-width: 400px; }
  .header-right { gap: 0.5rem; }
}
.header-center { flex: 1 1 auto; justify-content: center; }
@media (max-width: 1000px){
  .header-left, .header-right { flex: 0 0 220px; min-width: 220px; }
}
@media (max-width: 700px){
  .header-left, .header-right { flex: 0 0 33%; min-width: 0; }
}
.logo {
  font-weight: bold;
  font-size: 2rem;
  letter-spacing: 2.5px;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--gold-dark);
  text-shadow: 0 2px 8px #ffd70033;
}
.user-badge {
  background: var(--glass);
  padding: 0.4rem 1.1rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  box-shadow: 0 2px 8px #ffd70022;
}
.btn-logout {
  background: var(--glass);
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 0.4em 1.1em;
  font-size: 1rem;
  cursor: pointer;
  margin-right: 0.7rem;
  transition: background 0.4s, color 0.4s, box-shadow 0.4s;
  box-shadow: 0 2px 8px #ffd70022;
}
.btn-logout:hover {
  background: var(--gold-dark);
  color: #222;
  box-shadow: 0 4px 16px #ffd70055;
}
.dashboard-main {
  min-height: 100vh;
  background: transparent;
  padding: 2.5rem 0;
}
.dashboard-container {
  background: var(--card-bg);
  border-radius: 32px;
  box-shadow: var(--shadow);
  max-width: 1700px;
  margin: 0 auto;
  padding: 2.5rem 2rem 2rem 2rem;
}
.dashboard-header {
  font-size: 1.5rem;
  color: var(--primary-green);
  margin-bottom: 1.5rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  letter-spacing: 1.5px;
}
.dashboard-header i {
  color: var(--gold-dark);
  font-size: 1.3em;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.2rem;
}
.card {
  background: var(--gradient-card);
  border-radius: 24px;
  box-shadow: 0 8px 32px #228b2212, 0 1.5px 8px #ffd70022;
  padding: 2.1rem 1.5rem;
  min-height: 140px;
  font-size: 1.08rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: none;
  transition: box-shadow 0.5s, transform 0.5s, filter 0.5s;
  filter: drop-shadow(0 2px 8px #ffd70011);
  position: relative;
  overflow: hidden;
  animation: fadeInUp .55s ease-out both;
}
.card:hover {
  box-shadow: 0 16px 48px #228b2240, 0 4px 24px #ffd70044;
  transform: scale(1.025);
  filter: brightness(1.04) drop-shadow(0 4px 16px #ffd70022);
}
.card-title {
  font-weight: 900;
  color: var(--primary-green);
  margin-bottom: 1.3rem;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  letter-spacing: 1.2px;
  text-shadow: 0 2px 8px #ffd70011;
}
.card-title i { color: var(--primary-green); }
/* Colorful icons per card type */
.card-water .card-title i { color: var(--blue); }
.card-study .card-title i { color: var(--secondary-green); }
.card-test .card-title i { color: var(--orange); }
.card-motivation .card-title i { color: var(--gold-dark); }
.card-goals .card-title i { color: var(--gold); }
.card-recent-challenges .card-title i { color: var(--secondary-green); }
.card-tasks .card-title i { color: var(--primary-green); }
.card-stats .card-title i { color: var(--primary-green); }
.card-wakeup .card-title i { color: var(--gold-dark); }
/* Letters / Reports / Settings titles */
.letters-panel .card-title i { color: var(--primary-green); }
.report-card h3 i { color: var(--primary-green); }
.settings-card .card-title i { color: var(--primary-green); }
/* Sidebar and chat header accents */
.chat-title i { color: var(--gold-dark); }
.filters-card h4 i { color: var(--primary-green); }
.btn-green, .btn-gold, .btn-outline {
  font-weight: 700;
  font-size: 1.08rem;
  border-radius: 14px;
  padding: 0.6em 1.3em;
  cursor: pointer;
  margin-top: 0.7rem;
  transition: background 0.5s, box-shadow 0.5s, filter 0.5s, color 0.5s, border 0.5s;
  box-shadow: 0 2px 12px #228b2222, 0 0 8px #ffd70033;
  border-bottom: 2.5px solid #ffd70044;
  outline: none;
}
.btn-green {
  background: var(--gradient-green);
  color: #fff;
  border: none;
}
.btn-green:hover {
  background: var(--gradient-gold);
  color: #228B22;
  filter: brightness(1.08);
  box-shadow: 0 6px 24px #ffd70055, 0 0 16px #ffd70033;
}
.btn-gold {
  background: var(--gradient-gold);
  color: #228B22;
  border: none;
}
.btn-gold:hover {
  background: var(--gradient-green);
  color: #fff;
  filter: brightness(1.08);
  box-shadow: 0 6px 24px #228b2233, 0 0 16px #ffd70033;
}
.btn-outline {
  background: var(--glass);
  color: var(--primary-green);
  border: 2px solid #228b2233;
  backdrop-filter: blur(6px);
}
.btn-outline:hover {
  background: var(--gradient-gold);
  color: #228B22;
  border: 2px solid #ffd70099;
  filter: brightness(1.08);
  box-shadow: 0 6px 24px #ffd70055, 0 0 16px #ffd70033;
}
input[type="time"], input[type="number"] {
  border: 1.5px solid #b6e2a1;
  border-radius: 12px;
  padding: 0.6em 1em;
  font-size: 1.08rem;
  margin-left: 0.5em;
  background: var(--glass);
  box-shadow: 0 1px 4px #ffd70011;
  transition: border 0.4s, box-shadow 0.4s;
}
input[type="time"]:focus, input[type="number"]:focus {
  border: 1.5px solid var(--primary-green);
  box-shadow: 0 2px 8px #ffd70033;
  outline: none;
}
ul {
  padding-right: 1.2em;
  margin: 0.5em 0 0 0;
}
.goal-bar {
  background: #e8f5e9;
  border-radius: 14px;
  height: 18px;
  width: 60%;
  display: inline-block;
  margin: 0 0.5em;
  vertical-align: middle;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 8px #ffd70022;
}
.card-goals li:nth-child(1) .goal-bar > div {
  background: var(--gradient-blue);
}
.card-goals li:nth-child(2) .goal-bar > div {
  background: var(--gradient-green);
}
.card-goals li:nth-child(3) .goal-bar > div {
  background: var(--gradient-orange);
}
.card-goals li:nth-child(4) .goal-bar > div {
  background: linear-gradient(90deg, #7e57c2 0%, #d1c4e9 100%);
}
.goal-bar > div {
  height: 100%;
  border-radius: 14px;
  transition: width 0.7s cubic-bezier(.4,2,.6,1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: #fff;
  font-size: 0.95em;
  font-weight: 700;
  padding-left: 8px;
  text-shadow: 0 1px 4px #2d5a2777;
}
blockquote {
  margin: 0;
  font-size: 1.15rem;
  color: #17691a;
  border-right: 4px solid #ffd700;
  padding-right: 1.2em;
  background: linear-gradient(90deg, #e8f5e9 80%, #fffbe7 100%);
  border-radius: 14px;
  box-shadow: 0 2px 8px #ffd70011;
  animation: fadeIn 1.2s;
}
.progress-chart {
  margin: 1em 0 0.5em 0;
  text-align: center;
}
.card-motivation blockquote {
  animation: fadeIn 1.2s;
}
.card-motivation .btn-outline {
  animation: fadeIn 1.2s 0.2s backwards;
}
.card .study-info, .card .water-info, .card .wakeup-info, .card .test-info {
  color: var(--primary-green);
  font-weight: 700;
  font-size: 1.01em;
  margin-top: 0.5em;
  letter-spacing: 0.5px;
}
.tasks-list {
  margin-bottom: 1em;
  font-size: 1.05em;
}
.tasks-list li {
  margin-bottom: 0.5em;
  display: flex;
  align-items: center;
  gap: 0.5em;
}
/* ====== Responsive Breakpoints ====== */
@media (max-width: 1280px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.6rem;
  }
}
@media (max-width: 1000px) {
  .main-header {
    padding: 0.8rem 1rem;
    min-height: 56px;
  }
  .header-left, .header-center, .header-right { gap: 0.6rem; }
  .dashboard-container {
    padding: 1.6rem 1rem;
    border-radius: 24px;
  }
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }
  .card {
    padding: 1.4rem 1rem;
    border-radius: 20px;
  }
  .card-title {
    font-size: 1.2rem;
  }
}
@media (max-width: 900px) {
  .main-header {
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  .header-left, .header-center, .header-right {
    width: 100%;
    justify-content: space-between;
  }
  .logo {
    font-size: 1.6rem;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .goal-bar { width: 100%; }
  input[type="time"], input[type="number"], textarea { width: 100%; margin-left: 0; }
  .btn-green, .btn-gold, .btn-outline { width: 100%; }
}
@media (max-width: 700px) {
  .dashboard-header {
    font-size: 1.1rem;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
  .dashboard-container {
    padding: 1rem 0.6rem;
    border-radius: 18px;
  }
  .card {
    padding: 1rem 0.7rem;
    min-height: 100px;
  }
  .card-title { font-size: 1.08rem; }
}
@media (max-width: 560px) {
  .logo { font-size: 1.4rem; }
  .user-badge { padding: 0.3rem 0.8rem; }
  .goal-bar { height: 14px; }
  .tasks-list li { font-size: 0.96em; }
  .progress-chart img { max-width: 100%; height: auto; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Additional motion primitives */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Auth (Login/Signup) ===== */
.auth-page { background: linear-gradient(135deg, #222e23 0%, #228B22 100%); }
.auth-header { background: transparent; box-shadow: none; padding: 1.2rem 0; }
.auth-main { min-height: calc(100vh - 140px); display: grid; place-items: center; padding: 1.5rem; }
.auth-card {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 520px;
  padding: 2rem 1.5rem;
  animation: fadeIn 0.6s ease-out;
  overflow: hidden;
}
.auth-card-header { text-align: center; margin-bottom: 1rem; }
.auth-card-header h1 { color: var(--primary-green); font-size: 1.8rem; margin: 0.4rem 0; }
.auth-card-header p { color: #2d5a27; opacity: 0.85; }
.auth-form { margin-top: 1rem; }
.form-row { margin-bottom: 1rem; }
.form-row label { display: block; color: var(--primary-green); font-weight: 800; margin-bottom: 0.4rem; }
.form-row input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--light-green);
  border-radius: 12px;
  font-size: 1rem;
  background: #fff;
  transition: border 0.3s, box-shadow 0.3s;
}
.form-row input:focus { outline: none; border-color: var(--primary-green); box-shadow: 0 0 0 3px rgba(34, 139, 34, 0.12); }
.auth-divider { display: flex; align-items: center; gap: 0.7rem; margin: 1rem 0; color: #2d5a27; opacity: 0.8; }
.auth-divider span { flex: 1; height: 1px; background: #e0e0e0; }
.auth-divider em { font-style: normal; font-weight: 700; }
.auth-actions { display: flex; flex-direction: column; gap: 0.6rem; }
.auth-link { display: inline-block; margin-top: 0.5rem; color: var(--primary-green); text-decoration: none; font-weight: 700; text-align: center; }
.auth-footer { text-align: center; color: #fff; padding: 0.8rem; opacity: 0.85; }

/* Fixed textarea size globally (except chat composer) */
textarea {
  width: 100%;
  height: 150px;
  padding: 12px;
  box-sizing: border-box;
  border: 2px solid #ccc;
  border-radius: 4px;
  background-color: #f8f8f8;
  font-size: 16px;
  resize: none;
}
@media (max-width: 700px) {
  textarea { height: 120px; min-height: 120px; max-height: 120px; }
}

@media (max-width: 560px) {
  .auth-card { border-radius: 18px; padding: 1.2rem 1rem; }
  .auth-card-header h1 { font-size: 1.4rem; }
}

/* Auth header center alignment */
.auth-header { justify-content: center; }
.auth-header .header-center { width: 100%; display: flex; justify-content: center; }
.auth-header .logo { margin: 0 auto; }

/* Layout safety: prevent overflow of form controls */
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

/* Utility */
.full-width { width: 100%; max-width: 100%; }

/* Ensure controls never overflow cards */
.card { overflow: hidden; }
.card input[type="text"],
.card input[type="number"],
.card input[type="time"],
.card input[type="email"],
.card input[type="password"],
.card select,
.card textarea,
.card .btn-green,
.card .btn-gold,
.card .btn-outline {
  max-width: 100%;
}

/* Make common content rows flexible and safe */
.wakeup-content,
.study-content,
.water-content,
.test-content,
.challenge-content,
.auth-form,
.time-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.wakeup-content > *,
.study-content > *,
.water-content > *,
.test-content > *,
.time-input-container > * {
  flex: 0 1 auto;
  max-width: 100%;
}
/* Inputs should shrink nicely on small widths */
.card input[type="text"],
.card input[type="number"],
.card input[type="time"],
.card input[type="email"],
.card input[type="password"],
.card textarea {
  flex: 1 1 220px;
  min-width: 0; /* prevents overflow due to intrinsic size */
}

/* Auth card safety */
.auth-card { overflow: hidden; }
.auth-card .form-row input { width: 100%; max-width: 100%; }

/* Goal bars should not exceed container on small widths */
.card-goals .goal-bar { max-width: 100%; }

/* Tighten mobile further */
@media (max-width: 700px) {
  .wakeup-content,
  .study-content,
  .water-content,
  .test-content,
  .time-input-container {
    flex-direction: column;
  }
  .card .btn-green,
  .card .btn-gold,
  .card .btn-outline { width: 100%; }
}

/* ===== Letters (Chat) ===== */
.letters-container { padding: 1.6rem; }
.letters-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1.6rem; }
.chat-sidebar { background: var(--card-bg); border-radius: 20px; box-shadow: var(--shadow); padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.partner-card { display: flex; align-items: center; gap: 0.9rem; padding: 0.8rem; background: #f7fbf7; border-radius: 14px; box-shadow: 0 1px 6px #228b220f; }
.avatar-circle { width: 48px; height: 48px; border-radius: 50%; background: var(--gradient-green); color: #fff; display: grid; place-items: center; font-size: 1.1rem; box-shadow: 0 2px 8px #228b2216; }
.partner-info h3 { margin: 0; color: var(--primary-green); font-size: 1rem; }
.partner-info .partner-name { margin: 0; color: #2d5a27; font-weight: 800; }
.partner-status { margin: 0; color: #2d5a27; opacity: 0.8; font-size: 0.9rem; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #4caf50; display: inline-block; margin-left: 6px; box-shadow: 0 0 0 3px #4caf501a; }
.chat-actions .small { padding: 0.35em 0.7em; font-size: 0.9rem; }
.filters-card { background: #f7fbf7; border-radius: 14px; padding: 0.8rem; box-shadow: 0 1px 6px #228b220f; }
.filters-card h4 { margin: 0 0 0.6rem 0; color: var(--primary-green); }
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.chat-window { background: var(--card-bg); border-radius: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; height: 70vh; min-height: 420px; }
.chat-header { padding: 0.9rem 1rem; border-bottom: 1px solid #e8f5e9; display: flex; align-items: center; justify-content: space-between; }
.chat-title { color: var(--primary-green); font-weight: 900; }

.messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem; background: linear-gradient(180deg, #fff, #f7fbf7); }
.message { display: flex; }
.message.me { justify-content: flex-start; }
.message.partner { justify-content: flex-end; }
.message .bubble { max-width: min(75%, 560px); padding: 0.7rem 0.9rem; border-radius: 14px; box-shadow: 0 2px 10px #00000010; position: relative; line-height: 1.7; font-size: 0.98rem; }
.message.me .bubble { background: #e8f5e9; color: #1d361c; border-top-right-radius: 4px; }
.message.partner .bubble { background: #fffbe7; color: #4f3a00; border-top-left-radius: 4px; }
.bubble .meta { font-size: 0.78rem; opacity: 0.75; margin-top: 0.35rem; }

.composer { display: flex; gap: 0.7rem; padding: 0.8rem; border-top: 1px solid #e8f5e9; background: #ffffffcc; backdrop-filter: blur(6px); border-bottom-left-radius: 20px; border-bottom-right-radius: 20px; }
.composer textarea { flex: 1 1 auto; resize: none; padding: 0.7rem 0.9rem; border-radius: 12px; border: 1.5px solid #e0e0e0; font-family: inherit; font-size: 1rem; min-height: 44px; }
.composer-actions { display: flex; gap: 0.5rem; }
/* Animate chat bubbles on appearance */
.messages .bubble { animation: scaleIn .25s ease-out both; }

@media (max-width: 1000px) {
  .letters-layout { grid-template-columns: 1fr; }
  .chat-window { height: 65vh; }
}

/* Tabs */
.letters-tabs { display: flex; gap: 0.6rem; margin: 0 0 1rem 0; }
.tab-btn { border: none; padding: 0.6rem 1rem; border-radius: 12px; cursor: pointer; font-weight: 850; color: #fff; background: var(--gradient-green); box-shadow: 0 2px 8px #228b221a; transition: transform .2s ease, box-shadow .25s ease; }
.tab-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px #228b2225; }
.tab-btn.active { background: var(--gradient-gold); color: #2d5a27; }
.tab-panel { opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease; }
.tab-panel.hidden { display: none; }
.tab-panel:not(.hidden) { opacity: 1; transform: translateY(0); }

/* Letters compose/list */
.letters-panel { background: var(--card-bg); border-radius: 20px; box-shadow: var(--shadow); padding: 1rem; display: flex; flex-direction: column; }
.letters-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.letters-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; max-height: 56vh; overflow-y: auto; }
.letter-item { background: #f7fbf7; border-radius: 14px; padding: 0.9rem; box-shadow: 0 1px 6px #228b220f; }
.letter-title { font-weight: 900; color: #2d5a27; margin-bottom: 0.2rem; }
.letter-snippet { color: #2d5a27; opacity: 0.9; }
.letter-meta { margin-top: 0.4rem; font-size: 0.9rem; color: #2d5a27; opacity: 0.85; display: flex; align-items: center; gap: 0.5rem; }
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.8rem; font-weight: 800; }
.badge.sent { background: #e8f5e9; color: #2d5a27; }
.badge.received { background: #fffbe7; color: #4f3a00; }

@media (max-width: 1000px) {
  .letters-grid { grid-template-columns: 1fr; }
}

/* Letter modal */
.letter-modal { position: fixed; inset: 0; display: none; z-index: 1000; }
.letter-modal.show { display: block; }
.letter-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.letter-modal__dialog { position: relative; max-width: 640px; margin: 6vh auto; background: var(--card-bg); border-radius: 18px; box-shadow: var(--shadow); padding: 1rem; animation: fadeIn .25s ease-out; }
.letter-modal__header { display: flex; justify-content: space-between; align-items: center; gap: .6rem; border-bottom: 1px solid #e8f5e9; padding-bottom: .6rem; }
.letter-modal__title { font-weight: 900; color: var(--primary-green); }
.letter-modal__close { border: none; background: transparent; font-size: 1.6rem; line-height: 1; cursor: pointer; color: #2d5a27; }
.letter-modal__meta { font-size: .9rem; color: #2d5a27; opacity: .8; margin: .6rem 0; }
.letter-modal__body { white-space: pre-wrap; line-height: 1.9; color: #2d5a27; background: #f7fbf7; border-radius: 12px; padding: .8rem; box-shadow: inset 0 1px 3px #0000000f; }
.letter-modal__footer { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .8rem; }

/* Clickable letter item */
.letters-items .letter-item { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.letters-items .letter-item:hover { transform: translateY(-2px); box-shadow: 0 4px 16px #228b2216; }
/* Subtle entrance for list items */
.letters-items .letter-item,
.timer-log .session-item,
.dashboard-grid .tasks-list li { animation: slideInUp .35s ease-out both; }
.letters-items .letter-item:nth-child(1) { animation-delay: .02s; }
.letters-items .letter-item:nth-child(2) { animation-delay: .04s; }
.letters-items .letter-item:nth-child(3) { animation-delay: .06s; }
.letters-items .letter-item:nth-child(4) { animation-delay: .08s; }
.letters-items .letter-item:nth-child(5) { animation-delay: .10s; }

@media (max-width: 700px){
  .letter-modal__dialog { margin: 4vh 12px; }
}

/* ===== Reports ===== */
.reports-container { padding: 1.6rem; }
.reports-controls { display: flex; gap: 0.8rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.compare-toggle { display: inline-flex; align-items: center; gap: 0.4rem; color: #2d5a27; font-weight: 800; }
.reports-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.report-card { background: var(--card-bg); border-radius: 20px; box-shadow: var(--shadow); padding: 1rem; }
.report-card h3 { color: var(--primary-green); font-size: 1.1rem; margin: 0 0 0.8rem 0; display: flex; align-items: center; gap: 0.5rem; }
/* Animate report cards and dashboard cards with stagger */
.dashboard-grid .card,
.reports-grid .report-card,
.challenges-grid .card,
.settings-grid .settings-card { animation: fadeInUp .5s ease-out both; }
.dashboard-grid .card:nth-child(1),
.reports-grid > *:nth-child(1),
.challenges-grid > *:nth-child(1),
.settings-grid > *:nth-child(1) { animation-delay: .02s; }
.dashboard-grid .card:nth-child(2),
.reports-grid > *:nth-child(2),
.challenges-grid > *:nth-child(2),
.settings-grid > *:nth-child(2) { animation-delay: .05s; }
.dashboard-grid .card:nth-child(3),
.reports-grid > *:nth-child(3),
.challenges-grid > *:nth-child(3),
.settings-grid > *:nth-child(3) { animation-delay: .08s; }
.dashboard-grid .card:nth-child(4),
.reports-grid > *:nth-child(4),
.challenges-grid > *:nth-child(4),
.settings-grid > *:nth-child(4) { animation-delay: .11s; }
.dashboard-grid .card:nth-child(5),
.reports-grid > *:nth-child(5),
.challenges-grid > *:nth-child(5),
.settings-grid > *:nth-child(5) { animation-delay: .14s; }

/* Subtle hover lift for all cards */
.report-card:hover,
.settings-card:hover { box-shadow: 0 16px 48px #228b2240, 0 4px 24px #ffd70044; transform: translateY(-3px) scale(1.01); transition: transform .25s ease, box-shadow .25s ease; }

@media (max-width: 1000px) {
  .reports-grid { grid-template-columns: 1fr; }
}

/* Fancy select */
.luxury-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbf7 100%);
  border: 2px solid #e0e0e0;
  border-radius: 14px;
  padding: 0.6rem 2.6rem 0.6rem 0.9rem;
  font-size: 1rem;
  color: #2d5a27;
  font-weight: 800;
  box-shadow: 0 2px 10px #228b2211, inset 0 1px 0 #ffffff;
  transition: border 0.3s, box-shadow 0.3s, background 0.3s;
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='5,7 10,12 15,7' fill='none' stroke='%23228B22' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 10px center;
  background-size: 16px 16px;
}
.luxury-select:hover {
  border-color: #b6e2a1;
  box-shadow: 0 4px 16px #228b221a, inset 0 1px 0 #ffffff;
}
.luxury-select:focus {
  outline: none;
  border-color: #228B22;
  box-shadow: 0 0 0 4px rgba(34,139,34,0.12), 0 4px 16px #228b221a;
  background: linear-gradient(135deg, #ffffff 0%, #fffbe7 100%);
}
/* Compact on small screens */
@media (max-width: 700px) {
  .luxury-select {
    width: 100%;
    font-size: 0.98rem;
    padding: 0.5rem 2.3rem 0.5rem 0.8rem;
  }
}

/* ===== Settings ===== */
.settings-container { padding: 1.6rem; }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.settings-card { min-height: 140px; }
.settings-form .form-row { margin-bottom: 0.8rem; }
.settings-form .form-actions { margin-top: 0.6rem; }
.partner-box { background: #f7fbf7; border-radius: 14px; padding: 0.8rem; box-shadow: 0 1px 6px #228b220f; margin-bottom: 0.8rem; }
.partner-row { display: flex; justify-content: space-between; padding: 0.2rem 0; color: #2d5a27; }
.partner-row .label { font-weight: 800; }
.prefs { display: flex; align-items: center; gap: 0.6rem; margin: 0.5rem 0; }
/* iOS-like switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #e0e0e0; transition: .3s; border-radius: 999px; box-shadow: inset 0 1px 2px #00000014; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; transition: .3s; border-radius: 50%; box-shadow: 0 2px 6px #00000022; }
.switch input:checked + .slider { background: var(--secondary-green); }
.switch input:checked + .slider:before { transform: translateX(20px); }

@media (max-width: 1000px) {
  .settings-grid { grid-template-columns: 1fr; }
}

/* ===== Challenges ===== */
/* --- CHALLENGES PAGE BEAUTIFICATION --- */
.challenges-container {
  background: linear-gradient(120deg, #f7fbf7 80%, #e8f5e9 100%);
  border-radius: 32px;
  box-shadow: 0 8px 32px #228b2212, 0 1.5px 8px #ffd70022;
  padding: 2.5rem 1.5rem 2rem 1.5rem;
}
.challenges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.2rem;
  margin-top: 1.2rem;
}
.challenges-grid .card {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 4px 24px #228b2212, 0 1.5px 8px #ffd70022;
  border: 1.5px solid #e8f5e9;
  padding: 2.1rem 1.5rem 1.5rem 1.5rem;
  transition: box-shadow 0.4s, transform 0.4s, border 0.4s;
  position: relative;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.challenges-grid .card:hover {
  box-shadow: 0 12px 40px #228b2240, 0 4px 24px #ffd70044;
  border: 1.5px solid #ffd70055;
  transform: translateY(-4px) scale(1.025);
}
.challenges-grid .card-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--primary-green);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  letter-spacing: 1.2px;
  text-shadow: 0 2px 8px #ffd70011;
  border-right: 5px solid #ffd700;
  padding-right: 0.7rem;
}
.challenges-grid .card-title i {
  font-size: 1.5em;
  color: var(--gold-dark);
  filter: drop-shadow(0 2px 8px #ffd70033);
}
.card-goals {
  background: linear-gradient(120deg, #f9fbe7 80%, #e8f5e9 100%);
  border: 1.5px solid #e8f5e9;
  box-shadow: 0 2px 12px #ffd70022;
}
.goals-bars {
  background: #f7fbf7;
  border-radius: 16px;
  box-shadow: 0 2px 12px #ffd70011;
  padding: 1rem 0.7rem;
  margin-top: 1.2rem;
}
.challenges-grid .tasks-list {
  margin-bottom: 1.2rem;
}
.challenges-grid .tasks-list li {
  background: #f7fbf7;
  border-radius: 12px;
  border: 1.5px solid #e8f5e9;
  margin-bottom: 0.5em;
  padding: 0.7em 1em;
  display: flex;
  align-items: center;
  gap: 0.7em;
  transition: background 0.3s, border 0.3s;
  cursor: pointer;
}
.challenges-grid .tasks-list li:hover {
  background: #e8f5e9;
  border-color: #ffd70077;
}
.challenges-grid .tasks-list input[type="checkbox"]:checked + label {
  text-decoration: line-through;
  color: #b6e2a1;
}
.challenges-grid .tasks-list input[type="checkbox"]:checked {
  accent-color: var(--primary-green);
}
.challenges-grid .tasks-list li:has(input[type="checkbox"]:checked) {
  background: #e8f5e9;
  border-color: #ffd700;
}
.challenges-grid form {
  margin-top: 0.7rem;
  margin-bottom: 0.7rem;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.challenges-grid input[type="text"], .challenges-grid input[type="number"] {
  border-radius: 14px;
  border: 1.5px solid #b6e2a1;
  padding: 0.7em 1.1em;
  font-size: 1.08rem;
  background: #f7fbf7;
  transition: border 0.3s, box-shadow 0.3s;
}
.challenges-grid input[type="text"]:focus, .challenges-grid input[type="number"]:focus {
  border-color: var(--primary-green);
  box-shadow: 0 2px 8px #ffd70033;
}
.challenges-grid .btn-green, .challenges-grid .btn-gold {
  font-size: 1.13rem;
  font-weight: 900;
  border-radius: 16px;
  padding: 0.7em 1.5em;
  margin-top: 0;
  box-shadow: 0 2px 12px #228b2222, 0 0 8px #ffd70033;
}
.challenges-grid .btn-green {
  background: var(--gradient-green);
  color: #fff;
  border: none;
}
.challenges-grid .btn-gold {
  background: var(--gradient-gold);
  color: #228B22;
  border: none;
}
.challenges-grid .btn-green:hover {
  background: var(--gradient-gold);
  color: #228B22;
}
.challenges-grid .btn-gold:hover {
  background: var(--gradient-green);
  color: #fff;
}
.challenges-grid .form-row {
  margin-bottom: 1.1rem;
  gap: 0.5rem;
}
.challenges-grid .form-actions {
  margin-top: 1rem;
  gap: 0.7rem;
}
@media (max-width: 1200px) {
  .challenges-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}
@media (max-width: 900px) {
  .challenges-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  .challenges-grid .card {
    min-height: 0;
    padding: 1.2rem 0.7rem;
  }
}
/* --- END CHALLENGES BEAUTIFICATION --- */

/* ===== Study Timer ===== */
.timer-container { padding: 1.6rem; }
.timer-grid { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 1.2rem; }
@media (max-width: 1200px){ .timer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 800px){ .timer-grid { grid-template-columns: 1fr; } }
.timer-card .timer-display { font-family: monospace; font-size: 3rem; text-align: center; color: #2d5a27; background: #f7fbf7; border-radius: 16px; padding: .8rem 1rem; box-shadow: inset 0 1px 3px #00000012; }
.timer-actions { display: flex; gap: .6rem; justify-content: center; margin-top: .7rem; flex-wrap: wrap; }
.goal-wrap { margin-top: .6rem; }
.timer-log .sessions-list { list-style: none; margin: .6rem 0 0 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; max-height: 220px; overflow-y: auto; }
.session-item { background: #f7fbf7; border-radius: 12px; padding: .6rem .8rem; box-shadow: 0 1px 6px #228b220f; }
.session-top { color: #2d5a27; font-weight: 900; }
.session-bottom { color: #2d5a27; opacity: .9; }
.timer-stats .timer-stats-list { list-style: none; padding: 0; margin: .3rem 0 0 0; display: grid; gap: .4rem; }

/* ===== Dashboard scrollable lists ===== */
.dashboard-grid .card-tasks .tasks-list,
.dashboard-grid .card-recent-challenges .tasks-list {
  max-height: 32vh;
  overflow-y: auto;
}
.dashboard-grid .card-tasks .tasks-list::-webkit-scrollbar,
.dashboard-grid .card-recent-challenges .tasks-list::-webkit-scrollbar { width: 8px; }
.dashboard-grid .card-tasks .tasks-list::-webkit-scrollbar-track,
.dashboard-grid .card-recent-challenges .tasks-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 999px; }
.dashboard-grid .card-tasks .tasks-list::-webkit-scrollbar-thumb,
.dashboard-grid .card-recent-challenges .tasks-list::-webkit-scrollbar-thumb { background: #cfe9cf; border-radius: 999px; }
.dashboard-grid .card-tasks .tasks-list::-webkit-scrollbar-thumb:hover,
.dashboard-grid .card-recent-challenges .tasks-list::-webkit-scrollbar-thumb:hover { background: #b6e2a1; }

/* ====== Fix: اندازه ثابت برای کارت "کارهای امروز" و اسکرول داخلی ====== */
/* ارتفاع اصلی کارت - در صورت نیاز این مقدار را کم/زیاد کنید */
.card-tasks {
  /* ارتفاع ثابت (جلوگیری از بزرگ‌تر شدن کارت و شکستن گرید) */
  height: 280px;
  min-height: 280px;
  max-height: 280px;

  /* اجازه دهید محتوا داخل کارت اسکرول شود */
  display: flex;
  flex-direction: column;
}

/* عنوان کارت اندازه‌اش ثابت می‌ماند؛ لیست داخل فضای باقی‌مانده اسکرول می‌شود */
.card-tasks .card-title {
  flex: 0 0 auto;
}

/* لیست تسک‌ها فضای باقیمانده را می‌گیرد و اسکرول می‌شود */
.card-tasks .tasks-list {
  flex: 1 1 auto;
  max-height: 100%;
  overflow-y: auto;
  padding-right: 0.9em; /* برای راست به چپ */
  margin: 0.2em 0 0 0;
}

/* هماهنگ با استایل اسکرولر قبلی */
.card-tasks .tasks-list::-webkit-scrollbar { width: 8px; }
.card-tasks .tasks-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 999px; }
.card-tasks .tasks-list::-webkit-scrollbar-thumb { background: #cfe9cf; border-radius: 999px; }
.card-tasks .tasks-list::-webkit-scrollbar-thumb:hover { background: #b6e2a1; }

/* ====== Responsive: ارتفاع کارت در صفحه‌های کوچکتر کمتر می‌شود ====== */
@media (max-width: 900px) {
  .card-tasks {
    height: 200px;
    min-height: 200px;
    max-height: 200px;
  }
}

/* ====== رنگی کردن آیکون‌ها (صریح و قابل تنظیم) ====== */
/* کارهای امروز (tasks) */
.card-tasks .card-title i { color: var(--primary-green); }

/* آمار کلی (stats) — رنگ سبز ثانویه */
.card-stats .card-title i { color: var(--secondary-green); }

/* چالش‌های مشترک اخیر — نارنجی برای تاکید */
.card-recent-challenges .card-title i { color: var(--orange); }

/* اگر خواستید آیکون مطالعه (card-study) هم واضح‌تر شود */
.card-study .card-title i { color: var(--secondary-green); }




.card-recent-challenges {
  /* ارتفاع ثابت (جلوگیری از بزرگ‌تر شدن کارت و شکستن گرید) */
  height: 280px;
  min-height: 280px;
  max-height: 280px;

  /* اجازه دهید محتوا داخل کارت اسکرول شود */
  display: flex;
  flex-direction: column;
}

/* عنوان کارت اندازه‌اش ثابت می‌ماند؛ لیست داخل فضای باقی‌مانده اسکرول می‌شود */
.card-recent-challenges .card-title {
  flex: 0 0 auto;
}

/* لیست تسک‌ها فضای باقیمانده را می‌گیرد و اسکرول می‌شود */
.card-recent-challenges .tasks-list {
  flex: 1 1 auto;
  max-height: 100%;
  overflow-y: auto;
  padding-right: 0.9em; /* برای راست به چپ */
  margin: 0.2em 0 0 0;
}

/* هماهنگ با استایل اسکرولر قبلی */
.card-recent-challenges .tasks-list::-webkit-scrollbar { width: 8px; }
.card-recent-challenges .tasks-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 999px; }
.card-recent-challenges .tasks-list::-webkit-scrollbar-thumb { background: #cfe9cf; border-radius: 999px; }
.card-recent-challenges .tasks-list::-webkit-scrollbar-thumb:hover { background: #b6e2a1; }

/* ====== Responsive: ارتفاع کارت در صفحه‌های کوچکتر کمتر می‌شود ====== */
@media (max-width: 900px) {
  .card-recent-challenges {
    height: 200px;
    min-height: 200px;
    max-height: 200px;
  }
}

.card-motivation .motivation-content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 1rem;
}
.card-motivation blockquote {
  font-size: 1.35rem;
  line-height: 1.9;
  text-align: center;
  margin: 0;
  width: 100%;
}

/* Match sizes of wake/sleep time inputs on dashboard */
.card-wakeup input[type="time"] {
  width: 160px;
  min-width: 160px;
  flex: 0 0 160px; /* override generic flex: 1 1 220px on inputs in cards */
}
@media (max-width: 700px){
  .card-wakeup input[type="time"] {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }
}

/* ===== Goals card sizing and spacing ===== */
.card-goals ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.card-goals li { display: flex; align-items: center; gap: 10px; }
/* Fix goal bar size inside goals card */
.card-goals .goal-bar { width: 240px; margin: 0 8px; }
@media (max-width: 900px){ .card-goals .goal-bar { width: 100%; } }
/* Prevent numbers from wrapping awkwardly */
.card-goals li span { white-space: nowrap; }

/* Unified page container sizing */

.letters-container,
.reports-container,
.settings-container,
.challenges-container,
.timer-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Ensure consistent min heights for main containers */
.letters-container,
.reports-container,
.settings-container,
.timer-container { min-height: calc(100vh - 180px); }

/* Respect user motion preference */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Center brand/logo in header across pages */
.header-center { display: flex; justify-content: center; flex: 1 1 auto; }
.header-center .logo { text-align: center; }

/* Header buttons - luxury pill style */
.main-header a.btn-outline {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.25);
  padding: 0.45em 1.1em;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: .2px;
  box-shadow: 0 2px 10px rgba(0,0,0,.12), 0 0 0 2px rgba(212,175,55,.15) inset;
  transition: transform .2s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.main-header a.btn-outline:hover {
  background: var(--gradient-gold);
  color: #2d5a27;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(245,200,66,.35), 0 0 0 2px rgba(255,255,255,.25) inset;
}
.main-header a.btn-outline:active { transform: translateY(0); filter: brightness(.98); }

/* Logout button align with new style */
.btn-logout {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 0.45em 1.1em;
  font-weight: 800;
  letter-spacing: .2px;
  box-shadow: 0 2px 10px rgba(0,0,0,.12), 0 0 0 2px rgba(212,175,55,.15) inset;
  transition: transform .2s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
}
.btn-logout:hover { background: var(--gradient-gold); color: #2d2d2d; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(245,200,66,.35), 0 0 0 2px rgba(255,255,255,.25) inset; }
.btn-logout:active { transform: translateY(0); filter: brightness(.98); }

/* Icon alignment inside header buttons */
.main-header a.btn-outline i, .btn-logout i { font-size: 0.95em; }

/* ===== Global UI scale (simulates browser 75% zoom) ===== */
:root { --ui-zoom: 0.80; }
html { zoom: var(--ui-zoom); }
/* Fallback for browsers that do not support zoom */
@supports not (zoom: 1) {
  body { transform: scale(var(--ui-zoom)); transform-origin: top center; }
  .dashboard-container,
  .letters-container,
  .reports-container,
  .settings-container,
  .challenges-container,
  .timer-container { width: calc(100% / var(--ui-zoom)); }
}

/* Timer page tweaks */
.timer-log .sessions-list { max-height: 220px; overflow-y: auto; }
.timer-stats { display: flex; flex-direction: column; justify-content: flex-start; }
.timer-stats .card-title { margin-bottom: .6rem; }
.timer-stats .timer-stats-list { max-height: 220px; overflow-y: auto; margin: 0; }
/* Center buttons in timer manual cards */
.timer-card .timer-actions { justify-content: center; }
/* Generic helper for center action rows */
.center-actions { display: flex; justify-content: center; gap: .6rem; }

/* Mini bars in timer stats */
.mini-bars { margin-top: .6rem; display: grid; gap: .5rem; }
.mini-bar { display: grid; gap: .3rem; color: var(--primary-green); font-weight: 800; font-size: .95rem; }
.mini-bar-track { background: #eef7ee; border-radius: 12px; height: 14px; box-shadow: inset 0 1px 2px rgba(0,0,0,.06); overflow: hidden; }
.mini-bar-track > div { height: 100%; border-radius: 12px; background: var(--gradient-green); color: #fff; display: flex; align-items: center; justify-content: flex-end; padding-left: 6px; font-size: .8rem; text-shadow: 0 1px 2px rgba(0,0,0,.15); }

/* Message status icons */
.message-status {
  margin-right: 6px;
  font-size: 12px;
  transition: all 0.3s ease;
}

.message-status.pending {
  color: #ff9800;
  animation: pulse 1.5s infinite;
}

.message-status.success {
  color: #4caf50;
}

.message-status.error {
  color: #f44336;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Message time styling */
.message-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #666;
  margin-top: 4px;
}

/* Chat messages styling */
.messages {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 400px;
  overflow-y: auto;
  padding: 1rem;
}

.chat-message {
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-end;
}

/* RTL: show my (sent) messages on the left, received on the right */
.chat-message.sent {
  justify-content: flex-start;
}

.chat-message.received {
  justify-content: flex-end;
}

.message-content {
  max-width: 70%;
  padding: 0.75rem 1rem;
  border-radius: 18px;
  position: relative;
}

/* Sent (me) bubble on the left */
.chat-message.sent .message-content {
  background: var(--gradient-green);
  color: rgb(255, 255, 255);
  border-bottom-right-radius: 4px;
}

/* Received bubble on the right */
.chat-message.received .message-content {
  background: #f0f0f0;
  color: #333;
  border-bottom-left-radius: 4px;
}

.message-text {
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.message-time {
  font-size: 0.75rem;
  opacity: 0.8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.chat-message.sent .message-time {
  color: rgba(255, 255, 255, 0.8);
}

.chat-message.received .message-time {
  color: #666;
}
