/* ============================================================
   Quantum Atman — Итальянская тема "Sole e Anima" (Flat)
   ============================================================ */

:root {
  --terracotta: #c96f4a;
  --terracotta-dark: #b05e3a;
  --terracotta-light: #e8a87c;
  --golden-ochre: #e3b23c;
  --gold: #f5d04c;
  --olive: #8a9b6f;
  --turkish-blue: #4a8c8c;
  --cream: #fdf6e3;
  --cream-dark: #e8dcc8;
  --orange: #f28c28;
  --orange-dark: #d97a1e;
  --pink: #e6808a;
  --pink-dark: #d16670;
  --bg-dark: #1e1a17;
  --bg-card: rgba(253, 246, 227, 0.05);
  --text-light: #fdf6e3;
  --text-muted: #c8bca8;
  --shadow-macos-soft: 0 10px 30px -10px rgba(0,0,0,0.4);
  --shadow-macos-medium: 0 20px 50px -15px rgba(0,0,0,0.3);
  --shadow-macos-heavy: 0 30px 60px -20px rgba(0,0,0,0.5);
  --shadow-macos-hover: 0 25px 50px -12px rgba(0,0,0,0.5);
  --header-height: 70px;
  --footer-height: 70px;
}

body {
  background: var(--bg-dark);
  color: var(--text-light);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  scroll-behavior: smooth;
  min-height: 100vh;
  padding-top: var(--header-height);
  padding-bottom: var(--footer-height);
}

@media (max-width: 576px) {
  body {
    --header-height: 60px;
    --footer-height: 60px;
    padding-top: var(--header-height);
    padding-bottom: var(--footer-height);
  }
}

a {
  color: var(--orange);
  transition: color 0.2s, text-shadow 0.2s;
}

a:hover {
  color: var(--pink);
  text-shadow: 0 0 12px rgba(230, 128, 138, 0.3);
  text-decoration: none;
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(253, 246, 227, 0.08);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-macos-soft), var(--shadow-macos-medium);
  transition: transform 0.25s ease, box-shadow 0.35s ease;
}

.glass-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-macos-hover), var(--shadow-macos-medium);
  border-color: rgba(242, 140, 40, 0.15);
}

.btn-primary-gradient {
  background: var(--orange);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 0.6rem 1.8rem;
  border-radius: 50px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(242, 140, 40, 0.35);
}

.btn-primary-gradient:hover {
  background: var(--orange-dark);
  transform: scale(1.03);
  box-shadow: 0 8px 25px rgba(242, 140, 40, 0.45);
  color: #fff;
}

.btn-primary-gradient:disabled {
  opacity: 0.5;
  transform: none;
  cursor: not-allowed;
}

.btn-outline-light {
  color: var(--cream);
  border-color: rgba(253, 246, 227, 0.25);
}

.btn-outline-light:hover {
  background: rgba(253, 246, 227, 0.08);
  color: var(--pink);
  border-color: var(--pink);
  box-shadow: 0 4px 14px rgba(230, 128, 138, 0.15);
}

.btn-outline-danger {
  color: #e07a5f;
  border-color: #e07a5f;
}

.btn-outline-danger:hover {
  background: #e07a5f;
  color: #1e1a17;
  box-shadow: 0 4px 14px rgba(224, 122, 95, 0.3);
}

.btn-outline-info {
  color: var(--turkish-blue);
  border-color: var(--turkish-blue);
}

.btn-outline-info:hover {
  background: var(--turkish-blue);
  color: #fff;
  box-shadow: 0 4px 14px rgba(74, 140, 140, 0.3);
}

.table-dark {
  --bs-table-bg: rgba(0, 0, 0, 0.25);
  --bs-table-border-color: rgba(253, 246, 227, 0.06);
}

.table-dark th {
  border-bottom: 2px solid var(--orange);
  font-weight: 600;
  color: var(--orange);
}

.table-dark td {
  vertical-align: middle;
  color: var(--text-light);
}

.form-control {
  background-color: rgba(0, 0, 0, 0.35) !important;
  border: 1px solid rgba(253, 246, 227, 0.12) !important;
  color: var(--text-light) !important;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.form-control:focus {
  border-color: var(--orange) !important;
  box-shadow: 0 0 0 0.2rem rgba(242, 140, 40, 0.25), inset 0 2px 4px rgba(0,0,0,0.2) !important;
}

.form-control::placeholder {
  color: var(--text-muted) !important;
}

.breadcrumb {
  background: transparent;
  padding: 0.75rem 0;
}

.breadcrumb-item a {
  color: var(--orange);
}

.breadcrumb-item a:hover {
  color: var(--pink);
}

.breadcrumb-item.active {
  color: var(--text-light);
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--text-muted);
}

.list-group-item-action {
  background-color: rgba(253, 246, 227, 0.02) !important;
  border-color: rgba(253, 246, 227, 0.05) !important;
  color: var(--text-light) !important;
  transition: background 0.2s, box-shadow 0.2s;
}

.list-group-item-action:hover {
  background-color: rgba(253, 246, 227, 0.06) !important;
  box-shadow: var(--shadow-macos-soft);
}

.list-group-item-action .badge {
  background-color: var(--olive);
  color: #1e1a17;
}

audio,
  video {
  border-radius: 0.75rem;
  background: #0a0e18;
  border: 1px solid rgba(253, 246, 227, 0.06);
  box-shadow: var(--shadow-macos-soft);
}

@keyframes pulseGlow {
  0% {
    text-shadow: 0 0 20px rgba(242, 140, 40, 0.15);
  }

  100% {
    text-shadow: 0 0 50px rgba(230, 128, 138, 0.4);
  }
}

.pulse-glow {
  animation: pulseGlow 3s infinite alternate;
}

@keyframes floatParticle {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 0.15;
  }

  50% {
    transform: translateY(-30px) scale(1.2) rotate(8deg);
    opacity: 0.4;
  }

  100% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 0.15;
  }
}

.particle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  background: var(--orange);
  opacity: 0.10;
  z-index: -1;
  animation: floatParticle 6s infinite ease-in-out;
}

@media (max-width: 991.98px) {
  .mobile-sticky-fix {
    position: relative !important;
    top: auto !important;
    z-index: auto !important;
  }
}

@media (max-width: 768px) {
  .glass-card {
    border-radius: 1rem;
    padding: 1rem;
  }

  h1 {
    font-size: 2.2rem;
  }
}

  /* ============================================================
     СТИЛИ ДЛЯ ЧАТА (ФИНАЛЬНАЯ ВЕРСИЯ)
     ============================================================ */

.chat-container {
  height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 1rem;
  border: 1px solid rgba(253, 246, 227, 0.05);
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.3);
}

.chat-message {
  max-width: 75%;
  padding: 0.6rem 1.2rem;
  margin-bottom: 0.5rem;
  border-radius: 1.5rem;
  word-wrap: break-word;
  animation: fadeInUp 0.3s ease;
  position: relative;
}

.chat-message.sent {
  align-self: flex-end;
  background: var(--orange) !important;
  color: #fff !important;
  border-bottom-right-radius: 0.2rem;
  box-shadow: 0 4px 12px rgba(242, 140, 40, 0.25);
}

.chat-message.received {
  align-self: flex-start;
  background: #2a2a35 !important;
  color: #e8e8f0 !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-bottom-left-radius: 0.2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.chat-message .sender {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold) !important;
  opacity: 1 !important;
  margin-bottom: 0.2rem;
  letter-spacing: 0.3px;
}

.chat-message .time {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: #b0bcc8 !important;
  opacity: 0.9 !important;
  margin-top: 0.15rem;
  letter-spacing: 0.2px;
}

.chat-message.sent .time {
  color: #d0e4f0 !important;
}

  /* Кнопка удаления */
.chat-message .delete-btn {
  position: absolute !important;
  top: 4px !important;
  right: 4px !important;
  opacity: 0.7 !important;
  background: rgba(0, 0, 0, 0.5) !important;
  border: none !important;
  color: #ff6b6b !important;
  border-radius: 50% !important;
  width: 24px !important;
  height: 24px !important;
  line-height: 24px !important;
  text-align: center !important;
  font-size: 14px !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: opacity 0.2s, background 0.2s;
  z-index: 5;
}

.chat-message .delete-btn:hover {
  opacity: 1 !important;
  background: rgba(255, 0, 0, 0.7) !important;
}

.chat-message.received .delete-btn {
  display: none !important;
}

@media (max-width: 576px) {
  .chat-message .delete-btn {
    width: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
    font-size: 16px !important;
    top: 2px !important;
    right: 2px !important;
    opacity: 0.9 !important;
  }
}

  /* Вложения */
.chat-attachment {
  margin-top: 0.3rem;
  max-width: 100%;
  cursor: pointer;
}

.chat-attachment img,
  .chat-attachment video {
  max-width: 100%;
  max-height: 200px;
  border-radius: 0.5rem;
  object-fit: cover;
}

.chat-attachment audio {
  width: 100%;
}

.chat-attachment a {
  color: #00c6ff;
  text-decoration: none;
}

.chat-attachment a:hover {
  color: #ffd700;
}

.chat-attachment .chat-attachment-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.chat-attachment .chat-attachment-preview .file-icon {
  font-size: 2rem;
}

.chat-attachment .chat-attachment-preview .file-name {
  font-size: 0.85rem;
  color: #b0bcc8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

  /* Палитра эмодзи */
#emoji-picker {
  display: none;
  flex-wrap: wrap;
  max-height: 200px;
  overflow-y: auto;
  background: #2a2a35;
  border-radius: 0.5rem;
  padding: 0.5rem;
  margin-top: 0.5rem;
  width: 100%;
  gap: 0.2rem;
}

#emoji-picker .btn {
  font-size: 1.2rem;
  padding: 0.2rem 0.4rem;
  margin: 0.1rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.3rem;
  cursor: pointer;
  transition: background 0.2s;
}

#emoji-picker .btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.typing-indicator {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: rgba(253, 246, 227, 0.04);
  border-radius: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.typing-indicator span {
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  background: var(--orange);
  border-radius: 50%;
  margin: 0 0.1rem;
  animation: typingBounce 1.2s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }

  30% {
    transform: translateY(-6px);
  }
}

.text-light-emphasis {
  color: var(--text-light) !important;
}

.lead {
  color: var(--text-light) !important;
}

.small,
  small {
  color: var(--text-muted) !important;
}

.glass-card p,
  .glass-card .small {
  color: var(--text-light) !important;
}

.list-group-item {
  color: var(--text-light) !important;
}

.navbar {
  border-bottom: 2px solid var(--orange) !important;
  background: rgba(30, 26, 23, 0.85) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.navbar .navbar-brand {
  color: var(--orange) !important;
}

.nav-link {
  color: var(--text-light) !important;
  padding: 0.5rem 1rem !important;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--gold) !important;
  background: rgba(253, 246, 227, 0.05);
  border-radius: 0.5rem;
}

.nav-link.active {
  color: var(--orange) !important;
  background: rgba(242, 140, 40, 0.1);
  border-radius: 0.5rem;
}

footer {
  border-top: 2px solid var(--orange) !important;
  background: rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.navbar-brand img.logo-animated {
  animation: logoGlow 3s ease-in-out infinite, logoFloat 4s ease-in-out infinite, logoPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(255, 111, 0, 0.6));
  transition: filter 0.3s ease, transform 0.3s ease;
}

.navbar-brand img.logo-animated:hover {
  filter: drop-shadow(0 0 40px rgba(255, 215, 0, 0.9));
  transform: scale(1.08);
}

@keyframes logoGlow {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(255, 111, 0, 0.6));
  }

  50% {
    filter: drop-shadow(0 0 50px rgba(255, 215, 0, 0.9));
  }
}

@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes logoPulse {
  0%, 100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }
}

.navbar-brand img {
  width: 44px;
  height: 44px;
  transition: all 0.2s ease;
}

.navbar-brand .brand-text {
  font-size: 1.2rem;
}

@media (max-width: 576px) {
  .navbar-brand img {
    width: 32px !important;
    height: 32px !important;
  }

  .navbar-brand .brand-text {
    font-size: 1rem;
  }

  body {
    padding-top: 60px !important;
    padding-bottom: 60px !important;
  }

  .btn {
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
  }

  .btn-sm {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
  }

  .btn-md {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
  }

  .glass-card {
    padding: 0.75rem !important;
  }

  h1 {
    font-size: 1.8rem !important;
  }

  h2 {
    font-size: 1.4rem !important;
  }

  h5 {
    font-size: 1rem !important;
  }

  .lead {
    font-size: 1rem !important;
  }

  .display-4 {
    font-size: 2.5rem !important;
  }

  .display-5 {
    font-size: 2rem !important;
  }

  .display-6 {
    font-size: 1.6rem !important;
  }

  .breadcrumb {
    font-size: 0.8rem;
  }

  .list-group-item {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
  }

  .chat-message {
    padding: 0.3rem 0.8rem;
    font-size: 0.9rem;
  }

  .chat-message .sender {
    font-size: 0.7rem !important;
  }

  .chat-message .time {
    font-size: 0.6rem !important;
  }

  .form-control {
    font-size: 0.85rem;
  }

  .table {
    font-size: 0.8rem;
  }

  #chat-messages {
    max-height: 50vh !important;
  }

  .chat-wrapper {
    min-height: calc(100vh - 120px) !important;
  }
}

@media (min-width: 577px) and (max-width: 768px) {
  body {
    padding-top: 65px !important;
    padding-bottom: 65px !important;
  }

  .navbar-brand img {
    width: 38px !important;
    height: 38px !important;
  }
}

@media (min-width: 769px) {
  body {
    padding-top: 70px !important;
    padding-bottom: 70px !important;
  }
}

  /* ============================================================
     МОДАЛЬНОЕ ОКНО ДЛЯ ПРОСМОТРА ВЛОЖЕНИЙ (ФИНАЛЬНАЯ ВЕРСИЯ)
     ============================================================ */

.media-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.media-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.media-modal-content {
  position: relative;
  max-width: 95%;
  max-height: 95%;
  background: #1a1a24;
  border-radius: 1rem;
  padding: 1.5rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.media-modal-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
}

.media-modal-title {
  flex: 1;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  padding-right: 1rem;
  color: #e0e8f0;
}

.media-modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 1.8rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.media-modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.media-modal-body {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 80vh;
  overflow: hidden;
}

.media-modal-body img,
  .media-modal-body video {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

  /* ---------- УЛУЧШЕННЫЙ АУДИО-ПЛЕЕР (контрастный, с перемоткой кликом) ---------- */
.media-modal-body audio {
  width: 100%;
  max-width: 700px;
  margin: 1.5rem auto;
  display: block;
  border-radius: 0.75rem;
  background: #0a0e18;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  padding: 0.5rem 0;
}

  /* ----- Стили для WebKit-браузеров (Chrome, Edge, Safari) ----- */
.media-modal-body audio::-webkit-media-controls-panel {
  background-color: #1e1a17 !important;
  border-radius: 0.5rem;
}

  /* Шкала прогресса (трек) */
.media-modal-body audio::-webkit-media-controls-timeline {
  background-color: #3a3a45 !important;
  border-radius: 4px;
  height: 6px;
  margin: 0 8px;
}

  /* Заполненная часть прогресса */
.media-modal-body audio::-webkit-media-controls-timeline::-webkit-media-controls-timeline-progress {
  background-color: var(--orange) !important;
  border-radius: 4px;
}

  /* Ползунок (ручка) */
.media-modal-body audio::-webkit-media-controls-timeline::-webkit-slider-thumb {
  background-color: var(--gold) !important;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  box-shadow: 0 0 8px rgba(242, 140, 40, 0.6);
  cursor: pointer;
}

  /* Кнопка Play/Pause */
.media-modal-body audio::-webkit-media-controls-play-button {
  background-color: var(--orange) !important;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: #fff !important;
  margin: 0 6px;
}

.media-modal-body audio::-webkit-media-controls-play-button:hover {
  background-color: var(--orange-dark) !important;
  transform: scale(1.05);
}

  /* Текст времени */
.media-modal-body audio::-webkit-media-controls-current-time-display,
  .media-modal-body audio::-webkit-media-controls-time-remaining-display {
  color: #f0f0f8 !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0 4px;
}

  /* Кнопка громкости */
.media-modal-body audio::-webkit-media-controls-mute-button {
  filter: brightness(1.2);
}

  /* Ползунок громкости */
.media-modal-body audio::-webkit-media-controls-volume-slider {
  background-color: #3a3a45 !important;
  border-radius: 4px;
  height: 6px;
}

.media-modal-body audio::-webkit-media-controls-volume-slider::-webkit-slider-thumb {
  background-color: var(--gold) !important;
  border-radius: 50%;
  width: 12px;
  height: 12px;
}

  /* ----- Стили для Firefox ----- */
.media-modal-body audio::-moz-range-track {
  background-color: #3a3a45;
  border-radius: 4px;
  height: 6px;
}

.media-modal-body audio::-moz-range-progress {
  background-color: var(--orange);
  border-radius: 4px;
  height: 6px;
}

.media-modal-body audio::-moz-range-thumb {
  background-color: var(--gold);
  border: none;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  box-shadow: 0 0 8px rgba(242, 140, 40, 0.6);
  cursor: pointer;
}

  /* Адаптив для маленьких экранов */
@media (max-width: 576px) {
  .media-modal-body audio {
    max-width: 100%;
    margin: 1rem auto;
    padding: 0.3rem 0;
  }

  .media-modal-body audio::-webkit-media-controls-play-button {
    width: 30px;
    height: 30px;
  }

  .media-modal-body audio::-webkit-media-controls-timeline {
    height: 5px;
  }

  .media-modal-body audio::-webkit-media-controls-timeline::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
  }

  .media-modal-content {
    padding: 0.8rem;
    border-radius: 0.5rem;
    max-width: 98%;
    max-height: 98%;
  }

  .media-modal-close {
    font-size: 1.5rem;
    width: 34px;
    height: 34px;
  }

  .media-modal-title {
    font-size: 0.9rem;
  }

  .media-modal-body img,
    .media-modal-body video {
    max-height: 60vh;
  }
}

/* ============================================================
   КАСТОМНЫЙ АУДИО-ПЛЕЕР (дополнительные стили)
   ============================================================ */

.custom-audio-player {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 0.5rem 0;
  background: #1e1a17;
  border-radius: 0.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.custom-audio-player .audio-controls {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.custom-audio-player .play-btn {
  background: var(--orange);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.custom-audio-player .play-btn:hover {
  background: var(--orange-dark);
  transform: scale(1.05);
}

.custom-audio-player .progress-bar {
  flex: 1;
  position: relative;
  height: 6px;
  background: #3a3a45;
  border-radius: 3px;
  cursor: pointer;
  min-width: 100px;
}

.custom-audio-player .progress-fill {
  width: 0%;
  height: 100%;
  background: var(--orange);
  border-radius: 3px;
  transition: width 0.1s linear;
}

.custom-audio-player .time-display {
  color: #f0f0f8;
  font-size: 0.85rem;
  font-weight: 500;
  min-width: 80px;
  text-align: center;
  flex-shrink: 0;
}

@media (max-width: 576px) {
  .custom-audio-player .play-btn {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .custom-audio-player .audio-controls {
    padding: 0.3rem 0.6rem;
    gap: 0.5rem;
  }

  .custom-audio-player .time-display {
    font-size: 0.75rem;
    min-width: 70px;
  }

  .custom-audio-player .progress-bar {
    height: 5px;
  }
}


/* ============================================================
   Стили для Plyr (адаптация под тёмную тему)
   ============================================================ */

.plyr__control {
  background: transparent !important;
}

.plyr__control--overlaid {
  background: var(--orange) !important;
  border-radius: 50% !important;
}

.plyr__control--overlaid:hover {
  background: var(--orange-dark) !important;
}

.plyr--audio .plyr__progress__buffer {
  background: #3a3a45 !important;
}

.plyr--audio .plyr__progress__played {
  background: var(--orange) !important;
}

.plyr__progress__played {
  background: var(--orange) !important;
}

.plyr__volume input[type=range]::-webkit-slider-runnable-track {
  background: #3a3a45 !important;
}

.plyr__volume input[type=range]::-webkit-slider-thumb {
  background: var(--gold) !important;
}

.plyr--audio .plyr__controls {
  background: #1e1a17 !important;
  border-radius: 0.75rem;
  padding: 0.5rem 1rem;
}

.plyr__controls button {
  color: #f0f0f8 !important;
}

.plyr__time {
  color: #f0f0f8 !important;
  font-weight: 500;
}

  /* Адаптив */
@media (max-width: 576px) {
  .plyr__controls {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .plyr__control {
    padding: 0.25rem !important;
  }
}

/* ============================================================
   МОДАЛЬНОЕ ОКНО ДЛЯ ЭМОДЗИ (добавить в конец custom.css)
   ============================================================ */

.emoji-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
}

.emoji-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.emoji-modal-content {
  position: relative;
  max-width: 600px;
  width: 95%;
  max-height: 80vh;
  background: #1a1a24;
  border-radius: 1rem;
  padding: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.emoji-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
}

.emoji-modal-title {
  flex: 1;
  color: #e0e8f0;
}

.emoji-modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 1.8rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.emoji-modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.emoji-picker-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
  max-height: 50vh;
  overflow-y: auto;
  padding: 0.5rem;
}

.emoji-picker-grid .btn {
  font-size: 1.5rem;
  padding: 0.4rem 0.6rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.4rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.emoji-picker-grid .btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

@media (max-width: 576px) {
  .emoji-modal-content {
    max-width: 95%;
    padding: 1rem;
  }

  .emoji-modal-header {
    font-size: 0.9rem;
  }

  .emoji-modal-close {
    width: 32px;
    height: 32px;
    font-size: 1.5rem;
  }

  .emoji-picker-grid .btn {
    font-size: 1.2rem;
    padding: 0.3rem 0.4rem;
  }
}

/* ============================================================
   РАЗДЕЛИТЕЛИ СООБЩЕНИЙ ПО ДНЯМ
   ============================================================ */

.chat-date-divider {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
  position: relative;
}

.chat-date-divider span {
  background: rgba(30, 26, 23, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f0f0f8;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 2rem;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 30px rgba(242, 140, 40, 0.05);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

@media (max-width: 576px) {
  .chat-date-divider span {
    font-size: 0.7rem;
    padding: 0.2rem 0.8rem;
  }
}

/* ============================================================
   СТИЛЬ ДЛЯ ИМЕНИ ПОЛЬЗОВАТЕЛЯ В НАВИГАЦИИ
   ============================================================ */

.navbar .user-name {
  color: var(--orange) !important;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* При наведении на ссылку с именем пользователя, чтобы подсвечивалось */
.navbar .nav-link:hover .user-name {
  color: var(--gold) !important;
  text-shadow: 0 0 12px rgba(242, 140, 40, 0.3);
}

/* ============================================================
   ИСПРАВЛЕНИЕ: отступ для имени отправителя (кнопка удаления)
   ============================================================ */

.chat-message.sent .sender {
  margin-right: 30px;
}

@media (max-width: 576px) {
  .chat-message.sent .sender {
    margin-right: 35px;
  }
}

/* ============================================================
   Ссылки внутри текста сообщений чата (linkify)
   ============================================================ */

.chat-message .message-text a {
  color: #ffe38a;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
  transition: color 0.15s, text-shadow 0.15s;
}

.chat-message .message-text a:hover {
  color: #fff;
  text-shadow: 0 0 8px rgba(255, 227, 138, 0.6);
}

.chat-message.received .message-text a {
  color: #7fd8ff;
}

.chat-message.received .message-text a:hover {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(127, 216, 255, 0.6);
}