/* ========================================
   CHAT MEDIA - Your original audio/file styles (EXACT COPY)
   ======================================== */

/* ========================================
     AUDIO PLAYER STYLES
     ======================================== */

/* Audio player positioned below chat header inside active-chat */
.persistent-audio-player {
  position: relative; /* Relative positioning within active-chat container */
  width: 100%;
  background: #1a1a1a; /* Dark theme background */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Dark theme border */
  z-index: 1009;
  padding: 8px 12px;
  display: none;
  height: 50px;
  transform: translateY(-100%);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  box-sizing: border-box;
}

.persistent-audio-player.active {
  transform: translateY(0);
  opacity: 1;
  display: block;
}

.audio-player-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 100%;
}

.audio-player-controls {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.audio-player-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1); /* Dark theme button background */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff; /* White icon color */
  margin-right: 12px;
  flex-shrink: 0;
  transition: background-color 0.2s;
}

.audio-player-btn:hover {
  background: rgba(255, 255, 255, 0.2); /* Hover effect */
}

.audio-player-progress-container {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  margin-right: 10px;
}

.audio-player-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  max-width: 100%;
}

.audio-player-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
  font-size: 14px;
  color: #fff; /* Dark theme text color */
}

.audio-player-time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5); /* Dark theme subtle text */
  flex-shrink: 0;
  white-space: nowrap;
}

/* Simple progress bar in top player */
.audio-player-progress {
  height: 4px;
  position: relative;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.2); /* Dark theme progress background */
  border-radius: 2px;
}

.audio-player-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Dark theme gradient */
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s ease;
}

.audio-player-actions {
  display: flex;
  flex-shrink: 0;
}

/* Individual audio message styles with progress bars */
.audio-message {
  display: flex;
  flex-direction: column !important;
  padding: 5px;
  border-radius: 8px;
  cursor: pointer;
  /* margin: 5px 0; */
  transition: background 0.2s;
  max-width: 100%;
  overflow: hidden;
  /* background: rgba(255, 255, 255, 0.1); */
}


.audio-message-header {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  margin-bottom: 8px;
  min-width: 200px;
}

.audio-play-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: var(--audio-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0px !important;
  margin-left: 10px !important;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 0.2s;
}

.audio-play-btn:hover {
  background: var(--audio-blue-hover);
}

.audio-play-btn svg {
  color: white;
}

.audio-play-btn .play-icon {
  display: block;
  transform: translateX(2px);
}

.audio-play-btn .pause-icon {
  display: none;
}

.audio-message.playing .audio-play-btn .play-icon {
  display: none;
}

.audio-message.playing .audio-play-btn .pause-icon {
  display: block;
}

.audio-details {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.audio-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  font-size: 14px;
}

.audio-meta {
  display: flex;
  flex-direction: row !important;
  justify-content: space-between;
  font-size: 12px;
  /* color: #666; */
  max-width: 100%;
  /* margin-bottom: 8px; */
}

.audio-duration {
  margin-right: 12px !important;
  margin-left: 0 !important;
  flex-shrink: 0;
}

.audio-size {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Individual progress bar for each audio message */
.audio-progress {
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  margin-top: 4px;
  display: none;
}

.audio-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--primary-blue);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s ease;
}

/* Active audio message styling */
.audio-message.playing .audio-play-btn {
  background: var(--audio-blue-hover);
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.95);
    opacity: 0.8;
  }
}

/* ========================================
     FILE UPLOAD STYLES
     ======================================== */
.upload-progress-container {
  display: flex;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  position: relative;
  border: 1px solid rgba(64, 167, 227, 0.2);
}

.upload-icon-container {
  position: relative;
  width: 56px;
  height: 56px;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-icon {
  width: 40px;
  height: 40px;
  background: var(--light-blue);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  z-index: 3;
  position: relative;
  box-shadow: 0 2px 4px var(--shadow-light);
}

.progress-circle {
  position: absolute;
  top: 0;
  left: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotate(-90deg);
}

.progress-ring-bg {
  stroke: #e0e0e0;
  stroke-width: 3;
  opacity: 0.3;
}

.progress-ring-fill {
  stroke: var(--light-blue);
  stroke-width: 3;
  transition: stroke-dashoffset 0.35s ease-in-out;
  stroke-linecap: round;
}

.progress-percentage {
  position: absolute;
  font-size: 11px;
  font-weight: 600;
  color: var(--light-blue);
  z-index: 4;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-weight: 500;
  font-size: 14px;
  color: #333;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 12px;
  color: #666;
}

/* ========================================
     FILE MESSAGE STYLES
     ======================================== */
.file-message-container {
  display: flex;
  align-items: center;
  padding: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin: 10px 0px;
  color: inherit;
}

.file-message-container:hover {
  background: rgba(255, 255, 255, 0.2);
}

.file-icon-final {
  width: 40px;
  height: 40px;
  background: var(--light-blue);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-left: 12px;
  flex-shrink: 0;
}

.file-info-final {
  flex: 1;
  min-width: 0;
}

.file-name-final {
  font-weight: 500;
  font-size: 14px;
  /* color: #333; */
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size-final {
  font-size: 12px;
  color: #666;
}

.upload-bubble {
  max-width: 320px;
}

.upload-error {
  color: #dc3545 !important;
}

.audio-error {
  color: var(--primary-blue);
}

.audio-download-link {
  color: var(--primary-blue);
  text-decoration: underline;
}

.audio-error-text {
  color: #e74c3c !important;
}

/* ========================================
     AUDIO PROGRESS INDICATOR IN BUBBLES
     ======================================== */

/* Progress indicator in audio messages */
.audio-progress-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.audio-message.playing .audio-progress-indicator {
  display: flex;
}

.audio-message.playing .audio-meta {
  justify-content: flex-end;
}

.audio-message.playing .audio-duration,
.audio-message.playing .audio-size {
  display: none;
}

.audio-bubble-progress {
  height: 3px;
  background: #e0e0e0;
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  flex: 1;
  min-width: 80px;
}

.audio-bubble-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--primary-blue);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s ease;
}

.audio-bubble-time {
  font-size: 12px;
  /* color: #666; */
  flex-shrink: 0;
  white-space: nowrap;
}

/* ========================================
     RESPONSIVE DESIGN
     ======================================== */
@media (max-width: 768px) {
  .persistent-audio-player {
    height: 40px;
  }

  .audio-player-btn {
    width: 32px;
    height: 32px;
  }

  .audio-player-title {
    font-size: 13px;
  }
}