/* ==========================================
   MAIN LAYOUT & STRUCTURE
   ========================================== */

.chat-app-layout {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.chat-content-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.chat-log-scrollable {
  flex-grow: 1;
  overflow-y: auto;
  min-height: 0;
  max-height: 100%;
}

/* ==========================================
   KEYFRAME ANIMATIONS
   ========================================== */

@keyframes user-message-in {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bot-message-in {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes center-input-appear {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) translateY(0);
  }
}

@keyframes bottom-input-slide {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes welcome-float {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(30px) scale(0.95);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0) scale(1);
    filter: blur(0px);
  }
}

@keyframes dropdown-appear {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes preview-fade {
  0% {
    opacity: 0;
    transform: translateY(5px);
  }
  100% {
    opacity: 0.9;
    transform: translateY(0);
  }
}

@keyframes chip-slide {
  0% {
    opacity: 0;
    transform: translateX(-20px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes indicator-bounce {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes pulse-enhanced {
  0%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.4);
    opacity: 1;
  }
}

@keyframes delete-message {
  0% {
    opacity: 1;
    transform: scale(1) translateX(0) rotateZ(0deg);
  }
  50% {
    opacity: 0.3;
    transform: scale(0.9) translateX(30px) rotateZ(2deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.7) translateX(80px) rotateZ(5deg);
  }
}

@keyframes delete-message-bubble {
  0% {
    opacity: 1;
    transform: scale(1) translateX(0) rotateZ(0deg);
    filter: blur(0px);
  }
  50% {
    opacity: 0.2;
    transform: scale(0.85) translateX(40px) rotateZ(3deg);
    filter: blur(1px);
  }
  100% {
    opacity: 0;
    transform: scale(0.6) translateX(100px) rotateZ(8deg);
    filter: blur(3px);
  }
}

@keyframes undo-slide-bounce {
  0% {
    transform: translateY(-150%) scale(0.9);
    opacity: 0;
  }
  70% {
    transform: translateY(10%) scale(1.02);
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* ==========================================
   MESSAGE COMPONENTS
   ========================================== */

/* Message transitions */
.message-enter-active,
.message-leave-active {
  transition: all 0.3s ease;
}

.message-enter-from {
  opacity: 0;
  transform: translateY(20px);
}

.message-leave-to {
  opacity: 0;
}

/* Message bubbles */
.user-message .message-bubble {
  animation: user-message-in 0.3s ease-in-out;
  transform-origin: bottom right;
}

.bot-message .message-bubble {
  animation: bot-message-in 0.3s ease-in-out;
  transform-origin: bottom left;
}

.bot-message .message-bubble,
.bot-message .message-bubble * {
  color: rgba(var(--v-theme-on-surface), 0.87) !important;
}

.message-bubble {
  max-width: 80%;
  word-break: break-word;
  transition: all 0.2s ease;
}

.message-avatar {
  opacity: 0;
  animation: fade-in 0.3s ease forwards;
  animation-delay: 0.15s;
}

/* Message deletion animations */
.is-deleting {
  animation: delete-message 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

.message-bubble.is-deleting {
  animation: delete-message-bubble 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

/* Typing indicator */
.typing-indicator-container {
  animation: fade-in 0.3s ease forwards;
}

.bot-typing-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  animation: indicator-bounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #9e9e9e;
    box-shadow: none;
    margin: 0 2px;
    animation: pulse-enhanced 1.8s infinite cubic-bezier(0.68, -0.55, 0.265, 1.55);

    &:nth-child(2) {
      animation-delay: 0.3s;
    }

    &:nth-child(3) {
      animation-delay: 0.6s;
    }
  }
}

/* ==========================================
   INPUT COMPONENTS
   ========================================== */

/* Input wrapper positioning */
.input-wrapper {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.centered-input {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 700px;
  z-index: 10;
  animation: center-input-appear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-input {
  position: relative;
  padding: 0 20px 20px;
  width: 100%;
  animation: bottom-input-slide 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Chat input container */
.chat-input-container {
  border: 1px solid v-bind("`rgba(var(--v-theme-${activeModelColor}), 0.5)`");
  background-color: rgb(var(--v-theme-surface));
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border-radius: 15px;
  width: 100%;
  border: 1px solid rgba(var(--v-theme-primary), 0.5);

  &:hover,
  &:focus-within {
    border-color: v-bind("`rgb(var(--v-theme-${activeModelColor}))`");
    box-shadow: v-bind("`0 0 0 2px rgba(var(--v-theme-${activeModelColor}), 0.25)`");
    transform: translateY(-1px) scale(1.005);
  }
}

.chat-textarea {
  font-size: 0.9375rem !important;
  padding: 8px 0;
  color: rgb(var(--v-theme-on-surface));
  transition: all 0.2s ease;
}

.input-toolbar {
  flex-wrap: nowrap;
}

/* ==========================================
   DROPDOWN COMPONENTS
   ========================================== */

/* Command dropdown */
.command-dropdown {
  position: absolute;
  bottom: 100%;
  left: 20px;
  background: rgb(var(--v-theme-surface));
  box-shadow: 0 8px 32px rgba(var(--v-theme-on-surface), 0.15);
  z-index: 10;
  min-width: 200px;
  margin-bottom: 8px;
  border-radius: 12px;
  animation: dropdown-appear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.command-item {
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  &:hover {
    background: rgba(var(--v-theme-on-surface), 0.08);
    transform: translateX(3px);
  }
}

/* Suggestions dropdown */
.suggestions-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: rgb(var(--v-theme-surface));
  box-shadow: 0 8px 32px rgba(var(--v-theme-on-surface), 0.2);
  border: 1px solid rgba(var(--v-theme-on-surface), 0.1);
  z-index: 15;
  margin-bottom: 8px;
  max-height: 240px;
  overflow-y: auto;
  border-radius: 12px;
  animation: suggestions-slide-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-track {
    background: rgba(var(--v-theme-on-surface), 0.05);
    border-radius: 3px;
  }

  &::-webkit-scrollbar-thumb {
    background: rgba(var(--v-theme-on-surface), 0.2);
    border-radius: 3px;
    transition: background 0.2s ease;

    &:hover {
      background: rgba(var(--v-theme-on-surface), 0.3);
    }
  }
}

@keyframes suggestions-slide-up {
  0% {
    opacity: 0;
    transform: translateY(15px) scale(0.95);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px);
  }
}

.suggestions-header {
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: header-glow 0.5s ease-out 0.2s both;
}

@keyframes header-glow {
  0% {
    opacity: 0;
    transform: translateY(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.suggestion-item {
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-bottom: 2px;
  border: 1px solid transparent;
  animation: suggestion-fade-in 0.3s ease-out;

  &:nth-child(1) { animation-delay: 0.1s; }
  &:nth-child(2) { animation-delay: 0.15s; }
  &:nth-child(3) { animation-delay: 0.2s; }
  &:nth-child(4) { animation-delay: 0.25s; }

  &:hover,
  &.suggestion-selected {
    background: rgba(var(--v-theme-primary), 0.12);
    border-color: rgba(var(--v-theme-primary), 0.3);
    transform: translateX(5px) scale(1.01);
    box-shadow: 0 2px 8px rgba(var(--v-theme-primary), 0.15);
  }

  &:last-child {
    margin-bottom: 0;
  }
}

@keyframes suggestion-fade-in {
  0% {
    opacity: 0;
    transform: translateX(-10px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.suggestion-text {
  font-size: 0.875rem;
  color: rgb(var(--v-theme-on-surface));
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================
   FILE UPLOAD COMPONENTS
   ========================================== */

.border-dashed {
  border: 2px dashed rgba(var(--v-theme-on-surface), 0.2);
}

.upload-area {
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  &:hover {
    background-color: rgba(var(--v-theme-on-surface), 0.08);
    border-color: rgba(var(--v-theme-on-surface), 0.4);
    transform: scale(1.02);
  }
}

.attachment-preview {
  font-size: 0.85rem;
  opacity: 0.9;
  animation: preview-fade 0.3s ease-out;
}

.attachment-chip-container {
  overflow-x: auto;
  padding-bottom: 4px;
  margin-right: -8px;
  margin-left: -8px;
  padding-left: 8px;
  padding-right: 8px;
  -ms-overflow-style: none;
  scrollbar-width: none;

  &::-webkit-scrollbar {
    display: none;
  }
}

.attachment-chip {
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  animation: chip-slide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  .attachment-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
  }

  .attachment-size {
    margin-left: 4px;
  }
}

/* ==========================================
   QUICK REPLIES COMPONENTS
   ========================================== */

.quick-replies-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  grid-gap: 8px;
  margin-bottom: 8px;
  width: 100%;
  margin-top: 1rem !important;
  animation: replies-container-appear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes replies-container-appear {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.quick-reply-item {
  width: 100%;
  animation: reply-item-appear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes reply-item-appear {
  0% {
    opacity: 0;
    transform: translateY(15px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Quick reply button styling */
.quick-reply-transparent {
  width: 100%;
  background-color: transparent !important;
  box-shadow: none !important;
  color: rgba(var(--v-theme-on-background), var(--v-high-emphasis-opacity)) !important;
  font-size: 0.78rem;
  border-radius: 20px !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
  }

  &:hover {
    background-color: var(--hover-bg-color, rgba(var(--v-theme-primary), 0.1)) !important;
    border-color: var(--hover-border-color, rgba(var(--v-theme-primary), 0.8)) !important;
    transform: translateY(-5px) scale(1.05) rotateZ(0.5deg);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  }

  &:hover::before {
    left: 100%;
  }
}

/* Quick reply staggered animations */
.quick-reply-item:nth-child(1) { 
  transition-delay: 0ms;
  animation-delay: 0.05s;
}
.quick-reply-item:nth-child(2) { 
  transition-delay: 60ms;
  animation-delay: 0.1s;
}
.quick-reply-item:nth-child(3) { 
  transition-delay: 120ms;
  animation-delay: 0.15s;
}
.quick-reply-item:nth-child(4) { 
  transition-delay: 180ms;
  animation-delay: 0.2s;
}
.quick-reply-item:nth-child(5) { 
  transition-delay: 240ms;
  animation-delay: 0.25s;
}
.quick-reply-item:nth-child(6) { 
  transition-delay: 300ms;
  animation-delay: 0.3s;
}

/* Quick replies transitions */
.quick-replies-enter-active,
.quick-replies-leave-active {
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quick-replies-enter-from {
  opacity: 0;
  transform: translateY(30px) scale(0.9);
  filter: blur(2px);
}

.quick-replies-leave-to {
  opacity: 0;
  transform: translateY(-15px) scale(0.9);
  filter: blur(1px);
}

.quick-replies-enter-to,
.quick-replies-leave-from {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0px);
}

.quick-reply-enter-active {
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quick-reply-leave-active {
  transition: all 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53);
}

.quick-reply-enter-from {
  opacity: 0;
  transform: translateY(20px) scale(0.85) rotateZ(2deg);
  filter: blur(1px);
}

.quick-reply-leave-to {
  opacity: 0;
  transform: translateY(-8px) scale(0.9) rotateZ(-1deg);
  filter: blur(1px);
}

.quick-reply-enter-to,
.quick-reply-leave-from {
  opacity: 1;
  transform: translateY(0) scale(1) rotateZ(0deg);
  filter: blur(0px);
}

.quick-replies-fade-enter-active,
.quick-replies-fade-leave-active {
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quick-replies-fade-enter-from {
  opacity: 0;
  transform: translateY(25px) scale(0.95);
  max-height: 0;
  filter: blur(2px);
}

.quick-replies-fade-leave-to {
  opacity: 0;
  transform: translateY(-15px) scale(0.95);
  max-height: 0;
  filter: blur(1px);
}

.quick-replies-fade-enter-to,
.quick-replies-fade-leave-from {
  opacity: 1;
  transform: translateY(0) scale(1);
  max-height: 100px;
  filter: blur(0px);
}

/* ==========================================
   WEB SEARCH BUTTON
   ========================================== */

/* Web search button animations */
@keyframes webPulseImproved {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(var(--v-theme-primary), 0.5)) brightness(1);
  }
  25% {
    transform: scale(1.1) rotate(90deg);
    opacity: 0.9;
    filter: drop-shadow(0 0 12px rgba(var(--v-theme-primary), 0.7)) brightness(1.1);
  }
  50% {
    transform: scale(1.05) rotate(180deg);
    opacity: 0.8;
    filter: drop-shadow(0 0 15px rgba(var(--v-theme-primary), 0.8)) brightness(1.2);
  }
  75% {
    transform: scale(1.08) rotate(270deg);
    opacity: 0.9;
    filter: drop-shadow(0 0 12px rgba(var(--v-theme-primary), 0.7)) brightness(1.1);
  }
}

@keyframes webActiveHoverImproved {
  0% {
    transform: scale(1.1) rotate(-3deg);
    filter: drop-shadow(0 0 10px rgba(var(--v-theme-primary), 0.6)) brightness(1.1);
  }
  100% {
    transform: scale(1.2) rotate(3deg);
    filter: drop-shadow(0 0 16px rgba(var(--v-theme-primary), 0.8)) brightness(1.3);
  }
}

@keyframes webGlowImproved {
  0%, 100% {
    box-shadow: 
      0 0 20px rgba(var(--v-theme-primary), 0.4),
      0 4px 15px rgba(var(--v-theme-primary), 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow: 
      0 0 30px rgba(var(--v-theme-primary), 0.6),
      0 6px 20px rgba(var(--v-theme-primary), 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.15);
  }
}

/* Web search button styling */
.web-search-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border-radius: 12px !important;
  backdrop-filter: blur(10px);
  min-width: 100px;

  &::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(
      circle, 
      rgba(var(--v-theme-primary), 0.15) 0%, 
      rgba(var(--v-theme-primary), 0.05) 50%,
      transparent 70%
    );
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 0;
    opacity: 0;
  }

  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      90deg, 
      transparent, 
      rgba(255, 255, 255, 0.1), 
      transparent
    );
    transition: left 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
  }

  &:hover::before {
    width: 140px;
    height: 140px;
    opacity: 1;
  }

  &:hover::after {
    left: 100%;
  }

  &:hover {
    transform: scale(1.02);
  }

  &:active {
    transform: scale(0.98);
    transition: all 0.1s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  &:focus {
    outline: none;
    box-shadow: 
      0 0 0 3px rgba(var(--v-theme-primary), 0.2),
      0 4px 15px rgba(var(--v-theme-primary), 0.1);
  }

  &:disabled {
    opacity: 0.5;
    transform: none;
    pointer-events: none;
  }

  &:disabled::before,
  &:disabled::after {
    display: none;
  }
}

/* Web icon styling */
.web-icon {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 2;
  position: relative;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.web-text {
  z-index: 2;
  position: relative;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.web-icon-active {
  animation: webPulseImproved 2.5s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(var(--v-theme-primary), 0.5));
}

.web-search-btn:hover .web-icon {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15)) brightness(1.1);
}

.web-search-btn:hover .web-text {
  transform: translateX(2px);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.web-search-btn:hover .web-icon-active {
  animation: webActiveHoverImproved 0.8s ease-in-out infinite alternate;
}

/* Web search button states */
.web-search-btn.web-search-active {
  background: linear-gradient(
    135deg, 
    rgba(var(--v-theme-primary), 0.9) 0%, 
    rgba(var(--v-theme-primary), 0.7) 100%
  ) !important;
  border: 2px solid rgba(var(--v-theme-primary), 0.3);
  box-shadow: 
    0 0 20px rgba(var(--v-theme-primary), 0.4),
    0 4px 15px rgba(var(--v-theme-primary), 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: webGlowImproved 3s ease-in-out infinite;

  .web-text {
    color: white !important;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  }

  .web-icon {
    color: white !important;
  }
}

.web-search-btn:not(.web-search-active) {
  background: rgba(var(--v-theme-surface), 0.8) !important;
  border: 1px solid rgba(var(--v-theme-outline), 0.2);
  backdrop-filter: blur(8px);
  box-shadow: none;

  &:hover {
    background: rgba(var(--v-theme-surface), 0.9) !important;
    border: 1px solid rgba(var(--v-theme-primary), 0.3);
    box-shadow: none;
  }
}

/* ==========================================
   FORM COMPONENTS
   ========================================== */

/* Form animations */
@keyframes form-appear {
  0% {
    opacity: 0;
    transform: scale(0.9) translateY(30px);
    filter: blur(2px);
  }
  70% {
    transform: scale(1.02) translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0px);
  }
}

@keyframes header-slide {
  0% {
    opacity: 0;
    transform: translateX(-30px);
  }
  60% {
    transform: translateX(5px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes title-fade {
  0% {
    opacity: 0;
    transform: translateY(15px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes step-title-slide {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes question-fade {
  0% {
    opacity: 0;
    transform: translateY(15px);
    filter: blur(1px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0px);
  }
}

@keyframes option-appear {
  0% {
    opacity: 0;
    transform: translateX(-25px) scale(0.9) rotateY(-10deg);
    filter: blur(1px);
  }
  60% {
    transform: translateX(3px) scale(1.02) rotateY(2deg);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1) rotateY(0deg);
    filter: blur(0px);
  }
}

@keyframes confirmation-slide {
  0% {
    opacity: 0;
    transform: translateY(25px) scale(0.95);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px);
  }
}

@keyframes data-highlight {
  0% {
    opacity: 0;
    background: rgba(var(--v-theme-on-surface), 0.02);
    transform: scale(0.95);
    border-color: rgba(var(--v-theme-primary), 0.05);
  }
  50% {
    background: rgba(var(--v-theme-primary), 0.08);
    border-color: rgba(var(--v-theme-primary), 0.2);
  }
  100% {
    opacity: 1;
    background: rgba(var(--v-theme-on-surface), 0.05);
    transform: scale(1);
    border-color: rgba(var(--v-theme-primary), 0.1);
  }
}

@keyframes item-fade {
  0% {
    opacity: 0;
    transform: translateX(-15px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes actions-appear {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes step-container-appear {
  0% {
    opacity: 0;
    transform: scale(0.9) translateY(30px);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0px);
  }
}

@keyframes step-item-appear {
  0% {
    opacity: 0;
    transform: translateX(-25px) scale(0.9);
    filter: blur(1px);
  }
  60% {
    transform: translateX(3px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0px);
  }
}

@keyframes simple-form-appear {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes gentle-pulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(var(--v-theme-primary), 0.2);
  }
  50% {
    box-shadow: 0 4px 15px rgba(var(--v-theme-primary), 0.4);
  }
}

/* Multi-form container */
.multi-form-container {
  max-width: 100%;
  animation: form-appear 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0;
  animation-fill-mode: forwards;

  .multi-form-header {
    border-bottom: 1px solid rgba(var(--v-theme-on-surface), 0.1);
    padding-bottom: 12px;
    animation: header-slide 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s;
    opacity: 0;
    animation-fill-mode: forwards;
  }

  .form-title {
    font-size: 1.1rem;
    color: rgb(var(--v-theme-on-surface));
    animation: title-fade 0.5s ease-out 0.2s;
    opacity: 0;
    animation-fill-mode: forwards;
  }

  .step-title {
    font-size: 0.95rem;
    color: rgba(var(--v-theme-on-surface), 0.8);
    animation: step-title-slide 0.5s ease-out 0.3s;
    opacity: 0;
    animation-fill-mode: forwards;
  }

  .form-question {
    font-size: 0.9rem;
    line-height: 1.4;
    animation: question-fade 0.6s ease-out 0.4s;
    opacity: 0;
    animation-fill-mode: forwards;
  }

  .form-options {
    .form-option-btn {
      margin-bottom: 8px;
      border-radius: 12px;
      text-transform: none;
      transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
      animation: option-appear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
      opacity: 0;
      animation-fill-mode: forwards;
      transform: translateX(-25px) scale(0.9);
      position: relative;
      overflow: hidden;

      /* Staggered animations for each option */
      &:nth-child(1) { animation-delay: 0.5s; }
      &:nth-child(2) { animation-delay: 0.6s; }
      &:nth-child(3) { animation-delay: 0.7s; }
      &:nth-child(4) { animation-delay: 0.8s; }
      &:nth-child(5) { animation-delay: 0.9s; }
      &:nth-child(6) { animation-delay: 1.0s; }

      &::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s ease;
        z-index: 1;
      }

      &:hover {
        transform: translateY(-4px) scale(1.05);
        box-shadow: 0 8px 25px rgba(var(--v-theme-primary), 0.25);
        z-index: 1;
        position: relative;
      }

      &:hover::before {
        left: 100%;
      }

      &:active {
        transform: translateY(-2px) scale(1.02);
        transition: all 0.1s ease;
      }
    }
  }
}

/* Confirmation container */
.confirmation-container {
  max-width: 100%;
  animation: confirmation-slide 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
  animation-fill-mode: forwards;

  .form-title {
    font-size: 1.1rem;
    color: rgb(var(--v-theme-on-surface));
    animation: title-fade 0.5s ease-out 0.1s;
    opacity: 0;
    animation-fill-mode: forwards;
  }

  .confirmation-data {
    background: rgba(var(--v-theme-on-surface), 0.05);
    border-radius: 12px;
    padding: 16px;
    animation: data-highlight 0.8s ease-out 0.3s;
    opacity: 0;
    animation-fill-mode: forwards;
    border: 1px solid rgba(var(--v-theme-primary), 0.1);

    .data-item {
      font-size: 0.9rem;
      line-height: 1.5;
      animation: item-fade 0.4s ease-out;
      opacity: 0;
      animation-fill-mode: forwards;

      &:nth-child(1) { animation-delay: 0.5s; }
      &:nth-child(2) { animation-delay: 0.6s; }
      &:nth-child(3) { animation-delay: 0.7s; }
      &:nth-child(4) { animation-delay: 0.8s; }

      span:first-child {
        color: rgba(var(--v-theme-on-surface), 0.8);
        font-weight: 500;
      }

      span:last-child {
        color: rgb(var(--v-theme-on-surface));
        font-weight: 400;
      }
    }
  }

  .confirmation-actions {
    animation: actions-appear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s;
    opacity: 0;
    animation-fill-mode: forwards;

    .v-btn {
      text-transform: none;
      border-radius: 10px;
      transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      position: relative;
      overflow: hidden;

      &::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s ease;
        z-index: 1;
      }

      &:hover {
        transform: translateY(-3px) scale(1.03);
        box-shadow: 0 8px 25px rgba(var(--v-theme-primary), 0.3);
      }

      &:hover::before {
        left: 100%;
      }

      &:first-child {
        animation: gentle-pulse 2s ease-in-out infinite;
      }
    }
  }
}

/* Step selection container */
.step-selection-container {
  max-width: 100%;
  animation: step-container-appear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
  animation-fill-mode: forwards;

  .form-title {
    font-size: 1.1rem;
    color: rgb(var(--v-theme-on-surface));
    animation: title-fade 0.5s ease-out 0.1s;
    opacity: 0;
    animation-fill-mode: forwards;
  }

  .steps-list {
    .v-btn {
      text-transform: none;
      border-radius: 12px;
      padding: 16px 20px;
      transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
      animation: step-item-appear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
      opacity: 0;
      animation-fill-mode: forwards;
      margin-bottom: 8px;
      position: relative;
      overflow: hidden;

      &:nth-child(1) { animation-delay: 0.2s; }
      &:nth-child(2) { animation-delay: 0.3s; }
      &:nth-child(3) { animation-delay: 0.4s; }
      &:nth-child(4) { animation-delay: 0.5s; }

      &::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s ease;
        z-index: 1;
      }

      &:hover {
        transform: translateY(-4px) scale(1.02);
        box-shadow: 0 8px 30px rgba(var(--v-theme-primary), 0.25);
      }

      &:hover::before {
        left: 100%;
      }
    }
  }
}

/* Simple form container */
.form-container {
  animation: simple-form-appear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
  animation-fill-mode: forwards;

  .form-title {
    animation: title-fade 0.5s ease-out 0.1s;
    opacity: 0;
    animation-fill-mode: forwards;
  }

  .form-question {
    animation: question-fade 0.5s ease-out 0.2s;
    opacity: 0;
    animation-fill-mode: forwards;
  }

  .form-options {
    .form-option-btn {
      animation: option-appear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
      opacity: 0;
      animation-fill-mode: forwards;
      margin-bottom: 8px;
      border-radius: 10px;
      transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
      position: relative;
      overflow: hidden;

      &:nth-child(1) { animation-delay: 0.3s; }
      &:nth-child(2) { animation-delay: 0.4s; }
      &:nth-child(3) { animation-delay: 0.5s; }
      &:nth-child(4) { animation-delay: 0.6s; }

      &::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s ease;
        z-index: 1;
      }

      &:hover {
        transform: translateY(-3px) scale(1.05);
        box-shadow: 0 6px 20px rgba(var(--v-theme-primary), 0.2);
      }

      &:hover::before {
        left: 100%;
      }
    }
  }
}

/* ==========================================
   WELCOME MESSAGE
   ========================================== */

.welcome-message {
  width: 100%;
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgb(var(--v-theme-on-surface));
  z-index: 9;
  animation: welcome-float 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================
   UNDO POPUP
   ========================================== */

.undo-popup {
  z-index: 9999 !important;

  .v-snackbar__wrapper {
    min-width: 300px !important;
    max-width: 400px !important;
    animation: undo-slide-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .v-snackbar__content {
    padding: 12px 16px !important;
  }

  .v-btn:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    transform: scale(1.05);
  }
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 600px) {
  /* Main layout adjustments */
  .message-bubble {
    max-width: 90%;
  }

  .welcome-message {
    top: 15%;

    h2 {
      font-size: 1.75rem !important;
    }
  }

  .bottom-input {
    padding: 0 10px 10px;
  }

  /* Toolbar adjustments */
  .toolbar-buttons {
    flex-wrap: wrap;
    gap: 4px !important;
  }

  .web-search-btn,
  .model-select-btn {
    min-width: auto;
    padding: 0 8px;
  }

  .web-search-btn {
    min-width: 60px;
    padding: 8px 12px;

    &:hover {
      transform: scale(1.01);
    }
  }

  /* Form adjustments */
  .multi-form-container,
  .confirmation-container,
  .step-selection-container {
    .form-options .form-option-btn,
    .confirmation-actions .v-btn,
    .steps-list .v-btn {
      width: 100%;
      margin-bottom: 12px;
    }
  }

  .form-options .form-option-btn {
    &:hover {
      transform: translateY(-2px) scale(1.02);
    }
  }

  .confirmation-container {
    .confirmation-actions {
      flex-direction: column;

      .v-btn {
        width: 100%;
      }
    }
  }

  .step-selection-container {
    .steps-list {
      .v-btn {
        width: 100%;
      }
    }
  }

  /* Quick replies adjustments */
  .quick-replies-container {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Suggestions adjustments */
  .suggestions-dropdown {
    max-height: 200px;
  }

  .suggestion-text {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .toolbar-buttons {
    gap: 0 !important;
  }

  .input-toolbar {
    flex-wrap: nowrap;
  }
}

/* ==========================================
   DARK MODE OPTIMIZATIONS
   ========================================== */

@media (prefers-color-scheme: dark) {
  .web-search-btn:not(.web-search-active) {
    background: rgba(var(--v-theme-surface), 0.6) !important;
    border: 1px solid rgba(var(--v-theme-outline), 0.3);
  }
  
  .web-search-btn::before {
    background: radial-gradient(
      circle, 
      rgba(var(--v-theme-primary), 0.2) 0%, 
      rgba(var(--v-theme-primary), 0.1) 50%,
      transparent 70%
    );
  }
}

.quick-replies-fade-leave-active {
 transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

.quick-replies-fade-leave-to {
 opacity: 0;
 transform: translateY(-8px);
}

.quick-replies-container {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
 grid-gap: 8px;
 margin-bottom: 8px;
 width: 100%;
 margin-top: 1rem !important;
 animation: replies-container-appear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================
   INPUT COMPONENTS - SMOOTH SINGLE PHASE
   ========================================== */

/* Input wrapper positioning - حذف کامل transition اضافی */
.input-wrapper {
  /* حذف transition - Vue خودش handle می‌کنه */
  transform-origin: center bottom;
}

.centered-input {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 700px;
  z-index: 10;
  animation: center-input-appear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-input {
  position: relative;
  padding: 0 20px 20px;
  width: 100%;
  animation: bottom-input-slide 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Chat input container - فوق العاده نرم */
.chat-input-container {
  border: 1px solid v-bind("`rgba(var(--v-theme-${activeModelColor}), 0.5)`");
  background-color: rgb(var(--v-theme-surface));
  transition: all 0.45s cubic-bezier(0.23, 1, 0.32, 1);
  border-radius: 15px;
  width: 100%;
  border: 1px solid rgba(var(--v-theme-primary), 0.5);
  transform: translateZ(0);
  will-change: transform, box-shadow;

  &:hover,
  &:focus-within {
    border-color: v-bind("`rgb(var(--v-theme-${activeModelColor}))`");
    box-shadow: v-bind("`0 0 0 2px rgba(var(--v-theme-${activeModelColor}), 0.25)`");
    transform: translateY(-1px) scale(1.005) translateZ(0);
    transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
  }
}

/* ==========================================
   QUICK REPLIES COMPONENTS - ULTRA SMOOTH SINGLE PHASE
   ========================================== */

.quick-replies-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  grid-gap: 8px;
  margin-bottom: 8px;
  width: 100%;
  margin-top: 1rem !important;
  animation: replies-container-appear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateZ(0);
  will-change: transform, opacity, max-height;
}

.quick-replies-fade-enter-active {
  transition: all 0.45s cubic-bezier(0.23, 1, 0.32, 1);
}

.quick-replies-fade-leave-active {
  transition: all 0.45s cubic-bezier(0.23, 1, 0.32, 1);
}

.quick-replies-fade-enter-from {
  opacity: 0;
  transform: translateY(-8px) scaleY(0.3);
  max-height: 0;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  transform-origin: top center;
}

.quick-replies-fade-leave-to {
  opacity: 0;
  transform: translateY(-8px) scaleY(0.3);
  max-height: 0;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  transform-origin: top center;
}

.quick-replies-fade-enter-to,
.quick-replies-fade-leave-from {
  opacity: 1;
  transform: translateY(0) scaleY(1);
  max-height: 250px;
  margin-top: 1rem !important;
  margin-bottom: 8px !important;
  transform-origin: top center;
}

.quick-replies-wrapper {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
}

.quick-reply-enter-active {
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quick-reply-leave-active {
  transition: all 0.3s cubic-bezier(0.55, 0.085, 0.68, 0.53);
}

.quick-reply-enter-from {
  opacity: 0;
  transform: translateY(15px) scale(0.9) rotateZ(1deg);
  filter: blur(1px);
}

.quick-reply-leave-to {
  opacity: 0;
  transform: translateY(-5px) scale(0.95) rotateZ(-0.5deg);
  filter: blur(1px);
}

.quick-reply-enter-to,
.quick-reply-leave-from {
  opacity: 1;
  transform: translateY(0) scale(1) rotateZ(0deg);
  filter: blur(0px);
}

/* ==========================================
   RESPONSIVE DESIGN - UPDATED
   ========================================== */

@media (max-width: 600px) {
  .bottom-input {
    padding: 0 10px 10px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  .quick-replies-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 0.8rem !important;
  }

  .quick-replies-fade-enter-to,
  .quick-replies-fade-leave-from {
    margin-top: 0.8rem !important;
  }
}