/* ============================================================
   STROBI ANIMATED AVATAR SYSTEM STYLES
   ============================================================ */

strobi-avatar {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: visible;
  pointer-events: none;
  user-select: none;
}

.strobi-avatar-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.strobi-avatar-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* Meet Stage Avatar Container with Strobi */
.meet-avatar.has-strobi {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.meet-avatar.has-strobi strobi-avatar {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.4));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.meet-tile.is-speaking .meet-avatar.has-strobi strobi-avatar {
  transform: scale(1.1);
  filter: drop-shadow(0 0 16px rgba(34, 197, 94, 0.65)) drop-shadow(0 4px 14px rgba(0, 0, 0, 0.5));
}

.meet-tile.is-speaking.locally-muted-speaking .meet-avatar.has-strobi strobi-avatar {
  transform: scale(1.1);
  filter: drop-shadow(0 0 16px rgba(249, 115, 22, 0.75)) drop-shadow(0 4px 14px rgba(0, 0, 0, 0.5));
}

/* AVATAR COLOR SELECTOR UI (Login Modal & Settings) */
.avatar-customizer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

/* AVATAR HERO ROW (Seamlessly matching input fields & buttons in RTL) */
.avatar-hero-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.avatar-hero-row .avatar-preview-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: visible;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.avatar-hero-row .avatar-preview-circle:hover {
  border-color: var(--accent-main);
  transform: scale(1.05);
}
.avatar-hero-row .avatar-preview-circle strobi-avatar {
  width: 70px;
  height: 70px;
}

.avatar-swatch-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor, 0 1px 3px rgba(0, 0, 0, 0.5);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  transition: background-color 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}
.avatar-swatch-dot:hover {
  transform: scale(1.3);
  border-color: #ffffff;
}

.avatar-customize-toggle-btn {
  flex: 1;
  height: 42px;
  background: var(--glass-bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0 16px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  touch-action: manipulation;
  min-width: 0;
}
.avatar-customize-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-main);
}
.avatar-customize-toggle-btn.expanded {
  background: rgba(54, 80, 253, 0.16);
  border-color: var(--accent-main);
  color: #ffffff;
}
.avatar-customize-toggle-btn.expanded #lobby-drawer-chevron {
  transform: rotate(180deg);
}
.customize-btn-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.customize-btn-inner i {
  width: 15px;
  height: 15px;
  color: var(--theme-badge-color);
  flex-shrink: 0;
}
.drawer-chevron-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.avatar-hero-row .btn-secondary {
  height: 42px;
  padding: 0 16px;
  flex-shrink: 0;
}

/* AVATAR EXPANDABLE DRAWER (Accordion Animation) */
.avatar-expandable-drawer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  margin-top: 2px;
  animation: drawerSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.avatar-expandable-drawer.hidden {
  display: none !important;
}
@keyframes drawerSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.avatar-preview-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  position: relative;
}

.avatar-preview-circle {
  width: 76px;
  height: 76px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-preview-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.avatar-preview-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.avatar-preview-desc {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* AVATAR COLOR SPECTRUM SLIDER & POINTER UI */
.avatar-spectrum-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.avatar-spectrum-track {
  width: 100%;
  height: 18px;
  border-radius: 10px;
  background: linear-gradient(to right, 
    #ff0000 0%, 
    #ff7700 12%, 
    #ffff00 24%, 
    #00ff00 38%, 
    #00ffff 52%, 
    #0055ff 68%, 
    #aa00ff 82%, 
    #ff0077 92%, 
    #ff0000 100%
  );
  position: relative;
  cursor: pointer;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  user-select: none;
  touch-action: none;
}

.avatar-spectrum-pointer {
  position: absolute;
  top: 50%;
  left: 63%; /* Default to blue (~227deg) */
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  background: #5b7fe5;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6), 0 0 12px currentColor;
  pointer-events: none;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.avatar-spectrum-track:active .avatar-spectrum-pointer {
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.8), 0 0 16px currentColor;
}

.avatar-color-inputs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.avatar-color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.avatar-hex-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 2px 8px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 11px;
  color: var(--text-main);
  width: 90px;
}

.avatar-hex-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(91, 127, 229, 0.25);
}

.avatar-hex-input-wrap .hex-prefix {
  color: var(--text-dim);
  font-weight: 700;
  margin-right: 2px;
}

.avatar-hex-input {
  background: transparent;
  border: none;
  outline: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  text-transform: uppercase;
  width: 100%;
}

.avatar-lightness-slider-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  font-size: 10px;
  color: var(--text-dim);
}

.avatar-lightness-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Legacy pills compatibility (if any remain) */
.avatar-color-pills-list {
  display: none;
}

/* AVATAR PERSONALITY SELECTOR */
.avatar-personality-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}

.avatar-personality-select {
  flex: 1;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 12px;
  padding: 6px 10px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.avatar-personality-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(91, 127, 229, 0.25);
}

.avatar-personality-select option {
  background: #1e293b;
  color: #ffffff;
}

.avatar-personality-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(91, 127, 229, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(91, 127, 229, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.meet-tile.user-muted .meet-avatar.has-strobi {
  opacity: 0.9 !important;
  filter: none !important;
}

/* Mobile Responsive Avatar Customizer */
@media (max-width: 480px) {
  .avatar-hero-row {
    gap: 8px !important;
  }
  .avatar-hero-row .avatar-preview-circle {
    width: 60px !important;
    height: 60px !important;
  }
  .avatar-hero-row .avatar-preview-circle strobi-avatar {
    width: 58px !important;
    height: 58px !important;
  }
  .avatar-swatch-dot {
    width: 8px !important;
    height: 8px !important;
  }
  .avatar-customize-toggle-btn {
    height: 38px !important;
    padding: 0 12px !important;
    font-size: 12px !important;
  }
  .avatar-hero-row .btn-secondary {
    height: 38px !important;
    padding: 0 12px !important;
  }
  .avatar-preview-box {
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 12px !important;
  }
  .avatar-preview-circle {
    width: 68px !important;
    height: 68px !important;
  }
  .avatar-preview-info {
    width: 100% !important;
    align-items: center !important;
  }
  .avatar-preview-title {
    justify-content: center !important;
    font-size: 12px !important;
  }
  .avatar-color-inputs-row {
    justify-content: center !important;
    gap: 6px !important;
  }
  .avatar-color-swatch {
    width: 24px !important;
    height: 24px !important;
  }
  .avatar-hex-input-wrap {
    width: 78px !important;
    padding: 2px 6px !important;
    font-size: 10px !important;
  }
  .avatar-lightness-slider-wrap {
    font-size: 9px !important;
  }
  .avatar-personality-select {
    font-size: 11px !important;
    padding: 5px 8px !important;
  }
}

