/* Remove blue accent line from main header *//* ================================
   AI ENHANCED DESCRIPTION FEATURE
   ================================ */

/* Override panel title layout for AI button positioning */
.panel-title:has(.ai-enhance-button),
.panel-title {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

/* AI Enhance Button - positioned in panel title */
.ai-enhance-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.1px;
  flex-shrink: 0;
  height: 30px;
  line-height: 1;
  margin-left: 8px;
}

.ai-enhance-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, #5855f0 0%, #7c3aed 100%);
}

.ai-enhance-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
}

.ai-enhance-button svg {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}

/* ================================
   ENHANCED AI DESCRIPTION POPUP
   ================================ */

/* Popup backdrop with enhanced blur */
.ai-description-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

/* Show backdrop */
.ai-description-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* Enhanced main popup container */
.ai-description-popup {
  width: 85%;
  height: 80%;
  max-width: 1400px;
  max-height: 900px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 20px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid #e9ecef;
}

/* Show popup with enhanced animation */
.ai-description-backdrop.show .ai-description-popup {
  transform: scale(1);
}

/* Enhanced popup header - clean and modern */
.ai-description-header {
  background: #ffffff;
  color: #2c3e50;
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #e1e5e9;
  position: relative;
}

.ai-description-title {
  font-size: 20px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
  text-shadow: none;
  letter-spacing: 0.3px;
}

/* Enhanced close button - clean design */
.ai-description-close {
  background: #f8f9fa;
  border: 2px solid #e1e5e9;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #6c757d;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ai-description-close:hover {
  background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
  border-color: #fc8181;
  color: #b22222;
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(178, 34, 34, 0.2);
}

.ai-description-close:active {
  transform: scale(0.95);
  box-shadow: 0 1px 2px rgba(178, 34, 34, 0.3);
}

.ai-description-close svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
  transition: all 0.3s ease;
}

/* Enhanced main content area */
.ai-description-content {
  flex: 1;
  display: flex;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

/* Enhanced left and right sections */
.ai-description-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Enhanced section headers */
.ai-section-header {
  padding: 6px 24px;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  border-bottom: 3px solid;
  position: relative;
}

/* Original description header - clean professional gray */
.ai-section-header.original {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  color: white;
  border-bottom-color: #5a6268;
  box-shadow: 0 2px 6px rgba(108, 117, 125, 0.15);
}

/* AI description header - matching AI Suggestion style */
.ai-section-header.ai-enhanced {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  color: #1976d2;
  border-bottom-color: #2196f3;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
  position: relative;
}

.ai-section-header.ai-enhanced::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #2196f3 20%, #1976d2 50%, #2196f3 80%, transparent 100%);
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Enhanced section content areas */
.ai-section-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  position: relative;
  background: white;
}

/* Original description content - clean white */
.ai-section-content.original {
  background: #ffffff;
  border-right: 1px solid #e9ecef;
}

/* AI description content - enhanced blue theme to match header */
.ai-section-content.ai-enhanced {
  background: linear-gradient(135deg, #f0f8ff 0%, #e3f2fd 100%);
  position: relative;
}

.ai-section-content.ai-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent 0%, #2196f3 50%, transparent 100%);
  z-index: 1;
}

/* Enhanced vertical divider between sections */
.ai-description-section:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, #e9ecef 0%, #6c757d 30%, #6c757d 70%, #e9ecef 100%);
  z-index: 2;
  box-shadow: 1px 0 3px rgba(0, 0, 0, 0.1);
}

/* Enhanced placeholder content styling */
.ai-placeholder-content {
  color: #6c757d;
  font-style: italic;
  text-align: center;
  padding: 60px 30px;
  font-size: 16px;
  font-weight: 500;
  background: linear-gradient(135deg, rgba(108, 117, 125, 0.05) 0%, rgba(108, 117, 125, 0.02) 100%);
  border-radius: 12px;
  border: 2px dashed #dee2e6;
}

/* Enhanced product description content in popup */
.ai-section-content .product-description {
  color: #2c3e50;
  font-size: 15px;
  line-height: 1.7;
  text-align: left;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid #e9ecef;
}

.ai-section-content.ai-enhanced .product-description {
  background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);
  border: 2px solid #bbdefb;
  box-shadow: 0 4px 16px rgba(33, 150, 243, 0.12);
}

.ai-section-content .product-description p {
  margin-bottom: 16px;
}

.ai-section-content .product-description ul,
.ai-section-content .product-description ol {
  margin: 16px 0;
  padding-left: 24px;
}

.ai-section-content .product-description li {
  margin-bottom: 8px;
}

.ai-section-content .product-description strong {
  color: #1e293b;
  font-weight: 700;
}

/* Enhanced AI explanation box styling - matching blue theme */
.ai-section-content .product-description .ai-explanation {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%) !important;
  border: 2px solid #2196f3 !important;
  border-radius: 12px !important;
  padding: 20px !important;
  margin-bottom: 24px !important;
  font-size: 14px !important;
  color: #1976d2 !important;
  box-shadow: 0 4px 16px rgba(33, 150, 243, 0.15) !important;
  position: relative;
}

.ai-section-content .product-description .ai-explanation::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #2196f3, #1976d2, #2196f3);
  border-radius: 14px;
  z-index: -1;
  opacity: 0.2;
}

/* Enhanced cost display in AI header - matching AI Suggestion style */
.ai-section-header .cost-display {
  font-weight: 500;
  color: #dc3545;
  font-size: 0.85em;
  text-shadow: 0 1px 2px rgba(220, 53, 69, 0.2);
}

/* Enhanced mobile responsive */
@media (max-width: 768px) {
  .ai-description-popup {
    width: 95%;
    height: 95%;
    margin: 2.5%;
    border-radius: 16px;
  }
  
  .ai-description-content {
    flex-direction: column;
  }
  
  .ai-description-section:not(:last-child)::after {
    display: none;
  }
  
  .ai-description-section:not(:last-child) {
    border-bottom: 3px solid #dee2e6;
  }
  
  .ai-description-title {
    font-size: 18px;
  }
  
  .ai-section-header {
    font-size: 16px;
    padding: 12px 20px;
  }
  
  .ai-section-content {
    padding: 20px;
  }
  
  .ai-description-header {
    padding: 16px 20px;
  }
}