/* Banner styles */
.ultravox_banner {
  position: sticky;
  top: 100px;
  background-color: rgba(255, 221, 204, 1);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="850" height="140" viewBox="0 0 850 140"><path d="M194 44C136 44 157 0 102 0H12C5.37259 0 0 5.37258 0 12V128C0 134.627 5.37258 140 12 140H128H142H838C844.627 140 850 134.627 850 128V56C850 49.3726 844.627 44 838 44H194Z" fill="url(%23paint0_linear_0_8)"/><defs><linearGradient id="paint0_linear_0_8" x1="980" y1="70" x2="-4.20235e-06" y2="69.9999" gradientUnits="userSpaceOnUse"><stop offset="0.230254" stop-color="%23109FAA"/><stop offset="0.774865" stop-color="%23385BB5"/><stop offset="1" stop-color="%23324165"/></linearGradient></defs></svg>');
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: 16px;
  padding: 0;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  margin: 0 auto 1.5em;
  font-family: 'Open Sans', sans-serif;
}

.banner-content {
  display: flex;
  align-items: flex-start; /* Changed from center to flex-start */
  padding: 20px;
  padding-bottom: 10px;
  gap: 20px;
  position: relative;
}

.profile-section {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-left: 28px;
  padding-right: 50px;
}

img.profile-image {
  width: 74px;
  height: 74px;
  border-radius: 50% !important;
  border: 2px solid rgba(255, 255, 255, 0.3);
  object-fit: cover;
  margin-bottom: 8px;
}

.profile-name {
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 16px;
}

.main-content {
  flex: 1;
  min-width: 0;
}

.ultravox-title {
  color: rgba(19, 63, 63, 1) !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  /* background: rgba(255, 255, 255, 0.9); */
  /* background-color: rgba(255, 221, 204, 1); */
  padding: 12px 0px 12px 23px !important;
  border-radius: 8px 8px 0 0 !important;
  margin: -20px -20px 12px -20px !important;
}

.content-row {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: flex-end; /* Align items to the top */
  justify-content: end;
}

/* Transcript area replaces description */
.transcript-area {
  color: white;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 400;
  min-width: 0;
  height: 72px; /* Fixed height */
  max-height: 72px; /* Ensure fixed height */
  overflow-y: auto;
  padding: 10px 15px; /* Slightly more padding for better text display */
  background-color: rgba(11, 18, 18, 0.5);
  border-radius: 8px;
  transition: all 0.3s ease;
  flex: 1; /* Take available space in the flex container */
  width: 100%; /* Ensure consistent width */
  display: flex; /* Use flexbox for consistent child sizing */
  flex-direction: column; /* Stack children vertically */
}

.transcript-area.active {
  background: rgba(11, 18, 18, 0.5);
}

/* Styling for scrollbar in transcript area */
.transcript-area::-webkit-scrollbar {
  width: 6px;
}

.transcript-area::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.transcript-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.transcript-area::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0; /* Prevent controls from shrinking */
  width: auto; /* Allow natural width */
}

.connect-btn {
  background: linear-gradient(135deg, #e74c3c 0%, #ff6b35 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
  white-space: nowrap;
  height: 35.5px;
}

.connect-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

/* End call button styling (for when call is active) */
.connect-btn.active {
  background: white;
  color: #e74c3c;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.connect-btn.active:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mic-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Language Selector */
.language-selector {
  position: relative;
  flex-shrink: 0;
  /* flex: 1; */
  /* height: 35px; */
}

.language-btn {
  height: 35px;
  background: white;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #2c3e50;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.language-btn:hover {
  background: #f8f9fa;
}

.flag-icon {
  width: 18px;
  height: 13px;
  border-radius: 2px;
  display: inline-block;
  background-size: cover;
  background-position: center;
}

.dropdown-arrow {
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid #666;
  margin-left: 2px;
}

/* Flag icons for different countries */
.flag-us { background-image: url("https://flagcdn.com/w40/us.png"); }
.flag-gb { background-image: url("https://flagcdn.com/w40/gb.png"); }
.flag-in { background-image: url("https://flagcdn.com/w40/in.png"); }
.flag-au { background-image: url("https://flagcdn.com/w40/au.png"); }
.flag-fr { background-image: url("https://flagcdn.com/w40/fr.png"); }
.flag-de { background-image: url("https://flagcdn.com/w40/de.png"); }
.flag-sa { background-image: url("https://flagcdn.com/w40/sa.png"); }
.flag-bg { background-image: url("https://flagcdn.com/w40/bg.png"); }
.flag-cn { background-image: url("https://flagcdn.com/w40/cn.png"); }
.flag-cz { background-image: url("https://flagcdn.com/w40/cz.png"); }
.flag-dk { background-image: url("https://flagcdn.com/w40/dk.png"); }
.flag-fi { background-image: url("https://flagcdn.com/w40/fi.png"); }
.flag-jp { background-image: url("https://flagcdn.com/w40/jp.png"); }
.flag-no { background-image: url("https://flagcdn.com/w40/no.png"); }
.flag-pl { background-image: url("https://flagcdn.com/w40/pl.png"); }
.flag-br { background-image: url("https://flagcdn.com/w40/br.png"); }
.flag-pt { background-image: url("https://flagcdn.com/w40/pt.png"); }
.flag-ro { background-image: url("https://flagcdn.com/w40/ro.png"); }
.flag-ru { background-image: url("https://flagcdn.com/w40/ru.png"); }
.flag-sk { background-image: url("https://flagcdn.com/w40/sk.png"); }
.flag-es { background-image: url("https://flagcdn.com/w40/es.png"); }
.flag-se { background-image: url("https://flagcdn.com/w40/se.png"); }
.flag-tr { background-image: url("https://flagcdn.com/w40/tr.png"); }
.flag-ua { background-image: url("https://flagcdn.com/w40/ua.png"); }
.flag-vn { background-image: url("https://flagcdn.com/w40/vn.png"); }
.flag-nl { background-image: url("https://flagcdn.com/w40/nl.png"); }
.flag-gr { background-image: url("https://flagcdn.com/w40/gr.png"); }
.flag-it { background-image: url("https://flagcdn.com/w40/it.png"); }
.flag-hu { background-image: url("https://flagcdn.com/w40/hu.png"); }



.language-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 150px;
  z-index: 10;
  display: none;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 8px;
}

.language-dropdown.show {
  display: block;
}

.language-option {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 13px;
  font-weight: 500;
  color: #2c3e50;
}

.language-option:hover {
  background: #f8f9fa;
}

.language-option:first-child {
  border-radius: 8px 8px 0 0;
}

.language-option:last-child {
  border-radius: 0 0 8px 8px;
}

/* Call Status - now inside profile section */
.call-status {
  text-align: center;
  font-size: 11px;
  font-style : italic;
  line-height: 16px;
  color: white;
  /* background: rgba(0, 0, 0, 0.5); */
  border-radius: 12px;
  backdrop-filter: blur(4px);
  max-width: 100%;
  font-weight: 300;
  /* margin-top: 3px; */
  min-height: 26px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {

  .ultravox_banner {
    top: 110px;
    left: 0;
    right: 0;
    transform: none;
    border-radius: 16px;
    max-width: 700px;
    width: 95%;
    margin: 0 15px;
    background-image: none;
    background: linear-gradient(270deg, #109FAA 11.25%, #385BB5 74.04%, #324165 100%);
    margin-right: 60px;
  }
  
  .banner-content {
    flex-direction: column;
    text-align: center;
    gap: 15px;
    padding: 16px;
    align-items: center;
  }

  .ultravox-title {
    margin: -16px -16px 25px -16px;
    padding: 12px 16px;
    text-align: center;
    font-size: 16px;
    color: white !important;
  }
  
  .content-row {
    flex-direction: column; /* Stack vertically on smaller screens */
    width: 100%;
  }
  
  .transcript-area {
    height: 40px; /* Smaller fixed height on mobile */
    max-height: 40px;
    font-size: 13px;
  }
  
  .controls {
    justify-content: center;
    width: 100%;
    flex-wrap: wrap; /* Allow wrapping on mobile */
  }
}

@media (max-width: 480px) {

  .ultravox-title{
    color: white !important;
  }

  .profile-name{
    color: #ffffff;
  }

  .ultravox_banner {
    border-radius: 12px;
    max-width: 700px;
    width: 88vw;
    background: linear-gradient(270deg, #109FAA 11.25%, #385BB5 74.04%, #324165 100%);
    margin-right: 60px;
  }
  
  .banner-content {
    flex-direction: column;
    padding: 16px;
    align-items: center;
  }
  
  img.profile-image {
    width: 50px;
    height: 50px;
  }
  
  .connect-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .transcript-area {
    height: 30px; /* Even smaller height on very small screens */
    max-height: 30px;
    font-size: 12px;
    padding: 8px 12px;
  }
}

/* Agent messages in transcript area */
.agent-message {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  animation: none;
  transition: opacity 0.15s ease;
  width: 100%; /* Ensure consistent width */
  display: block; /* Ensure block display */
  word-wrap: break-word; /* Allow long words to break */
  overflow-wrap: break-word;
}

@keyframes fadeIn {
  from { opacity: 0.9; }
  to { opacity: 1; }
}

.transcript-error {
  color: #ff6b6b;
  font-weight: 500;
  background: rgba(255, 0, 0, 0.1);
  padding: 5px 8px;
  border-radius: 4px;
}