:root {
  --bg-primary: #0e1621;
  --bg-secondary: #17212b;
  --bg-hover: #202b36;
  --bg-active: #2b5278;
  --text-primary: #ffffff;
  --text-secondary: #708499;
  --text-muted: #647587;
  --accent-color: #2481cc;
  --accent-hover: #2993e3;
  --bubble-in: #182533;
  --bubble-out: #2b5278;
  --bubble-in-border: #1f2f3f;
  --danger-color: #e53935;
  --success-color: #4fae4e;
  --border-color: #0e1621;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  user-select: none;
}

.app-container {
  width: 100%;
  height: 100%;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* --- AUTH OVERLAY --- */
.auth-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background-color: var(--bg-secondary);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  text-align: center;
}

.logo-img {
  width: 72px;
  height: 72px;
  margin-bottom: 12px;
  border-radius: 18px;
}

.auth-logo h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-logo p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.form-group {
  text-align: left;
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  background-color: var(--bg-primary);
  border: 1px solid #242f3d;
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--accent-color);
}

.btn {
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--accent-color);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
}

.btn-block {
  width: 100%;
}

.auth-error {
  color: #ff6b6b;
  font-size: 13px;
  margin-bottom: 14px;
  text-align: left;
}

.auth-toggle {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-toggle a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
}

/* --- MESSENGER LAYOUT --- */
.messenger-layout {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
}

/* SIDEBAR */
.sidebar {
  width: 380px;
  height: 100%;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
  padding-top: var(--safe-top);
  flex-shrink: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  background-color: var(--bg-primary);
  border-radius: 20px;
  padding: 0 12px;
  height: 38px;
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  margin-right: 8px;
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  outline: none;
}

.clear-search-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
  flex-shrink: 0;
}

.icon-btn:hover {
  background-color: var(--bg-hover);
  color: #fff;
}

.svg-icon {
  width: 22px;
  height: 22px;
}

.chat-list-container {
  flex: 1;
  overflow-y: auto;
}

.chat-list-container::-webkit-scrollbar {
  width: 5px;
}

.chat-list-container::-webkit-scrollbar-thumb {
  background-color: rgba(255,255,255,0.15);
  border-radius: 4px;
}

/* Chat Item */
.chat-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  transition: background-color 0.15s;
  position: relative;
  border-radius: 10px;
  margin: 2px 6px;
}

.chat-item:hover {
  background-color: var(--bg-hover);
}

.chat-item.active {
  background-color: var(--bg-active);
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  background-color: #2481cc;
  position: relative;
}

.avatar.online::after {
  content: '';
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  background-color: var(--success-color);
  border: 2px solid var(--bg-secondary);
  border-radius: 50%;
}

.chat-info {
  flex: 1;
  margin-left: 12px;
  min-width: 0;
}

.chat-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.chat-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.chat-time {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 6px;
}

.chat-row-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-snippet {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unread-badge {
  background-color: var(--accent-color);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
  padding: 2px 7px;
  flex-shrink: 0;
  margin-left: 6px;
}

.fab-btn {
  position: absolute;
  bottom: calc(20px + var(--safe-bottom));
  right: 20px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background-color 0.2s;
  z-index: 20;
}

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

/* CHAT AREA */
.chat-area {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg-primary);
  background-image: radial-gradient(rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 24px 24px;
}

.empty-chat-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-bubble {
  background-color: rgba(23, 33, 43, 0.7);
  padding: 24px 32px;
  border-radius: 20px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.placeholder-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
}

.placeholder-bubble h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.placeholder-bubble p {
  font-size: 13px;
  color: var(--text-secondary);
}

.active-chat-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
}

/* Chat Header */
.chat-header {
  height: 56px;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-color);
  padding-top: var(--safe-top);
  flex-shrink: 0;
  z-index: 5;
}

.back-btn {
  display: none;
  margin-right: 8px;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  font-size: 15px;
}

.chat-header-info {
  flex: 1;
  margin-left: 12px;
}

.chat-header-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-header-status {
  font-size: 12px;
  color: var(--text-secondary);
}

.chat-header-status.online {
  color: var(--accent-color);
}

.chat-header-actions {
  display: flex;
  gap: 4px;
}

/* Messages Stream */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column-reverse;
}

.messages-container::-webkit-scrollbar {
  width: 5px;
}

.messages-container::-webkit-scrollbar-thumb {
  background-color: rgba(255,255,255,0.12);
  border-radius: 4px;
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

/* Message Bubble */
.msg-row {
  display: flex;
  width: 100%;
}

.msg-row.out {
  justify-content: flex-end;
}

.msg-row.in {
  justify-content: flex-start;
}

.msg-bubble {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 14px;
  position: relative;
  word-break: break-word;
  user-select: text;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  font-size: 15px;
  line-height: 1.35;
}

.msg-row.out .msg-bubble {
  background-color: var(--bubble-out);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-row.in .msg-bubble {
  background-color: var(--bubble-in);
  color: #fff;
  border-bottom-left-radius: 4px;
}

.msg-meta {
  display: inline-flex;
  align-items: center;
  float: right;
  margin-left: 10px;
  margin-top: 4px;
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  user-select: none;
}

/* Circular Video Note */
.round-video-wrapper {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  background-color: #000;
  position: relative;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.2);
}

.round-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Voice Message */
.voice-msg-player {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  padding: 4px 0;
}

.play-voice-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--accent-color);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.voice-waveform-track {
  flex: 1;
  height: 4px;
  background-color: rgba(255,255,255,0.2);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

.voice-waveform-fill {
  height: 100%;
  background-color: #fff;
  border-radius: 2px;
  width: 0%;
}

.voice-duration {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}

/* Media attachments */
.msg-photo-thumb {
  max-width: 100%;
  max-height: 320px;
  border-radius: 10px;
  cursor: pointer;
  display: block;
}

.msg-file-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: rgba(0,0,0,0.15);
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #fff;
}

/* Input Bar */
.chat-input-bar {
  display: flex;
  align-items: flex-end;
  padding: 10px 14px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding-bottom: calc(10px + var(--safe-bottom));
  gap: 8px;
  flex-shrink: 0;
}

.message-input-wrapper {
  flex: 1;
  background-color: var(--bg-primary);
  border-radius: 20px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
}

.message-input-wrapper textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 15px;
  resize: none;
  max-height: 120px;
  line-height: 20px;
  font-family: var(--font-family);
}

.send-action-btn {
  background-color: var(--accent-color);
  color: #fff;
  width: 44px;
  height: 44px;
}

.send-action-btn:hover {
  background-color: var(--accent-hover);
  color: #fff;
}

/* Recording State */
.recording-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
}

.rec-dot {
  width: 10px;
  height: 10px;
  background-color: #ff3b30;
  border-radius: 50%;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

.btn-cancel-rec {
  background: transparent;
  border: none;
  color: var(--danger-color);
  cursor: pointer;
  font-weight: bold;
}

/* DRAWER */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,0.5);
  z-index: 100;
  display: flex;
}

.drawer-content {
  width: 300px;
  height: 100%;
  background-color: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  padding: 20px;
  padding-top: calc(20px + var(--safe-top));
}

.drawer-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.drawer-avatar {
  width: 56px;
  height: 56px;
  font-size: 20px;
}

.drawer-user-info h4 {
  font-size: 16px;
  font-weight: 600;
}

.drawer-user-info p {
  font-size: 13px;
  color: var(--text-secondary);
}

.drawer-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

.drawer-item:hover {
  background-color: var(--bg-hover);
}

.text-danger {
  color: #ff6b6b;
}

/* CALL OVERLAY */
.call-overlay {
  position: fixed;
  inset: 0;
  background-color: #080c10;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.call-modal.incoming {
  padding: 30px;
}

.call-avatar-pulse {
  position: relative;
  margin-bottom: 20px;
}

.call-avatar-pulse::after {
  content: '';
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  border: 2px solid var(--accent-color);
  animation: pulse 1.5s infinite;
}

.call-avatar {
  width: 100px;
  height: 100px;
  font-size: 36px;
}

.incoming-actions {
  display: flex;
  gap: 40px;
  margin-top: 30px;
}

.call-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: transform 0.15s;
}

.call-btn:active {
  transform: scale(0.92);
}

.btn-accept {
  background-color: #34c759;
}

.btn-decline {
  background-color: #ff3b30;
}

/* ACTIVE CALL */
.call-modal.active-call {
  width: 100%;
  height: 100%;
  position: relative;
  background-color: #000;
}

.video-streams-box {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remote-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.local-video-pip {
  position: absolute;
  top: calc(20px + var(--safe-top));
  right: 20px;
  width: 110px;
  height: 150px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.4);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  z-index: 10;
}

.audio-radar {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  z-index: 2;
}

.call-avatar-lg {
  width: 110px;
  height: 110px;
  font-size: 40px;
  margin-bottom: 16px;
}

.active-call-controls {
  position: absolute;
  bottom: calc(30px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  z-index: 20;
}

.call-control-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background-color: rgba(255,255,255,0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.call-control-btn.active {
  background-color: #fff;
  color: #000;
}

/* LIGHTBOX */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 20px;
}

.lightbox-overlay img {
  max-width: 95%;
  max-height: 95%;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

/* RESPONSIVE MOBILE VIEW (PWA & iOS) */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
  }

  .chat-area {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 30;
  }

  .messenger-layout.chat-open .sidebar {
    display: none;
  }

  .messenger-layout.chat-open .chat-area {
    display: flex;
  }

  .back-btn {
    display: flex;
  }

  .msg-bubble {
    max-width: 86%;
  }
}

/* === TELEGRAM CIRCULAR VIDEO NOTES & ADVANCED CALL UI === */

/* Round Video in Chat */
.round-video-wrapper {
  width: 205px;
  height: 205px;
  border-radius: 50%;
  overflow: hidden;
  background-color: #0c141d;
  position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  cursor: pointer;
  border: 2.5px solid rgba(42, 171, 238, 0.4);
  transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), height 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  user-select: none;
  -webkit-user-select: none;
}

.round-video-wrapper.expanded {
  width: 275px;
  height: 275px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7);
  border-color: var(--accent-color);
}

.round-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.round-video-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: rotate(-90deg);
}

.round-video-ring circle {
  fill: none;
  stroke: var(--accent-color);
  stroke-width: 3.5;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear;
}

.round-video-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,0.65);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  backdrop-filter: blur(4px);
  pointer-events: none;
  transition: transform 0.2s;
}

.round-video-wrapper:hover .round-video-badge {
  transform: scale(1.1);
}

/* Circular Video Note Recorder Modal */
.video-note-record-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.video-note-record-circle {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
  border: 3px solid #2aabee;
  background: #000;
}

.video-note-record-circle video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror selfie camera */
}

.record-progress-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: rotate(-90deg);
}

.record-progress-ring .ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 4;
}

.record-progress-ring .ring-bar {
  fill: none;
  stroke: #ff3b30;
  stroke-width: 5;
  stroke-dasharray: 780;
  stroke-dashoffset: 780;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.2s linear;
}

.video-note-timer {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
}

.video-note-actions {
  display: flex;
  gap: 32px;
  margin-top: 36px;
}

.btn-circle-action {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, background-color 0.2s;
  color: #fff;
}

.btn-circle-action:active {
  transform: scale(0.92);
}

.btn-trash {
  background-color: #ff3b30;
}

.btn-send-note {
  background-color: #2aabee;
}

/* Call Radar Waves */
.radar-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--accent-color);
  animation: radar-ripple 2.4s infinite cubic-bezier(0.2, 0.8, 0.4, 1);
  pointer-events: none;
}
.radar-ring:nth-child(1) { width: 130px; height: 130px; animation-delay: 0s; }
.radar-ring:nth-child(2) { width: 130px; height: 130px; animation-delay: 0.8s; }
.radar-ring:nth-child(3) { width: 130px; height: 130px; animation-delay: 1.6s; }

@keyframes radar-ripple {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.4); opacity: 0; }
}

.call-control-btn.btn-muted {
  background-color: #ff3b30 !important;
  color: #fff !important;
}

.call-control-btn.btn-video-off {
  background-color: rgba(255, 255, 255, 0.15) !important;
  opacity: 0.6;
}

/* === TELEGRAM VOICE RECORDING BAR & GESTURES === */
.voice-record-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 52px;
  background-color: var(--bg-secondary);
  border-radius: 26px;
  padding: 0 10px;
  position: relative;
  overflow: hidden;
}

.voice-trash-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background-color: transparent;
  color: #ff3b30;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.voice-record-center {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  margin-left: 6px;
}

.voice-record-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #ff3b30;
  animation: pulseDot 1s infinite alternate;
  flex-shrink: 0;
}

@keyframes pulseDot {
  0% { transform: scale(0.85); opacity: 0.4; }
  100% { transform: scale(1.2); opacity: 1; }
}

.voice-record-timer {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  min-width: 44px;
}

.voice-live-waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  flex: 1;
  max-width: 130px;
}

.waveform-bar {
  width: 3px;
  height: 4px;
  min-height: 4px;
  max-height: 24px;
  background-color: var(--accent-color);
  border-radius: 2px;
  transition: height 0.08s ease;
}

.voice-slide-cancel {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  animation: slideHint 1.5s infinite ease-in-out;
  padding: 0 8px;
}

@keyframes slideHint {
  0%, 100% { transform: translateX(0); opacity: 0.8; }
  50% { transform: translateX(-6px); opacity: 1; }
}

.voice-bar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.voice-bar-btn:active {
  transform: scale(0.92);
}

.voice-pause-btn {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  margin-right: 6px;
}

.voice-send-btn {
  background-color: var(--accent-color);
}

/* Floating Lock Pill */
.recording-lock-pill {
  position: absolute;
  bottom: 74px;
  right: 14px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  color: var(--accent-color);
  font-size: 11px;
  font-weight: 600;
  z-index: 100;
  animation: bouncePill 1.2s infinite ease-in-out;
  pointer-events: none;
}

@keyframes bouncePill {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.recording-lock-pill svg {
  width: 18px;
  height: 18px;
}

.btn-flip {
  background-color: rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(8px);
}
