/**
 * AI Overview Component Styles
 * 
 * BEM naming convention: ai-overview__element--modifier
 * Uses CSS custom properties for theming
 */

/* Container - hidden by default until JS initializes */
[data-target="aiOverviewContainer"] {
  display: none;
}

/* Main wrapper */
.ai-overview {
  --ai-overview-primary: #6366f1; /* Indigo */
  --ai-overview-primary-hover: #4f46e5;
  --ai-overview-text: #1e293b; /* Slate 900 */
  --ai-overview-text-secondary: #475569; /* Slate 600 */
  --ai-overview-text-muted: #94a3b8; /* Slate 400 */
  --ai-overview-border: #f1f5f9; /* Slate 100 */
  --ai-overview-bg-bullet: #94a3b8; /* Slate 400 */
  --ai-overview-section-border: #e2e8f0; /* Slate 200 */
  --ai-overview-success: #16a34a; /* Green 600 */
  --ai-overview-success-bg: #f0fdf4; /* Green 50 */
  --ai-overview-error: #dc2626; /* Red 600 */
  --ai-overview-error-bg: #fef2f2; /* Red 50 */

  width: 100%;
  color: var(--ai-overview-text);
  font-family: var(--galls-font-gt-america-standard, 'GT America Standard', -apple-system, BlinkMacSystemFont, sans-serif);
  margin-bottom: 16px;
  padding: 16px;
  background-color: #fafafa;
  border-radius: 8px;
}

/* Header */
.ai-overview__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.ai-overview__icon {
  width: 16px;
  height: 16px;
  color: var(--ai-overview-primary);
  flex-shrink: 0;
}

.ai-overview__title {
  font-family: var(--galls-font-gt-america-condensed, 'GT America Condensed', sans-serif);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ai-overview-text);
  margin: 0;
}

/* Bullets - Always visible */
.ai-overview__bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 8px 0;
}

.ai-overview__bullet {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ai-overview-text-secondary);
  margin-bottom: 8px;
}

.ai-overview__bullet:last-child {
  margin-bottom: 0;
}

.ai-overview__bullet-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--ai-overview-bg-bullet);
  flex-shrink: 0;
  margin-top: 7px;
}

/* Toggle Button */
.ai-overview__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 4px 0;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ai-overview-primary);
  cursor: pointer;
  transition: color 0.15s ease;
}

.ai-overview__toggle:hover {
  color: var(--ai-overview-primary-hover);
}

.ai-overview__toggle:focus {
  outline: none;
}

.ai-overview__toggle:focus-visible {
  outline: 2px solid var(--ai-overview-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.ai-overview__toggle-icon {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

/* Expandable Content */
.ai-overview__expanded {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}

.ai-overview__expanded--visible {
  max-height: 1000px;
  opacity: 1;
  margin-top: 12px;
}

.ai-overview__expanded-inner {
  padding-top: 12px;
  border-top: 1px solid var(--ai-overview-border);
}

/* Paragraph */
.ai-overview__paragraph {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ai-overview-text-secondary);
  margin: 0 0 20px 0;
}

/* Sections (Best For, What to Know) */
.ai-overview__sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-overview__section {
  margin: 0;
}

.ai-overview__section-title {
  font-family: var(--galls-font-gt-america-condensed, 'GT America Condensed', sans-serif);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ai-overview-text);
  margin: 0 0 8px 0;
}

.ai-overview__section-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ai-overview__section-item {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ai-overview-text-secondary);
  padding-left: 8px;
  border-left: 2px solid var(--ai-overview-section-border);
  margin-bottom: 4px;
}

.ai-overview__section-item:last-child {
  margin-bottom: 0;
}

/* Footer */
.ai-overview__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--ai-overview-border);
  margin-top: 16px;
}

.ai-overview__disclaimer {
  font-size: 10px;
  font-style: italic;
  color: var(--ai-overview-text-muted);
}

/* Feedback Buttons */
.ai-overview__feedback {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-overview__feedback-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--ai-overview-text-muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ai-overview__feedback-btn:hover {
  background-color: #f1f5f9;
  color: var(--ai-overview-text-secondary);
}

.ai-overview__feedback-btn:focus {
  outline: none;
}

.ai-overview__feedback-btn:focus-visible {
  outline: 2px solid var(--ai-overview-primary);
  outline-offset: 2px;
}

.ai-overview__feedback-btn svg {
  width: 14px;
  height: 14px;
}

/* Active vote states */
.ai-overview__feedback-btn--up-active {
  color: var(--ai-overview-success);
  background-color: var(--ai-overview-success-bg);
}

.ai-overview__feedback-btn--up-active:hover {
  color: var(--ai-overview-success);
  background-color: #dcfce7; /* Green 100 */
}

.ai-overview__feedback-btn--down-active {
  color: var(--ai-overview-error);
  background-color: var(--ai-overview-error-bg);
}

.ai-overview__feedback-btn--down-active:hover {
  color: var(--ai-overview-error);
  background-color: #fee2e2; /* Red 100 */
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ai-overview {
    padding: 12px;
  }

  .ai-overview__footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .ai-overview__feedback {
    align-self: flex-end;
  }
}
