/* ============================================
   AI BUBBLE COMPONENT - Enhanced
   EXACTLY matching iOS AIBubbleComponent.swift
   ============================================ */

/* Bubble Container */
.ai-bubble-container {
  position: relative;
  z-index: 100;
}

/* Avatar Button with 8-Color Multicolored Gradient Border */
.ai-bubble-avatar-button {
  position: relative;
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

/* Avatar Background Circle */
.avatar-background {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--modern-card-background);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 8-Color Multicolored Gradient Border */
.avatar-gradient-border {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    #FF6F61 0%,      /* Coral (Urgent) */
    #FFD700 12.5%,   /* Gold (High) */
    #50C878 25%,     /* Emerald (Medium) */
    #1A7FE6 37.5%,   /* Cerulean Blue (Medium-Low) */
    #1A7FE6 50%,     /* App Primary */
    #FF6F61 62.5%,   /* Coral repeat */
    #FFD700 75%,     /* Gold repeat */
    #50C878 87.5%,   /* Emerald repeat */
    #1A7FE6 100%     /* Finish */
  );
  padding: 2.5px;
  animation: gradient-rotate 8s linear infinite;
}

@keyframes gradient-rotate {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* Avatar Content */
.avatar-content {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--modern-card-background);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2.5px;
}

.broker-avatar {
  font-size: 24px;
}

/* Notification Dot */
.notification-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #FF3B30;
  border: 2px solid white;
  animation: dot-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes dot-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

/* Wiggle Animation (matching iOS) */
.ai-bubble-avatar-button.wiggle {
  animation: wiggle 2s ease-in-out 3;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  10%, 30%, 50%, 70%, 90% { transform: rotate(-5deg); }
  20%, 40%, 60%, 80% { transform: rotate(5deg); }
}

/* Expanded Bubble */
.ai-bubble-expanded {
  position: absolute;
  top: 0;
  left: 0;
  width: 320px;
  max-width: calc(100vw - 40px);
  z-index: 101;
  opacity: 0;
  transform: scale(0.1);
  transform-origin: top left;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.ai-bubble-expanded.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

/* Bubble Content Card */
.bubble-content-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(26, 127, 230, 0.2);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

/* Bubble Header */
.bubble-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(26, 127, 230, 0.1);
}

.bubble-avatar-small {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brokerly-primary), var(--brokerly-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.bubble-info {
  flex: 1;
}

.broker-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  margin-bottom: 2px;
}

.broker-subtitle {
  font-size: 11px;
  font-weight: 400;
  color: var(--brokerly-text-secondary);
}

.bubble-close-button {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--brokerly-text-tertiary);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.bubble-close-button:hover {
  background: rgba(128, 128, 128, 0.1);
}

/* Bubble Message */
.bubble-message {
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--brokerly-text-primary);
}

/* Bubble Actions */
.bubble-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(26, 127, 230, 0.1);
}

.bubble-chat-button {
  flex: 1;
  padding: 8px 16px;
  background: var(--brokerly-primary);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.bubble-chat-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(26, 127, 230, 0.3);
}

.bubble-chat-button svg {
  width: 14px;
  height: 14px;
}

.bubble-dismiss-button {
  padding: 8px 16px;
  background: rgba(128, 128, 128, 0.1);
  border: none;
  border-radius: 12px;
  color: var(--brokerly-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bubble-dismiss-button:hover {
  background: rgba(128, 128, 128, 0.15);
}

/* ============================================
   RESPONSIVE - Mobile Optimizations
   ============================================ */
@media (max-width: 768px) {
  .ai-bubble-expanded {
    width: 280px;
  }

  .bubble-message {
    font-size: 13px;
    padding: 14px;
  }

  .bubble-actions {
    padding: 10px 14px;
  }

  .bubble-chat-button,
  .bubble-dismiss-button {
    font-size: 12px;
    padding: 6px 12px;
  }

  /* Thinking steps mobile adjustments */
  .thinking-step {
    width: 98%;
    padding: 12px 14px 12px 48px;
    min-height: 56px;
  }
  
  .step-icon-container {
    width: 30px;
    height: 30px;
    top: 12px;
    left: 10px;
  }
  
  .step-icon {
    font-size: 15px;
  }

  .step-title {
    font-size: 14px;
  }

  .step-description {
    font-size: 12px;
    line-height: 1.5;
  }
  
  .step-duration {
    font-size: 11px;
    padding: 3px 6px;
  }

  /* Step-by-step view mobile adjustments */
  .step-by-step-container {
    padding: 20px 16px;
    gap: 24px;
  }
  
  .ai-avatar-gradient-border {
    width: 72px;
    height: 72px;
  }
  
  .step-by-step-intro {
    font-size: 16px;
  }
  
  .step-row {
    width: 98%;
    padding: 14px 16px 14px 50px;
    border-radius: 16px;
    min-height: 56px;
  }
  
  .step-number-circle {
    width: 30px;
    height: 30px;
    top: 12px;
    left: 12px;
  }

  .step-number {
    font-size: 14px;
  }
  
  .step-content-wrapper {
    gap: 8px;
  }
  
  .step-title {
    font-size: 15px;
  }
  
  .step-description {
    font-size: 13px;
  }
  
  /* Action buttons mobile */
  .create-tender-btn,
  .set-budget-btn-action {
    padding: 10px 14px;
    font-size: 13px;
    gap: 8px;
  }
  
  .flip-back-button {
    padding: 14px 24px;
    font-size: 14px;
  }
  
  /* Thinking header mobile */
  .thinking-header {
    padding: 12px 16px;
  }
  
  .thinking-title {
    font-size: 14px;
  }
  
  .thinking-progress-text {
    font-size: 12px;
    padding: 5px 12px;
  }
}


/* Global AI Bubble (appears above chat tab) */
.global-ai-bubble {
  position: fixed;
  width: 320px;
  max-width: calc(100vw - 40px);
  z-index: 10000;
  animation: bubbleSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.global-ai-bubble.fade-out {
  animation: bubbleFadeOut 0.3s ease-out forwards;
}

@keyframes bubbleSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bubbleFadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* Avatar Images */
.broker-avatar-img,
.broker-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.broker-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brokerly-primary) 0%, rgba(26, 127, 230, 0.8) 100%);
  color: white;
  font-size: 18px;
  font-weight: 600;
}

/* ============================================
   AI THINKING STEPS - Enhanced Glassmorphism
   ============================================ */

.ai-thinking-steps {
  width: 100%;
  padding: 0;
}

.thinking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

.thinking-header:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.12) 100%);
  transform: scale(1.01);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.thinking-header-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.thinking-title {
  color: rgba(255, 255, 255, 1);
  font-size: 15px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.01em;
}

.thinking-icon-complete {
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.thinking-chevron {
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  color: rgba(255, 255, 255, 0.85);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
}

.thinking-chevron.expanded {
  transform: rotate(180deg);
}

.thinking-progress {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 14px;
  padding: 0 8px;
}

.thinking-progress-text {
  color: rgba(255, 255, 255, 1);
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.15) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.thinking-steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.thinking-step {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 14px 16px 14px 52px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  width: 98%;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), inset 0 1px 2px rgba(255, 255, 255, 0.1);
  opacity: 0;
  transform: scale(0.95);
  animation: gentleReveal 0.4s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
  position: relative;
  min-height: 60px;
}

.thinking-step:nth-child(1) { animation-delay: 0ms; }
.thinking-step:nth-child(2) { animation-delay: 100ms; }
.thinking-step:nth-child(3) { animation-delay: 200ms; }
.thinking-step:nth-child(4) { animation-delay: 300ms; }
.thinking-step:nth-child(5) { animation-delay: 400ms; }
.thinking-step:nth-child(6) { animation-delay: 500ms; }

@keyframes gentleReveal {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.thinking-step.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.12) 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2), 0 8px 24px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.15);
  animation: subtlePulse 2s cubic-bezier(0.4, 0.0, 0.2, 1) infinite;
}

@keyframes subtlePulse {
  0%, 100% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(1.01) translateY(-1px);
  }
}

.thinking-step.past {
  opacity: 0.88;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.06) 100%);
}

.step-icon-container {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.2);
  z-index: 1;
}

.step-icon {
  font-size: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.step-icon.rotating {
  animation: rotateGear 2s linear infinite;
}

@keyframes rotateGear {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.step-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.step-title {
  color: rgba(255, 255, 255, 1);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.01em;
}

.step-description {
  color: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  line-height: 1.5;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.step-duration {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 600;
  align-self: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 8px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* ============================================
   STEP-BY-STEP VIEW - Enhanced Glassmorphism
   ============================================ */

.step-by-step-container {
  width: 100%;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.step-by-step-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
}

.step-by-step-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
}

.ai-avatar-gradient-border {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    #FF6F61 0%,
    #FFD700 12.5%,
    #50C878 25%,
    #1A7FE6 37.5%,
    #9B59B6 50%,
    #FF6F61 62.5%,
    #FFD700 75%,
    #50C878 87.5%,
    #1A7FE6 100%
  );
  padding: 3.5px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1);
  animation: avatarPulse 3s cubic-bezier(0.4, 0.0, 0.2, 1) infinite;
}

@keyframes avatarPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(255, 255, 255, 0.15);
  }
}

.ai-avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--modern-card-background);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ai-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.step-by-step-intro {
  color: rgba(255, 255, 255, 1);
  font-size: 17px;
  line-height: 1.5;
  margin: 0;
  max-width: 420px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.step-by-step-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.step-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.1) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 16px 18px 16px 54px;
  border-radius: 18px;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  width: 98%;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), inset 0 1px 2px rgba(255, 255, 255, 0.1);
  cursor: default;
  position: relative;
  min-height: 60px;
}

.step-row:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.14) 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.step-number-circle {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  z-index: 1;
}

.step-row:hover .step-number-circle {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.25);
}

.step-number {
  color: rgba(255, 255, 255, 1);
  font-size: 15px;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.step-content-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-title {
  color: rgba(255, 255, 255, 1);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.01em;
}

.step-description {
  color: rgba(255, 255, 255, 0.95);
  font-size: 14px;
  line-height: 1.6;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

/* Ensure all step titles are white */
.thinking-step .step-title,
.step-row .step-title,
.step-by-step-container .step-title {
  color: rgba(255, 255, 255, 1) !important;
}

/* Markdown formatting within steps */
.step-title strong,
.step-description strong,
.step-content strong {
  font-weight: 700;
  color: rgba(255, 255, 255, 1);
}

.step-title em,
.step-description em,
.step-content em {
  font-style: italic;
}

.step-title code,
.step-description code,
.step-content code {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.95);
}

.step-description a,
.step-content a {
  color: #57CCEA;
  text-decoration: underline;
}

.step-description a:hover,
.step-content a:hover {
  color: #6DD5FA;
}

/* ============================================
   ACTION BUTTONS - Enhanced Glassmorphism
   ============================================ */

.create-tender-btn,
.set-budget-btn-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.01em;
}

.create-tender-btn {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.85) 0%, rgba(5, 150, 105, 0.8) 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

.create-tender-btn:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.95) 0%, rgba(5, 150, 105, 0.9) 100%);
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3), 0 6px 18px rgba(16, 185, 129, 0.45), inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.create-tender-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.set-budget-btn-action {
  background: linear-gradient(135deg, rgba(26, 127, 230, 0.85) 0%, rgba(13, 79, 140, 0.8) 100%);
  box-shadow: 0 4px 12px rgba(26, 127, 230, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

.set-budget-btn-action:hover {
  background: linear-gradient(135deg, rgba(26, 127, 230, 0.95) 0%, rgba(13, 79, 140, 0.9) 100%);
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px rgba(26, 127, 230, 0.3), 0 6px 18px rgba(26, 127, 230, 0.45), inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.set-budget-btn-action:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(26, 127, 230, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.create-tender-btn svg,
.set-budget-btn-action svg {
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

/* ============================================
   FLIP BACK BUTTON - Enhanced
   ============================================ */

.flip-back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.12) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  color: rgba(255, 255, 255, 1);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  margin-top: 20px;
  width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), inset 0 1px 2px rgba(255, 255, 255, 0.15);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.02em;
}

.flip-back-button:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.18) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
}

.flip-back-button:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.flip-back-button svg {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
}

/* ============================================
   THINKING RESULT - Enhanced
   ============================================ */

.thinking-result {
  margin-top: 18px;
  padding: 18px;
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.1);
  animation: resultReveal 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

@keyframes resultReveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.thinking-result.error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.15) 100%);
  border: 1px solid rgba(239, 68, 68, 0.4);
  animation: errorPulse 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

@keyframes errorPulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3), 0 4px 12px rgba(239, 68, 68, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.15);
  }
}

.thinking-result.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.15) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  animation: successFlash 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

@keyframes successFlash {
  0% {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.4) 0%, rgba(16, 185, 129, 0.3) 100%);
  }
  100% {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.15) 100%);
  }
}

.result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.result-icon-error {
  color: #EF4444;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.result-title {
  color: rgba(255, 255, 255, 1);
  font-size: 15px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.result-message {
  color: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  line-height: 1.5;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.result-content {
  color: rgba(255, 255, 255, 0.95);
  font-size: 14px;
  line-height: 1.6;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

/* ============================================
   AI RESPONSE WRAPPER
   ============================================ */

.ai-response-wrapper {
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
  padding: 8px;
}

.ai-response-placeholder {
  color: rgba(255, 255, 255, 0.6);
  font-size: 15px;
  text-align: center;
  padding: 40px 20px;
}
