/* Toyota Chat Components CSS */

/* Base component styles */
.chat-component {
  margin: 0;
  max-width: 100%;
  opacity: 0;
  animation: fadeInComponent 1s ease forwards;
}

@keyframes fadeInComponent {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Animated word styling for smooth animation */
.animated-word {
  display: inline-block;
  margin-right: 0.25em;
  transition: all 0.15s ease;
}

/* Initial state for all animated words - ensure they start invisible */
.animated-text .animated-word {
  opacity: 0;
  transform: translateY(2px);
}

/* Streaming animation styles for words */
.streaming .animated-word {
  opacity: 0;
  transform: translateY(2px);
  transition: all 0.15s ease;
}

@keyframes fadeInWord {
  from {
    opacity: 0;
    transform: translateY(2px);
  }

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

@keyframes letterFadeInUp {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

/* Preserve whitespace for animated text */
.animated-text {
  white-space: pre-wrap;
}

/* Sound reactive icon */
.button__icon.sound-reactive {
  transform-origin: center;
  transition: transform 0.1s ease;
  filter: drop-shadow(0 0 4px rgba(0, 123, 255, 0.3));
}

.button__icon.sound-reactive:hover {
  filter: drop-shadow(0 0 8px rgba(0, 123, 255, 0.5));
}

/* Car Carousel Component - Override with original styles */
.car-list-wrapper {
  width: 100%;
  border-radius: 12px;
  margin: 0;
}

.car-list-cont {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow: scroll;
  gap: 10px;
  margin-bottom: 15px;
  position: relative;
}

.car-list__item {
  min-width: calc(50% - 8px);
  /* 2.5 items per view */
  flex-shrink: 0;
  height: auto;
  background-color: #ffffff;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: "Ubuntu", sans-serif;
  font-weight: 300;
  color: #282830;
  transition: all 0.3s ease;
}

.car-item__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  height: 60px;
}

.car-item__name {
  font-family: "Ubuntu", sans-serif;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 0;
}

.car-item__desc {
  font-family: "Ubuntu", sans-serif;
  font-weight: 600;
  font-size: 11px;
  color: #2d76d2;
}

.car-item__img {
  max-width: 100%;
  height: auto;
}

.car-item__price {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  margin-bottom: 5px;
}

.car-price__value {
  color: #282830;
  font-size: 11px;
}

.car-price__old-value {
  color: #eb0a1e;
  text-decoration: line-through;
  font-size: 11px;
  margin-left: 10px;
}

.car-list-nav {
  width: 100%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.car-list-btn-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid #ffffff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.car-list-btn-nav.btn--right {
  right: 0;
}

.car-list-btn-nav.btn--left {
  left: 0;
}

.car-list-btn-nav .da-icon-chevron-right {
  width: 4px;
  height: auto;
  transition: transform 0.3s ease;
}

.car-list-btn-nav:hover .da-icon-chevron-right {
  transform: translateX(5px);
}

/* Button overrides for components */
.car-details-btn,
.car-reservation-btn,
.media-carousel__cta {
  color: white !important;
}

.car-create-btn {
  margin-bottom: 5px !important;
}

.car-compare-btn:hover {
  background-color: #333 !important;
  color: white !important;
}

.car-list__item .button {
  margin: 0;
  width: 100%;
}

/* Car Bottom Actions */
.car-bottom-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  margin-top: 15px;
  flex-wrap: wrap;
}

.car-bottom-wrapper button {
  margin-right: 10px;
}

.car-bottom-wrapper button:last-child {
  margin-right: 0;
}

/* Action Buttons Component */
.action-buttons-wrapper {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 15px 0;
}

.action-btn {
  flex: 1;
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.action-btn:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Info Card Component */
.info-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin: 15px 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.info-card__title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0 0 10px 0;
}

.info-card__content {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin: 10px 0;
}

.info-card__image {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 8px;
  margin: 15px 0;
}

.info-card__link {
  display: inline-block;
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
  margin-top: 10px;
}

.info-card__link:hover {
  text-decoration: underline;
}

/* Modal Styles */
.right-cont {
  height: 100%;
  background: transparent;
  transition: right 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.right-cont--active {
  right: 0;
}

.right-cont__close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  transition: background 0.2s ease;
}

.right-cont__close:hover {
  background: white;
}

.right-cont__close img {
  width: 20px;
  height: 20px;
}

.right-cont__video-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Container for scaled iframe */
.right-cont {
  overflow: hidden;
  /* Hide any overflow from scaled iframe */
}

/* Media Links */
.media-link {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.media-link:hover {
  text-decoration: underline;
}

.media-link.video-link::before {
  content: "🎥 ";
}

.media-link.image-link::before {
  content: "🖼️ ";
}

.media-link.pdf-link::before {
  content: "📄 ";
}

/* Button Styles */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.button--primary {
  background: #007bff;
  color: white;
}

.button--primary:hover {
  background: #0056b3;
}

.button--outline {
  background: transparent;
  border-color: #007bff;
  color: #007bff;
}

.button--outline:hover {
  background: #007bff;
  color: white;
}

.button--red-outline {
  background: transparent;
  border-color: #dc3545;
  color: #ffffff;
}

.button--red-outline:hover {
  background: #dc3545;
  color: white;
}

.button--dark {
  background: #333;
  color: white;
}

.button--dark:hover {
  background: #222;
}

.button--white {
  background: white;
  color: #333;
  border-color: #ddd;
}

.button--white:hover {
  background: #f8f9fa;
}

.button--small {
  padding: 6px 12px;
  font-size: 13px;
}

.button--large {
  padding: 12px 24px;
  font-size: 16px;
}

.button--rounded {
  border-radius: 40px;
}

.button--fullwidth {
  width: 100%;
}

.button__icon {
  width: 16px;
  height: 16px;
}

.button__icon--right {
  margin-left: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .right-cont {
    width: 90%;
  }

  .car-list__item {
    min-width: calc(66.67% - 7px);
    /* 1.5 items per view on mobile */
  }

  .car-item__img {
    max-width: 100%;
    height: auto;
  }

  .car-list-btn-nav {
    width: 28px;
    height: 28px;
  }

  .car-list-btn-nav .da-icon-chevron-right {
    width: 3px;
  }

  .action-buttons-wrapper {
    flex-direction: column;
  }

  .action-btn {
    min-width: 100%;
  }

  .car-bottom-wrapper {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .right-cont {
    width: 100%;
    position: absolute;
    padding: 0;
    z-index: 10;
    border-radius: 0;
  }

  .car-list__item {
    min-width: 200px;
  }

  .car-item__img {
    width: 140px;
    height: 80px;
  }
}

/* Media Carousel Component */
.media-carousel-wrapper {
  padding: 20px 0 0 0;
  margin: 15px 0 0 0;
  padding-top: 0;
  margin-top: 0;
}

.media-carousel__header {
  margin-bottom: 20px;
}

.media-carousel__title {
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
  color: #fff;
}

/* Media Carousel Container - Original scroll implementation */
.media-carousel__container {
  position: relative;
  margin-bottom: 20px;
}

.media-carousel__track {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 10px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.media-carousel__track::-webkit-scrollbar {
  display: none;
}

.media-carousel__item {
  position: relative;
  flex: 0 0 auto;
  width: fit-content;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.media-carousel__item:hover {
  transform: scale(1.05);
}

.media-carousel__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.media-carousel__play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.media-carousel__item:hover .media-carousel__play-overlay {
  background: rgba(0, 0, 0, 0.9);
}

.media-carousel__play-icon {
  width: 20px;
  height: 20px;
  filter: invert(1);
}

.media-carousel__nav-btn {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: background 0.2s ease !important;
}

.media-carousel__nav-btn:hover {
  background: rgba(255, 255, 255, 1);
}

.media-carousel__nav-btn img {
  width: 16px;
  height: 16px;
}

.media-carousel__footer {
  display: flex;
  justify-content: flex-start;
}

.media-carousel__cta:hover {
  background: #ff0000;
  color: white;
}

/* Media Lightbox Content (inside right-cont) */
.media-lightbox__content {
  position: relative;
  width: 100%;
  height: 100%;
  background: transparent;
  overflow: hidden;
}

/* Close button uses existing right-cont__close styles */

.media-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  transition: background 0.2s ease;
}

.media-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.media-lightbox__nav--prev {
  left: 15px;
}

.media-lightbox__nav--next {
  right: 15px;
}

.media-lightbox__nav img {
  width: 24px;
  height: 24px;
  filter: invert(1);
}

.media-lightbox__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

@media (max-width: 768px) {
  .media-lightbox__media {
    background-color: #0000008f;
  }
}

.media-lightbox__image {
  max-width: 100%;
  max-height: 100%;
  height: 100%;
  object-fit: contain;
}

.media-lightbox__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.media-lightbox__counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
  .media-carousel__item {
    width: 150px;
    height: 112px;
  }

  .media-carousel__nav {
    position: static;
    transform: none;
    justify-content: center;
    margin-top: 15px;
  }

  .media-lightbox__nav {
    width: 40px;
    height: 40px;
  }

  .media-lightbox__nav--prev {
    left: 10px;
  }

  .media-lightbox__nav--next {
    right: 10px;
  }
}

a strong,
a {
  color: #fff !important;
  text-decoration: underline;
}