/* ── AI Summary Toggle & Box ── */

.ai-summary-wrapper {
  margin: 16px 0 24px;
}

/* Toggle button */
.ai-summary-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #0C7BFB 0%, #0A40D2 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.ai-summary-toggle:hover {
  /* background: linear-gradient(135deg, #0A40D2 0%, #052B8F 100%); */
  color: #fff;
  opacity: 0.6;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);

}

.ai-summary-toggle:focus-visible {
  outline: 2px solid #0C7BFB;
  outline-offset: 2px;
}

/* Darktheme toggle button */
body.darktheme .ai-summary-toggle {
  background: linear-gradient(135deg, #0C7BFB 0%, #0A40D2 100%);
  color: #ffffff;
}

body.darktheme .ai-summary-toggle:hover {
  background: linear-gradient(135deg, #0A40D2 0%, #052B8F 100%);
}

.ai-summary-icon {
  flex-shrink: 0;
  opacity: 0.8;
}

/* Carousel arrow beside the button label */
.ai-summary-arrow {
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.ai-summary-toggle[aria-expanded="true"] .ai-summary-arrow {
  transform: rotate(180deg);
}

/* Summary box */
.ai-summary-box {
  position: relative;
  margin-top: 12px;
  padding: 24px 28px;
  border-radius: 12px;
  background: 
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, #0C7BFB 0%, #0A40D2 25%, #6B5BFF 50%, #FF6B9D 75%, #FF9500 100%) border-box;
  border: 2px solid transparent;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  animation: aiSummaryFadeIn 0.3s ease-out;
}

.ai-summary-box[hidden] {
  display: none;
}

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

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

.ai-summary-box.closing {
  animation: aiSummaryFadeOut 0.25s ease-in forwards;
}

/* Close button inside the summary box */
.ai-summary-close {
  position: absolute;
  top: 12px;
  right: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.ai-summary-close:hover {
  opacity: 1;
}

body.darktheme .ai-summary-close img {
  filter: invert(1);
}

/* Inner scrollable area */
.ai-summary-scroll {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 8px;
}
.ai-heading{
  display: flex;
  align-items: center;
  gap: 16px;
}
/* Custom scrollbar */
.ai-summary-scroll::-webkit-scrollbar {
  width: 5px;
}
.ai-summary-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.ai-summary-scroll::-webkit-scrollbar-thumb {
  background: rgba(12, 123, 251, 0.2);
  border-radius: 4px;
}
.ai-summary-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(12, 123, 251, 0.4);
}

/* AI Image */
.ai-img {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 0 16px 0;
  border-radius: 8px;
  object-fit: contain;
}

body.darktheme .ai-img {
  filter: brightness(1.1);
}

/* Typography inside the summary — white text on black box */
.ai-summary-box h2 {
  font-family: 'zoho_puvi_SemiBold' !important;
  font-weight: 700;
  font-size: 20px;
  color: black;
  margin: 0 0 16px 0;
  padding: 0;
}

.ai-summary-box h2:first-of-type {
  margin-top: 0;
}

.ai-summary-box h3 {
  font-size: 18px;
  font-weight: 700;
  display: inline-block;
  font-family: 'zoho_puvi_SemiBold' !important;
  background: linear-gradient(
        135deg,
        #2DD7FF 0%,
        #1C20FB 35%,
        #941BF3 65%
    );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 20px 0 8px;

}

.ai-summary-box h3:first-of-type {
  margin-top: 8px;
}

body.darktheme .ai-summary-box h3 {
   background: linear-gradient(
        100deg,
        #2DD7FF 0%,
        #1C20FB 50%
    );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ai-summary-box p {
  font-size: 15px;
  line-height: 1.7;
  color: #424242;
  margin: 0 0 10px;
}

.ai-summary-box ul {
  margin: 8px 0 12px 18px;
  padding: 0;
}

.ai-summary-box ul li {
  font-size: 15px;
  line-height: 1.65;
  color: #424242;
  margin-bottom: 6px;
}

/* Darktheme AI Summary box with gradient border */
body.darktheme .ai-summary-box {
  background: 
    linear-gradient(#1a1a1a, #1a1a1a) padding-box,
    linear-gradient(135deg, #2DD7FF 0%, #1C20FB 25%, #941BF3 50%, #F7206D 75%, #FFBB00 100%) border-box;
  border: 2px solid transparent;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
}

body.darktheme .ai-summary-box h2 {
  font-family: 'zoho_puvi_SemiBold';
  color: #ffffff;
}

body.darktheme .ai-summary-box p,
body.darktheme .ai-summary-box ul li {
  color: #e0e0e0;
}

body.darktheme .ai-summary-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
}

body.darktheme .ai-summary-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.45);
}

/* Responsive */
@media (max-width: 768px) {
  .ai-summary-box {
    padding: 16px 18px;
  }
  .ai-summary-scroll {
    max-height: 250px;
  }
}
