:root {
  --bg: #030005;
  --panel: rgba(255, 255, 255, 0.03);
  --panel2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f5f3ff;
  --muted: rgba(245, 243, 255, 0.6);
  --primary: #a855f7;
  --primary-glow: rgba(168, 85, 247, 0.25);
  --accent: #6366f1;
  --danger: #f87171;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  --r: 20px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, Arial, sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(168, 85, 247, 0.12), transparent 35%),
    radial-gradient(circle at 70% 85%, rgba(99, 102, 241, 0.1), transparent 45%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 12px;
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brandLogo {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 900;
  border: 1px solid rgba(168, 85, 247, 0.3);
  background: rgba(168, 85, 247, 0.1);
}

.brandTitle {
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.5px;
}

.brandSub {
  font-size: 11px;
  opacity: 0.6;
}

.nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 24px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn:hover {
  background: var(--panel2);
  transform: translateY(-2px) scale(1.02);
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #ffffff;
  border: none;
  box-shadow: 0 8px 25px var(--primary-glow);
}

.btn.primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 10px 30px rgba(168, 85, 247, 0.4);
}

.btn.active {
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--primary);
  color: var(--primary);
}

.grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 14px;
}

@media(max-width: 920px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.card {
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  padding: 20px;
  position: relative;
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -1px;
}

.h2 {
  margin: 0 0 10px 0;
  font-size: 17px;
  font-weight: 900;
  color: var(--text);
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

hr.sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.kpi {
  padding: 15px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel2);
  text-align: center;
}

.kpi b {
  font-size: 20px;
  color: var(--primary);
  display: block;
}

.kpi span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.6;
}

.list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

@media(max-width: 600px) {
  .list {
    grid-template-columns: 1fr;
  }
}

.subject {
  padding: 16px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--panel2);
  position: relative;
  transition: all 0.3s;
}

.subject:hover {
  border-color: rgba(168, 85, 247, 0.3);
  transform: scale(1.01);
}

.subjectTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(168, 85, 247, 0.4);
  background: rgba(168, 85, 247, 0.1);
  font-weight: 700;
  color: var(--primary);
}

.subjectTitle {
  font-weight: 900;
  font-size: 15px;
}

.subjectMeta {
  margin-top: 8px;
  font-size: 12.5px;
  opacity: 0.7;
  line-height: 1.4;
}

.searchBar {
  width: 100%;
  padding: 12px 16px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-family: inherit;
  margin-bottom: 12px;
  font-size: 14px;
  transition: all 0.2s;
}

.searchBar:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Table Horarios */
.tableWrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 13px;
}

th {
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  background: rgba(10, 20, 15, 0.8);
  backdrop-filter: blur(8px);
}

/* Animação de Troca de Foto */
#profilePreview {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.photoUpdate {
  animation: photoPop 0.5s ease-out;
}

@keyframes photoPop {
  0% {
    transform: scale(0.8);
    filter: brightness(1.5) blur(5px);
  }

  50% {
    transform: scale(1.1);
    filter: brightness(1.2);
  }

  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

#profilePreview:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--primary-glow);
}

/* Toasts */
#notificationHost {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #1a1a1a;
  color: var(--text);
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  border-left: 4px solid var(--primary);
}

.toast.danger {
  border-left: 4px solid var(--danger);
}

.is-not-verified-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: 5;
  font-size: 12px;
  font-weight: 800;
  color: #fca5a5;
  text-align: center;
  padding: 20px;
}

/* Profiles */
.userIcon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: 0.2s;
}

.userIcon:hover {
  transform: scale(1.1);
  border-color: var(--primary);
}

.userIcon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.authorTag {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
}

.authorTag img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

/* Pulse animation */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}

/* Menu de Opções (3 Pontinhos) Refinado */
.cardActions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
}

.menuBtn {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 16px;
  overflow: hidden;
}

.menuBtn::before {
  content: '•••';
  letter-spacing: 1px;
  font-weight: 900;
}

.menuBtn:hover {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 0 20px var(--primary-glow);
}

.menuDropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: rgba(15, 10, 25, 0.95);
  backdrop-filter: blur(25px);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  z-index: 100;
  display: none;
  min-width: 170px;
  overflow: hidden;
  transform-origin: top right;
  animation: menuAppear 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes menuAppear {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-15px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.menuDropdown.show {
  display: block;
}

.menuItem {
  width: 100%;
  padding: 14px 18px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}

.menuItem:hover {
  background: rgba(168, 85, 247, 0.2);
  color: var(--primary);
  padding-left: 22px;
}

.menuItem.danger {
  color: #f87171;
}

.menuItem.danger:hover {
  background: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
}

.userRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
}

.userRow:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* --- ESTILOS SOCIAIS --- */
.postCard {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.postCard:hover {
  transform: translateY(-5px);
  border-color: var(--primary) !important;
  box-shadow: 0 10px 30px rgba(168, 85, 247, 0.2);
}

.comment {
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: all 0.2s;
  margin-bottom: 8px;
}

.comment:hover {
  background: rgba(255, 255, 255, 0.04);
}

#commentList {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 8px;
  margin-top: 20px;
}

.detailGallery img {
  width: 100%;
  border-radius: 16px;
  margin-bottom: 12px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
  transition: transform 0.4s;
}

.menuBtn.mini {
  width: 24px;
  height: 24px;
  font-size: 12px;
}

.menuBtn.mini::before {
  content: '•••';
  letter-spacing: 0.5px;
}

.comment .menuDropdown {
  top: 30px;
}

/* Modal System */
.modalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modalContent {
  background: rgba(15, 10, 25, 0.98);
  border: 1px solid var(--border);
  border-radius: var(--r);
  width: 100%;
  max-width: 450px;
  padding: 30px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
  animation: modalZoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalZoomIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modalTitle {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 12px;
  color: var(--primary);
}

.modalBody {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 25px;
  color: var(--text);
}

.modalActions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* --- STUDY SYSTEM (DUOLINGO STYLE) --- */
.studyProgress {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
}

.studyProgress .bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.quizOptions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 30px;
}

.quizBtn {
  width: 100%;
  padding: 16px;
  background: var(--panel2);
  border: 2px solid var(--border);
  border-radius: 15px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.quizBtn:hover {
  border-color: var(--primary);
  background: rgba(168, 85, 247, 0.1);
  transform: translateX(5px);
}

.quizFeedback {
  margin-top: 30px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--border);
  animation: slideUp 0.3s ease-out;
}

.quizFeedback.success {
  background: rgba(34, 197, 94, 0.15);
  border-color: #22c55e;
  color: #4ade80;
}

.quizFeedback.wrong {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #f87171;
}

.quizFeedback b {
  display: block;
  font-size: 18px;
  margin-bottom: 5px;
}

.quizFeedback p {
  font-size: 14px;
  margin-bottom: 15px;
  opacity: 0.9;
}

/* ==========================================
   SISTEMA DE ESTUDO DUOLINGO - ESTILOS
   ========================================== */

/* Study Card Container */
.studyCard {
  overflow: visible;
}

/* Study Header com Stats */
.studyHeader {
  margin-bottom: 20px;
}

.studyStats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 15px;
}

.statItem {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.statIcon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.statIcon svg {
  width: 24px;
  height: 24px;
}

.statItem.streak .statIcon {
  color: #f97316;
  background: rgba(249, 115, 22, 0.15);
}

.statItem.xp .statIcon {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
}

.statItem.level .statIcon {
  color: var(--primary);
  background: rgba(168, 85, 247, 0.15);
}

.statValue {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
}

.statLabel {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.statItem.level .statValue {
  color: var(--primary);
}

/* Study Title */
.studyTitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 5px;
}

.studyTitle svg {
  color: var(--primary);
}

.difficultyBadge {
  display: block;
  width: fit-content;
  margin: 0 auto 20px;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Learning Mode */
.learnContent {
  padding: 10px 0;
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 25px;
  text-align: left;
}

.learnTitle {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.learnBody {
  line-height: 1.6;
  color: var(--text);
}

.learnBody h3 {
  font-size: 16px;
  margin: 15px 0 8px;
  color: var(--primary);
}

.learnBody p {
  margin-bottom: 10px;
  font-size: 14px;
}

.learnBody b {
  color: var(--accent);
}

.learnActions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.cancelBtn {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.2) !important;
  padding: 8px 15px !important;
  font-size: 12px !important;
}

.subjectBadge {
  background: var(--panel2);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
}

.difficultyTag {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  color: white;
  text-transform: uppercase;
}

/* Level Bar */
.levelBar {
  height: 12px;
  background: var(--panel2);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}

.levelBarFill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 20px;
  transition: width 0.5s ease;
}

.levelBarText {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  font-weight: 700;
  color: var(--text);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Subject Grid */
.subjectGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
}

/* Subject Card */
.subjectCard {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.subjectCard:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(168, 85, 247, 0.15);
}

.subjectCardIcon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(168, 85, 247, 0.1);
  border-radius: 16px;
  flex-shrink: 0;
  color: var(--primary);
}

.subjectCardIcon svg {
  width: 28px;
  height: 28px;
}

.subjectCardInfo {
  flex: 1;
}

.subjectCardTitle {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px;
}

.subjectCardMeta {
  font-size: 12px;
  color: var(--muted);
}

.subjectCardXP {
  font-size: 13px;
  color: var(--primary);
  font-weight: 700;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.subjectCardXP svg {
  width: 14px;
  height: 14px;
}

.subjectCardBtn {
  padding: 12px 20px !important;
  font-size: 12px !important;
}

/* Exercise Header */
.exerciseHeader {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.exerciseProgressBar {
  flex: 1;
  height: 10px;
  background: var(--panel2);
  border-radius: 20px;
  overflow: hidden;
}

.progressFill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  transition: width 0.4s ease;
  border-radius: 20px;
}

.exerciseXP {
  font-size: 14px;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
}

.exerciseType {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 25px;
  font-weight: 600;
}

.exerciseType svg {
  color: var(--primary);
}

.exerciseContent {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Block Exercise */
.blockAnswer {
  min-height: 70px;
  background: var(--panel2);
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
  justify-content: center;
}

.blockPlaceholder {
  color: var(--muted);
  font-size: 14px;
}

.blockOptions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.block {
  padding: 12px 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.block:hover:not(.disabled):not(.used) {
  border-color: var(--primary);
  background: rgba(168, 85, 247, 0.15);
  transform: scale(1.05);
}

.block.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.block.used {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Multiple Choice */
.multipleOptions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.multipleBtn {
  width: 100%;
  padding: 18px 20px;
  background: var(--panel2);
  border: 2px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.multipleBtn:hover:not(.selected):not(:disabled) {
  border-color: var(--primary);
  background: rgba(168, 85, 247, 0.1);
}

.multipleBtn.selected {
  border-color: var(--primary);
  background: rgba(168, 85, 247, 0.2);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

/* True/False */
.trueFalseOptions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.tfBtn {
  padding: 25px 20px;
  background: var(--panel2);
  border: 2px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.tfBtn span {
  font-size: 28px;
}

.tfBtn.true:hover:not(.selected):not(:disabled) {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.tfBtn.false:hover:not(.selected):not(:disabled) {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.tfBtn.true.selected {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.2);
}

.tfBtn.false.selected {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
}

/* Input Answer */
.inputAnswer {
  width: 100%;
  padding: 20px;
  background: var(--panel2);
  border: 2px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  font-family: inherit;
  transition: all 0.2s;
}

.inputAnswer:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.2);
}

/* Feedback Bar */
.feedbackBar {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  border-radius: 16px;
  margin-top: 25px;
  animation: slideUp 0.3s ease;
}

.feedbackBar.success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.1));
  border: 1px solid #22c55e;
}

.feedbackBar.wrong {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.1));
  border: 1px solid #ef4444;
}

.feedbackIcon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  flex-shrink: 0;
}

.feedbackBar.success .feedbackIcon {
  background: #22c55e;
  color: #fff;
}

.feedbackBar.wrong .feedbackIcon {
  background: #ef4444;
  color: #fff;
}

.feedbackText {
  flex: 1;
}

.feedbackText b {
  display: block;
  font-size: 16px;
  margin-bottom: 3px;
}

.feedbackBar.success .feedbackText b {
  color: #4ade80;
}

.feedbackBar.wrong .feedbackText b {
  color: #f87171;
}

.feedbackText span {
  font-size: 13px;
  color: var(--muted);
}

.feedbackBtn {
  padding: 14px 25px !important;
  white-space: nowrap;
}

/* Result Card */
.resultCard {
  text-align: center;
  padding: 40px 25px;
}

.resultCelebration {
  position: relative;
}

.resultStars {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.resultStars svg {
  width: 40px;
  height: 40px;
}

.resultSubject {
  font-size: 16px;
  color: var(--primary);
  font-weight: 700;
}

.resultStats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 40px 0;
  padding: 25px;
  background: var(--panel2);
  border-radius: 18px;
}

.resultStat {
  text-align: center;
}

.resultStatValue {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary);
}

.resultStatLabel {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 5px;
}

.resultActions {
  display: flex;
  gap: 15px;
}

/* Confetti Animation */
.confetti {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100px;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='10' cy='20' r='3' fill='%23a855f7'/%3E%3Ccircle cx='30' cy='40' r='2' fill='%2322c55e'/%3E%3Ccircle cx='50' cy='10' r='3' fill='%23fbbf24'/%3E%3Ccircle cx='70' cy='35' r='2' fill='%236366f1'/%3E%3Ccircle cx='90' cy='25' r='3' fill='%23f87171'/%3E%3C/svg%3E") repeat;
  animation: confettiFall 2s ease-out forwards;
  opacity: 0.8;
}

@keyframes confettiFall {
  0% {
    transform: translateX(-50%) translateY(-100%);
    opacity: 1;
  }

  100% {
    transform: translateX(-50%) translateY(50px);
    opacity: 0;
  }
}

@media (max-width: 600px) {
  .subjectGrid {
    grid-template-columns: 1fr;
  }

  .subjectCard {
    flex-direction: column;
    text-align: center;
  }

  .subjectCardBtn {
    width: 100%;
  }

  .studyStats {
    gap: 15px;
  }

  .statValue {
    font-size: 18px;
  }

  .trueFalseOptions {
    grid-template-columns: 1fr;
  }

  .resultStats {
    flex-direction: column;
    gap: 20px;
  }

  .resultActions {
    flex-direction: column;
  }

  .feedbackBar {
    flex-direction: column;
    text-align: center;
  }
}

/* Sidebar Navigation System */
.sidebarOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  z-index: 2500;
  display: flex;
  justify-content: flex-end;
  animation: modalFadeIn 0.3s ease-out;
}

.sidebar {
  width: 300px;
  height: 100%;
  background: rgba(10, 5, 20, 0.98);
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  animation: slideInSidebar 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideInSidebar {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

.sidebarHeader {
  padding: 30px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebarLinks {
  flex: 1;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.sidebarItem {
  width: 100%;
  padding: 16px 20px;
  background: none;
  border: none;
  border-radius: 14px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 15px;
}

.sidebarItem:hover {
  background: var(--panel2);
  color: var(--primary);
  transform: translateX(-5px);
}

.sidebarItem.active {
  background: rgba(168, 85, 247, 0.1);
  color: var(--primary);
  border-left: 4px solid var(--primary);
}

.sidebarItem.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
}

.burgerBtn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--panel2);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  transition: all 0.3s;
}

.burgerBtn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.burgerBtn span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 10px;
  transition: 0.3s;
}

.burgerBtn:hover span {
  background: #000;
}

/* Icon System (Lucide-inspired SVGs) */
.icon {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

.icon-home::before {
  content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>');
}

.icon-book::before {
  content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/></svg>');
}

.icon-study::before {
  content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 10v6M2 10l10-5 10 5-10 5z"/><path d="M6 12v5c3 3 9 3 12 0v-5"/></svg>');
}

.icon-mural::before {
  content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="2" x2="12" y2="22"/><polyline points="5 5 12 2 19 5 19 22 12 19 5 22 5 5"/></svg>');
}

.icon-posts::before {
  content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l4-4V5a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2z"/><path d="M13 22H7a2 2 0 0 1-2-2V9"/></svg>');
}

.icon-clock::before {
  content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>');
}

.icon-admin::before {
  content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>');
}

.icon-logout::before {
  content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="fca5a5" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/></svg>');
}

.icon-edit::before {
  content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="a855f7" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>');
}

.icon-trash::before {
  content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="f87171" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>');
}

.icon-chat::before {
  content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"/></svg>');
}

.icon-search::before {
  content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-opacity="0.5" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>');
}

.icon-check::before {
  content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>');
}

.icon-x::before {
  content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18M6 6l12 12"/></svg>');
}

.icon-plus::before {
  content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M12 5v14"/></svg>');
}

.icon-download::before {
  content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"/></svg>');
}

.icon-eye::before {
  content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>');
}

.icon-hint::before {
  content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A5 5 0 0 0 8 8c0 1 .3 1.9.8 2.5C9.5 11.3 10 12 10 13v1"/><path d="M13 18H11"/><path d="M10 22h4"/></svg>');
}

.sidebarItem .icon {
  width: 20px;
  height: 20px;
}

/* Float Chat Button */
.floatChat {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 10px 30px var(--primary-glow);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2000;
  transition: all 0.3s;
}

.floatChat:hover {
  transform: scale(1.1) rotate(5deg);
}

/* Chat Page Layout */
.chatContainer {
  height: 500px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.chatMessages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chatInputArea {
  padding: 15px;
  display: flex;
  gap: 10px;
  background: var(--panel2);
  border-top: 1px solid var(--border);
}

.chatBubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--panel2);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}

.chatBubble.me {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
}

.chatMeta {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 4px;
}

.chatTicket {
  background: var(--panel2);
  padding: 15px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.ticketStatus {
  font-size: 10px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.status-open {
  background: var(--primary);
}

.status-active {
  background: #22c55e;
}

/* Typing Indicator Animation */
.typing-dots {
  display: inline-block;
  animation: typingPulse 1.4s infinite;
}

@keyframes typingPulse {

  0%,
  20% {
    opacity: 0.3;
  }

  50% {
    opacity: 1;
  }

  80%,
  100% {
    opacity: 0.3;
  }
}

.chatBubble.system {
  background: rgba(255, 255, 255, 0.05);
  align-self: center;
  font-style: italic;
  border: 1px dashed var(--border);
}

/* Message Row Layout */
.msgRow {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.msgRow.me {
  flex-direction: row-reverse;
}

.msgAvatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.msgRow .chatBubble {
  position: relative;
  max-width: 70%;
}

/* Message Actions */
.msgActions {
  position: absolute;
  top: 5px;
  right: auto;
  left: 5px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.msgRow.me .msgActions {
  left: auto;
  right: 5px;
}

.msgRow:hover .msgActions {
  opacity: 1;
}

.msgActionBtn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.msgActionBtn:hover {
  background: var(--primary);
  transform: scale(1.1);
}

.msgActions .menuDropdown {
  top: 32px;
  left: 0;
  right: auto;
  min-width: 120px;
}

.msgRow.me .menuDropdown {
  left: auto;
  right: 0;
}

/* Reply Preview */
.replyPreview {
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--primary);
  padding: 6px 10px;
  margin-bottom: 8px;
  border-radius: 4px;
  font-size: 11px;
}

.floatChat:hover {
  transform: scale(1.1) rotate(5deg);
}

/* Chat Page Layout */
.chatContainer {
  height: 500px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.chatMessages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chatInputArea {
  padding: 15px;
  display: flex;
  gap: 10px;
  background: var(--panel2);
  border-top: 1px solid var(--border);
}

.chatBubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--panel2);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}

.chatBubble.me {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
}

.chatMeta {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 4px;
}

.chatTicket {
  background: var(--panel2);
  padding: 15px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.ticketStatus {
  font-size: 10px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.status-open {
  background: var(--primary);
}

.status-active {
  background: #22c55e;
}

/* Typing Indicator Animation */
.typing-dots {
  display: inline-block;
  animation: typingPulse 1.4s infinite;
}

@keyframes typingPulse {

  0%,
  20% {
    opacity: 0.3;
  }

  50% {
    opacity: 1;
  }

  80%,
  100% {
    opacity: 0.3;
  }
}

.chatBubble.system {
  background: rgba(255, 255, 255, 0.05);
  align-self: center;
  font-style: italic;
  border: 1px dashed var(--border);
}

/* Message Row Layout */
.msgRow {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.msgRow.me {
  flex-direction: row-reverse;
}

.msgAvatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.msgRow .chatBubble {
  position: relative;
  max-width: 70%;
}

/* Message Actions */
.msgActions {
  position: absolute;
  top: 5px;
  right: auto;
  left: 5px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.msgRow.me .msgActions {
  left: auto;
  right: 5px;
}

.msgRow:hover .msgActions {
  opacity: 1;
}

.msgActionBtn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.msgActionBtn:hover {
  background: var(--primary);
  transform: scale(1.1);
}

.msgActions .menuDropdown {
  top: 32px;
  left: 0;
  right: auto;
  min-width: 120px;
}

.msgRow.me .menuDropdown {
  left: auto;
  right: 0;
}

/* Reply Preview */
.replyPreview {
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--primary);
  padding: 6px 10px;
  margin-bottom: 8px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--muted);
}

.chatBubble.me .replyPreview {
  border-left-color: rgba(255, 255, 255, 0.5);
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.loader {
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}