/* AI Music Agent Chat Widget Styles */
.ai-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
}

.ai-chat-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.ai-chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.ai-chat-icon {
    font-size: 20px;
}

.ai-chat-label {
    font-weight: 600;
}

.ai-chat-container {
    width: 380px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin-top: 15px;
    animation: slideUp 0.3s ease;
}

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

.ai-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-title {
    display: flex;
    flex-direction: column;
}

.ai-chat-title strong {
    font-size: 16px;
    font-weight: 700;
}

.ai-chat-title small {
    font-size: 12px;
    opacity: 0.9;
}

.ai-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background 0.2s;
}

.ai-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.ai-message {
    margin-bottom: 15px;
    display: flex;
}

.ai-message.ai-user {
    justify-content: flex-end;
}

.ai-message.ai-assistant {
    justify-content: flex-start;
}

.ai-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.4;
    word-wrap: break-word;
}

.ai-user .ai-message-content {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 5px;
}

.ai-assistant .ai-message-content {
    background: white;
    color: #333;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 5px;
}

.ai-chat-quick-actions {
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ai-quick-action {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    min-width: 120px;
}

.ai-quick-action:hover {
    background: #e9ecef;
    border-color: #667eea;
    color: #667eea;
}

.ai-chat-input {
    padding: 15px 20px;
    background: white;
    display: flex;
    gap: 10px;
}

.ai-chat-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.ai-chat-input input:focus {
    border-color: #667eea;
}

.ai-chat-input button {
    background: #667eea;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s;
}

.ai-chat-input button:hover {
    background: #5a67d8;
}

.ai-chat-footer {
    padding: 10px 20px;
    background: #f8f9fa;
    text-align: center;
    font-size: 11px;
    color: #6c757d;
    border-top: 1px solid #e9ecef;
}

/* Responsive */
@media (max-width: 480px) {
    .ai-chat-widget {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .ai-chat-container {
        width: 100%;
    }
    
    .ai-chat-toggle {
        justify-content: center;
    }
}

/* Scrollbar styling */
.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Typing indicator animation */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    height: 20px;
}

.typing-indicator .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #667eea;
    margin: 0 2px;
    opacity: 0.6;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* ==================== QA Mode Styles ==================== */

/* QA Progress Bar */
.ai-qa-progress {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-qa-progress-bar {
  width: 100%;
  height: 8px;
  background-color: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.ai-qa-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50 0%, #45a049 100%);
  transition: width 0.5s ease-in-out;
  border-radius: 4px;
}

.ai-qa-progress-text {
  font-size: 12px;
  color: #666;
  text-align: center;
  font-weight: 600;
}

/* QA Question */
.ai-qa-question-container {
  background: #ffffff;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  animation: slideIn 0.3s ease-out;
}

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

.ai-qa-question {
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.4;
}

/* QA Options (Buttons A/B/C) */
.ai-qa-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  margin: 0 auto;
}

.ai-qa-option {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 15px;
  font-weight: 600;
  color: #2c3e50;
  text-align: left;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ai-qa-option:hover {
  border-color: #4CAF50;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.ai-qa-option:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ai-qa-option-label {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 800;
  margin-right: 16px;
  flex-shrink: 0;
}

.ai-qa-option-text {
  flex: 1;
  line-height: 1.3;
}

/* QA Loading */
.ai-qa-loading {
  text-align: center;
  padding: 40px 20px;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity:1; }
}

.ai-qa-loading .typing-indicator {
  margin-bottom: 16px;
}

.ai-qa-loading-text {
  color: #666;
  font-size: 16px;
  line-height: 1.5;
}

/* QA Intro */
.ai-qa-intro {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-radius: 12px;
  margin-bottom: 20px;
  animation: slideIn 0.3s ease-out;
}

.ai-qa-intro-title {
  font-size: 18px;
  font-weight: 700;
  color: #1565c0;
  margin-bottom: 8px;
}

/* Recommendation Sections */
.ai-recommendation-section {
  background: #ffffff;
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  animation: slideIn 0.4s ease-out;
}

.ai-recommendation-main {
  border-left: 4px solid #4CAF50;
  background: linear-gradient(135deg, #ffffff 0%, #f1f8e9 100%);
}

.ai-recommendation-alternatives {
  border-left: 4px solid #2196F3;
}

.ai-recommendation-upsell {
  border-left: 4px solid #FF9800;
  background: linear-gradient(135deg, #ffffff 0%, #fff3e0 100%);
}

.ai-recommendation-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Recommendation List */
.ai-recommendation-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
  gap: 12px;
}

/* Product Cards */
.ai-product-card {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  background: #ffffff;
}

.ai-product-card:hover {
  border-color: #4CAF50;
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.2);
}

.ai-product-card-main {
  border-width: 3px;
  border-color: #4CAF50;
}

.ai-product-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.ai-product-image {
  width: 100%;
  height: 180px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.ai-product-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.ai-product-card:hover .ai-product-image img {
  transform: scale(1.05);
}

.ai-product-info {
  padding: 16px;
}

.ai-product-name {
  font-size: 14px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 8px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-product-price {
  font-size: 18px;
  font-weight: 800;
  color: #4CAF50;
  margin-bottom: 8px;
}

.ai-product-reason {
  font-size: 13px;
  color: #666;
  background: #f5f5f5;
  padding: 8px;
  border-radius: 6px;
  line-height: 1.4;
}

.ai-product-action {
  padding: 12px 16px;
  border-top: 1px solid #e0e0e0;
}

.ai-product-btn {
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2);
}

.ai-product-btn:hover {
  background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

/* QA Actions */
.ai-qa-actions {
  text-align: center;
  padding: 20px;
}

.ai-qa-restart-btn {
  padding: 14px 28px;
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(33, 150, 243, 0.2);
}

.ai-qa-restart-btn:hover {
  background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(33, 150, 243, 0.3);
}

/* QA Error */
.ai-qa-error {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
  border-radius: 16px;
  animation: slideIn 0.3s ease-out;
}

.ai-qa-error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.ai-qa-error-message {
  font-size: 16px;
  color: #c62828;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 480px) {
  .ai-qa-options {
    gap: 8px;
  }
  
  .ai-qa-option {
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .ai-qa-option-label {
    width: 32px;
    height: 32px;
    font-size: 16px;
    margin-right: 12px;
  }
  
  .ai-qa-question {
    font-size: 16px;
  }
  
  .ai-recommendation-list {
    grid-template-columns: 1fr;
  }
  
  .ai-product-image {
    height: 150px;
  }
}
