/* StoreCraft AI Assistant Styles - Awesome Redesign */

/* AI Assistant Button */
.ai-assistant-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4), 0 0 20px rgba(102, 126, 234, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  animation: aiButtonGlow 3s ease-in-out infinite;
}

@keyframes aiButtonGlow {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4), 0 0 20px rgba(102, 126, 234, 0.2);
  }
  50% {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.6), 0 0 30px rgba(102, 126, 234, 0.4);
  }
}

.ai-assistant-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.ai-assistant-btn:hover::before {
  left: 100%;
}

.ai-assistant-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6), 0 0 40px rgba(102, 126, 234, 0.4);
}

.ai-assistant-btn i {
  margin-right: 8px;
  animation: aiSparkle 2s ease-in-out infinite;
}

@keyframes aiSparkle {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.1) rotate(-5deg);
  }
  75% {
    transform: scale(1.1) rotate(5deg);
  }
}

/* AI Modal */
.ai-modal {
  z-index: 10000;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
  animation: aiModalBackdrop 0.4s ease;
}

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

.ai-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none !important;
}

.ai-modal-content {
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
  border-radius: 24px;
  box-shadow: 0 25px 80px rgba(102, 126, 234, 0.3), 
              0 0 0 1px rgba(102, 126, 234, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: aiModalSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.ai-modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #667eea);
  background-size: 200% 100%;
  animation: aiGradientShift 3s linear infinite;
}

@keyframes aiGradientShift {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@keyframes aiModalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.9) rotateX(5deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0deg);
  }
}

.ai-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 36px;
  border-bottom: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-size: 200% 200%;
  color: white;
  border-radius: 24px 24px 0 0;
  position: relative;
  overflow: hidden;
  animation: aiHeaderGradient 5s ease infinite;
}

@keyframes aiHeaderGradient {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.ai-modal-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
  pointer-events: none;
}

.ai-modal-title {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.ai-modal-title i {
  font-size: 28px;
  animation: aiMagicFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

@keyframes aiMagicFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  25% {
    transform: translateY(-5px) rotate(-5deg) scale(1.05);
  }
  75% {
    transform: translateY(-5px) rotate(5deg) scale(1.05);
  }
}

.ai-modal-title h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  letter-spacing: -0.5px;
}

.ai-close-modal {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.ai-close-modal:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.ai-close-modal:active {
  transform: rotate(90deg) scale(0.95);
}

/* AI Modal Sections */
.ai-modal-section {
  padding: 32px;
}

.ai-modal-section.hidden {
  display: none;
}

/* Input Section */
.ai-input-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 8px 0;
}

.ai-language-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
}

.ai-language-selector:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.ai-language-selector label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #4a5568;
  font-size: 15px;
}

.ai-language-selector select {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid #cbd5e0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.ai-language-selector select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ai-prompt-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-prompt-container label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #2d3748;
  font-size: 17px;
}

.ai-prompt-container label i {
  color: #667eea;
  font-size: 18px;
}

.ai-prompt-input {
  width: 100%;
  padding: 18px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 15px;
  font-family: 'Outfit', sans-serif;
  resize: vertical;
  min-height: 140px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
  line-height: 1.6;
}

.ai-prompt-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 
              0 4px 12px rgba(102, 126, 234, 0.15);
  transform: translateY(-1px);
}

.ai-prompt-input::placeholder {
  color: #a0aec0;
  font-style: italic;
}

.ai-prompt-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #718096;
  font-size: 14px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #fff5e6 0%, #ffe8cc 100%);
  border-radius: 10px;
  border-left: 4px solid #f6ad55;
  font-weight: 500;
}

.ai-prompt-hint i {
  color: #f6ad55;
  font-size: 16px;
  animation: aiHintPulse 2s ease-in-out infinite;
}

@keyframes aiHintPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Example Prompts */
.ai-example-prompts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.ai-example-prompt {
  padding: 12px 16px;
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
  color: #4a5568;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.ai-example-prompt::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
  transition: left 0.5s;
}

.ai-example-prompt:hover {
  border-color: #667eea;
  background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.ai-example-prompt:hover::before {
  left: 100%;
}

.ai-example-prompt i {
  margin-right: 8px;
  color: #667eea;
  font-size: 12px;
}

.ai-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
  gap: 12px;
}

.btn-large {
  padding: 18px 40px;
  font-size: 17px;
  font-weight: 700;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-large:active {
  transform: translateY(0);
}

.btn-large i {
  margin-right: 10px;
  animation: aiButtonIcon 2s ease-in-out infinite;
}

@keyframes aiButtonIcon {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(10deg) scale(1.1);
  }
}

/* Generating Section */
.ai-generating-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 60px 32px;
  text-align: center;
  position: relative;
}

.ai-generating-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 50%, rgba(102, 126, 234, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.ai-generating-animation {
  font-size: 80px;
  color: #667eea;
  position: relative;
  animation: aiMagicSpin 3s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.4));
}

.ai-generating-animation::before {
  content: '✨';
  position: absolute;
  top: -20px;
  right: -20px;
  font-size: 30px;
  animation: aiSparkleRotate 2s linear infinite;
}

.ai-generating-animation::after {
  content: '✨';
  position: absolute;
  bottom: -20px;
  left: -20px;
  font-size: 30px;
  animation: aiSparkleRotate 2s linear infinite reverse;
}

@keyframes aiMagicSpin {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(90deg) scale(1.1);
  }
  50% {
    transform: rotate(180deg) scale(1);
  }
  75% {
    transform: rotate(270deg) scale(1.1);
  }
}

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

.ai-generating-container h3 {
  font-size: 28px;
  color: #2d3748;
  margin: 0;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: aiTextShimmer 3s ease-in-out infinite;
}

@keyframes aiTextShimmer {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.ai-generating-container p {
  color: #718096;
  font-size: 17px;
  margin: 0;
  font-weight: 500;
  max-width: 500px;
}

.ai-generating-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 450px;
  margin-top: 32px;
}

.ai-step {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f7fafc 0%, #ffffff 100%);
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.ai-step::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: width 0.5s ease;
}

.ai-step.active {
  background: linear-gradient(135deg, #edf2f7 0%, #f7fafc 100%);
  border-color: #667eea;
  color: #667eea;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
  transform: translateX(4px);
}

.ai-step.active::before {
  width: 4px;
}

.ai-step i {
  font-size: 24px;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

.ai-step.active i {
  animation: aiStepIconPulse 1.5s ease-in-out infinite;
  color: #667eea;
}

@keyframes aiStepIconPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

.ai-step span {
  font-weight: 600;
  color: #4a5568;
  position: relative;
  z-index: 1;
  font-size: 15px;
  transition: all 0.3s ease;
}

.ai-step.active span {
  color: #667eea;
  font-weight: 700;
}

/* Preview Section */
.ai-preview-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.ai-preview-header {
  text-align: center;
  padding-bottom: 28px;
  border-bottom: 2px solid #e2e8f0;
  position: relative;
}

.ai-preview-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 2px;
}

.ai-preview-header h3 {
  font-size: 28px;
  color: #2d3748;
  margin: 0 0 10px 0;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ai-preview-header p {
  color: #718096;
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.ai-preview-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-height: 450px;
  overflow-y: auto;
  padding: 20px;
  background: linear-gradient(135deg, #f7fafc 0%, #ffffff 100%);
  border-radius: 16px;
  border: 2px solid #e2e8f0;
  scrollbar-width: thin;
  scrollbar-color: #667eea #f7fafc;
}

.ai-preview-content::-webkit-scrollbar {
  width: 8px;
}

.ai-preview-content::-webkit-scrollbar-track {
  background: #f7fafc;
  border-radius: 4px;
}

.ai-preview-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 4px;
}

.ai-preview-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #764ba2, #667eea);
}

.ai-preview-store {
  padding: 24px;
  background: white;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  animation: aiPreviewSlideIn 0.5s ease;
}

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

.ai-preview-store:hover {
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

.ai-preview-store h3 {
  font-size: 20px;
  color: #2d3748;
  margin: 0 0 8px 0;
}

.ai-preview-description {
  color: #718096;
  margin: 0 0 12px 0;
  line-height: 1.6;
}

.ai-preview-details {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-preview-badge {
  padding: 6px 12px;
  background: #edf2f7;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #4a5568;
}

.ai-preview-categories,
.ai-preview-products {
  padding: 16px;
  background: white;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.ai-preview-categories h4,
.ai-preview-products h4 {
  font-size: 18px;
  color: #2d3748;
  margin: 0 0 16px 0;
}

.ai-preview-categories-list,
.ai-preview-products-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-preview-category {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: #f7fafc;
  border-radius: 6px;
}

.ai-preview-category strong {
  color: #2d3748;
  font-size: 15px;
}

.ai-preview-category span {
  color: #718096;
  font-size: 14px;
}

.ai-preview-product {
  padding: 12px;
  background: #f7fafc;
  border-radius: 6px;
}

.ai-preview-product-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-preview-product-info strong {
  color: #2d3748;
  font-size: 15px;
}

.ai-preview-product-category {
  color: #718096;
  font-size: 13px;
}

.ai-preview-product-price {
  color: #667eea;
  font-weight: 600;
  font-size: 16px;
  margin-top: 4px;
}

.ai-preview-more {
  text-align: center;
  color: #718096;
  font-size: 14px;
  font-style: italic;
  margin: 8px 0 0 0;
}

.ai-preview-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  padding-top: 28px;
  border-top: 2px solid #e2e8f0;
}

.ai-preview-actions .btn {
  min-width: 140px;
  padding: 14px 24px;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.ai-preview-actions .btn-primary {
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.ai-preview-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.ai-preview-actions .btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ai-preview-actions .btn-outline:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .ai-modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .ai-modal-header {
    padding: 20px;
  }

  .ai-modal-section {
    padding: 24px 20px;
  }

  .ai-preview-actions {
    flex-direction: column;
  }

  .ai-preview-actions .btn {
    width: 100%;
  }
}

/* Loading States */
.ai-generating-container .ai-step {
  opacity: 0.6;
}

.ai-generating-container .ai-step.active {
  opacity: 1;
}

/* Character Counter */
.ai-char-counter {
  text-align: right;
  font-size: 13px;
  color: #a0aec0;
  margin-top: 4px;
  font-weight: 500;
}

.ai-char-counter.warning {
  color: #f6ad55;
}

.ai-char-counter.error {
  color: #fc8181;
}

/* Success Animation */
.ai-success-checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  color: white;
  font-size: 40px;
  animation: aiSuccessPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 8px 25px rgba(72, 187, 120, 0.4);
}

@keyframes aiSuccessPop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Enhanced Product Cards */
.ai-preview-product {
  padding: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.ai-preview-product:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
  transform: translateX(4px);
}

/* Shake Animation */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

