/* ==========================================================================
   RCS Message Preview Styles
   Phone frame + message type styles translated from Angular _rcs-message.scss
   ========================================================================== */

/* --------------------------------------------------------------------------
   Phone Frame
   -------------------------------------------------------------------------- */
.rcs-phone-frame {
  width: 100%;
  max-width: 310px;
  background: #f5f6f0;
  border-radius: 32px;
  border: 3px solid #2a2a2a;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.rcs-phone-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px 4px;
  font-size: 12px;
  font-weight: 600;
  color: #1a1a1a;
  background: #f5f6f0;
}

.rcs-phone-time {
  font-weight: 600;
}

.rcs-phone-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rcs-phone-icons svg {
  width: 14px;
  height: 14px;
  fill: #1a1a1a;
}

.rcs-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 10px;
  background: #f5f6f0;
  border-bottom: 1px solid #e0e0d8;
}

.rcs-chat-header .rcs-back-arrow {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.rcs-chat-header .rcs-back-arrow svg {
  width: 18px;
  height: 18px;
  fill: #1976d2;
}

.rcs-sender-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e91e8c, #7c3aed);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rcs-sender-avatar svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

.rcs-sender-info {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.rcs-verified-badge {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.rcs-verified-badge img {
  width: 100%;
  height: 100%;
}

.rcs-sender-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rcs-message-area {
  flex: 1;
  padding: 16px 12px;
  min-height: 400px;
  transition: opacity 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.rcs-message-area.fade-out {
  opacity: 0;
}

/* --------------------------------------------------------------------------
   Chat Input Bar (decorative)
   -------------------------------------------------------------------------- */
.rcs-chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px 8px;
  margin-top: 12px;
  background: #f5f6f0;
  border-top: 1px solid #e0e0d8;
}

.rcs-chat-input .input-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border-radius: 24px;
  padding: 7px 12px;
  min-height: 20px;
}

.rcs-chat-input .input-placeholder {
  font-size: 12px;
  color: #999;
  flex: 1;
  user-select: none;
}

.rcs-chat-input .input-camera {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.rcs-chat-input .input-camera svg {
  width: 18px;
  height: 18px;
  fill: #888;
}

.rcs-chat-input .send-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1a73e8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rcs-chat-input .send-button svg {
  width: 16px;
  height: 16px;
  fill: #ffffff;
}

.rcs-phone-home {
  padding: 8px 0 6px;
  display: flex;
  justify-content: center;
  background: #f5f6f0;
}

.rcs-phone-home-bar {
  width: 100px;
  height: 4px;
  border-radius: 2px;
  background: #c0c0b8;
}

/* --------------------------------------------------------------------------
   Message timestamp
   -------------------------------------------------------------------------- */
.rcs-msg-time {
  text-align: center;
  font-size: 11px;
  color: #888;
  margin-bottom: 10px;
}

/* --------------------------------------------------------------------------
   Text Message (from _rcs-message.scss)
   -------------------------------------------------------------------------- */
.rcs-text-message {
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  background-color: #ffffff;
}

.rcs-text-message .message-text {
  line-height: 1.4;
  color: #333;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Rich Card (from _rcs-message.scss)
   -------------------------------------------------------------------------- */
.rcs-rich-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  overflow: hidden;
  background: #fdfdfd;
  display: flex;
  flex-direction: column;
}

.rcs-rich-card .card-media {
  position: relative;
  overflow: hidden;
  background: #f0f0f0;
  border-radius: 12px 12px 0 0;
  height: 200px;
}

.rcs-rich-card .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rcs-rich-card .card-body {
  display: flex;
  flex-direction: column;
}

.rcs-rich-card .card-content {
  padding: 12px;
}

.rcs-rich-card .card-title {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 4px;
  color: #333;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.rcs-rich-card .card-description {
  font-size: 13px;
  color: #666;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.rcs-rich-card .card-actions {
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* --------------------------------------------------------------------------
   Card Action Buttons (shared by rich card + carousel)
   -------------------------------------------------------------------------- */
.card-action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffffff;
  color: #1976d2;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: default;
  border: 1px solid #f3f3f3;
}

.card-action-button .btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-action-button .btn-icon svg {
  width: 16px;
  height: 16px;
  fill: #1976d2;
}

.card-action-button .btn-icon .material-icons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  line-height: 16px;
  color: #1976d2;
}

/* --------------------------------------------------------------------------
   Carousel (from _rcs-message.scss)
   -------------------------------------------------------------------------- */
.rcs-carousel .carousel-cards {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 10px;
  padding-bottom: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.rcs-carousel .carousel-cards::-webkit-scrollbar {
  display: none;
}

.rcs-carousel .carousel-card {
  flex: 0 0 82%;
  scroll-snap-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  overflow: hidden;
  background: #fdfdfd;
}

.rcs-carousel .carousel-card .card-media {
  position: relative;
  height: 200px;
  background: #f0f0f0;
  overflow: hidden;
}

.rcs-carousel .carousel-card .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rcs-carousel .carousel-card .card-content {
  padding: 10px;
}

.rcs-carousel .carousel-card .card-title {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 4px;
  color: #333;
}

.rcs-carousel .carousel-card .card-description {
  font-size: 11px;
  color: #666;
  line-height: 1.3;
}

.rcs-carousel .carousel-card .card-actions {
  padding: 6px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rcs-carousel .carousel-card .card-action-button {
  padding: 6px 10px;
  font-size: 11px;
}

.rcs-carousel .carousel-card .card-action-button .btn-icon {
  width: 14px;
  height: 14px;
}

.rcs-carousel .carousel-card .card-action-button .btn-icon svg {
  width: 14px;
  height: 14px;
}

.rcs-carousel .carousel-card .card-action-button .btn-icon .material-icons {
  font-size: 14px;
  width: 14px;
  height: 14px;
  line-height: 14px;
}

.rcs-carousel .carousel-indicators {
  display: flex;
  justify-content: center;
  padding: 8px;
  gap: 6px;
}

.rcs-carousel .carousel-indicators .indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ccc;
  display: inline-block;
}

.rcs-carousel .carousel-indicators .indicator.active {
  background: #1976d2;
}

/* --------------------------------------------------------------------------
   Chip Suggestions (from _rcs-message.scss)
   -------------------------------------------------------------------------- */
.rcs-chip-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip-suggestion {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  color: #1976d2;
  padding: 6px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid #1976d2;
  cursor: default;
}

.chip-suggestion .chip-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chip-suggestion .chip-icon svg {
  width: 14px;
  height: 14px;
  fill: #1976d2;
}

.chip-suggestion .chip-icon .material-icons {
  font-size: 14px;
  width: 14px;
  height: 14px;
  line-height: 14px;
  color: #1976d2;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .rcs-phone-frame {
    max-width: 310px;
  }

  .rcs-message-area {
    min-height: 180px;
    padding: 12px 10px;
  }

  .rcs-rich-card .card-media {
    height: 170px;
  }

  .rcs-carousel .carousel-card .card-media {
    height: 170px;
  }
}

@media (max-width: 480px) {
  .rcs-phone-frame {
    max-width: 280px;
  }

  .rcs-message-area {
    min-height: 160px;
    padding: 10px 8px;
  }

  .rcs-rich-card .card-media {
    height: 140px;
  }
}

/* --------------------------------------------------------------------------
   Media Message (image, video, audio, file)
   Translated from Angular _rcs-message.scss
   -------------------------------------------------------------------------- */
.rcs-media-message {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

/* Image */
.rcs-media-message .media-image {
  position: relative;
  height: 180px;
  background: #f0f0f0;
  overflow: hidden;
}

.rcs-media-message .media-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rcs-media-message .media-image .image-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #999;
}

.rcs-media-message .media-image .image-placeholder svg {
  width: 48px;
  height: 48px;
  fill: #bbb;
  margin-bottom: 6px;
}

.rcs-media-message .media-image .image-placeholder .material-icons {
  font-size: 48px;
  color: #bbb;
  margin-bottom: 6px;
}

.rcs-media-message .media-image .image-placeholder span {
  font-size: 12px;
}

/* Video */
.rcs-media-message .media-video {
  position: relative;
  height: 180px;
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.rcs-media-message .media-video .play-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.rcs-media-message .media-video .play-button svg {
  width: 24px;
  height: 24px;
  fill: #fff;
  margin-left: 2px;
}

.rcs-media-message .media-video .play-button .material-icons {
  font-size: 28px;
  color: #fff;
  margin-left: 2px;
}

.rcs-media-message .media-video .video-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

/* Audio */
.rcs-media-message .media-audio {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.rcs-media-message .media-audio .audio-icon svg {
  width: 32px;
  height: 32px;
  fill: #fff;
}

.rcs-media-message .media-audio .audio-icon .material-icons {
  font-size: 32px;
  color: #fff;
}

.rcs-media-message .media-audio .audio-waveform {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 28px;
}

.rcs-media-message .media-audio .audio-waveform .bar {
  width: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.6);
}

.rcs-media-message .media-audio .audio-info {
  font-size: 11px;
  opacity: 0.8;
  white-space: nowrap;
}

/* File */
.rcs-media-message .media-file {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f5f5f5;
}

.rcs-media-message .media-file .file-icon-wrap {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rcs-media-message .media-file .file-icon-wrap svg {
  width: 36px;
  height: 36px;
}

.rcs-media-message .media-file .file-icon-wrap .material-icons {
  font-size: 36px;
  color: #1976d2;
}

.rcs-media-message .media-file.file-type-pdf .file-icon-wrap .material-icons {
  color: #e53935;
}

.rcs-media-message .media-file.file-type-xls .file-icon-wrap .material-icons,
.rcs-media-message .media-file.file-type-xlsx .file-icon-wrap .material-icons {
  color: #2e7d32;
}

.rcs-media-message .media-file .file-info {
  flex: 1;
  min-width: 0;
}

.rcs-media-message .media-file .file-name {
  font-weight: 500;
  color: #333;
  font-size: 13px;
  word-break: break-all;
  display: block;
}

.rcs-media-message .media-file .file-size {
  font-size: 11px;
  color: #999;
  display: block;
  margin-top: 2px;
}

/* Caption (shared) */
.rcs-media-message .media-caption {
  padding: 10px 12px;
  color: #333;
  line-height: 1.4;
  font-size: 13px;
}

/* Responsive media */
@media (max-width: 768px) {
  .rcs-media-message .media-image,
  .rcs-media-message .media-video {
    height: 150px;
  }
}

@media (max-width: 480px) {
  .rcs-media-message .media-image,
  .rcs-media-message .media-video {
    height: 130px;
  }
}
