/* Idea Card Styles */

.idea-container {
    padding: 8px 10px;
    margin: 8px 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

/* ===========================
   Prompt Engineering Idea Cards (from scratch)
   Namespaced + reset to avoid inheriting markdown styles
   =========================== */
.pe-idea-card,
.pe-idea-card * {
    box-sizing: border-box;
}

.pe-idea-card {
    /* reset-ish */
    margin: 0 0 15px 0;
    padding: 12px 12px;
    background: var(--surface);
    border: 1px solid #d1d5db;
    border-radius: 12px;
    color: var(--text);
    font-family: var(--font-lato), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    font-style: normal;
    line-height: 1.45;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.pe-idea-card * {
    /* prevent inherited margins/paddings from markdown typography */
    margin: 0;
    padding: 0;
}

.pe-idea-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.pe-idea-card__badge {
    display: inline-flex;
    align-items: center;
    max-width: calc(100% - 44px);
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(185, 240, 64, 0.14);
    color: var(--text);
    border: 1px solid rgba(185, 240, 64, 0.25);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pe-idea-card__add {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.pe-idea-card__add:hover {
    background: rgba(185, 240, 64, 0.2);
    border-color: rgba(185, 240, 64, 0.65);
    transform: scale(1.02);
}

.pe-idea-card__add:focus-visible {
    outline: 2px solid var(--brand-color);
    outline-offset: 2px;
}

.pe-idea-card__add.is-selected {
    background: var(--brand-color);
    border-color: var(--brand-color);
    color: var(--bg-black);
}

.pe-idea-card__add.is-selected img {
    display: block;
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.pe-idea-card__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
    margin-bottom: 10px;
}

.pe-idea-card__meta {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
}

.pe-idea-card__metaRow {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 8px;
    align-items: start;
    color: var(--text);
}

.pe-idea-card__metaLabel {
    font-weight: 700;
    color: var(--text);
}

.pe-idea-card__metaValue {
    color: var(--muted);
}

.pe-idea-card__details {
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
}

.pe-idea-card.is-selected {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(185, 240, 64, 0.18);
}

@media (max-width: 768px) {
    .pe-idea-card {
        padding: 10px 10px;
    }
    .pe-idea-card__title {
        font-size: 16px;
    }
    .pe-idea-card__metaRow {
        grid-template-columns: 88px 1fr;
    }
    .pe-idea-card__add {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}

.idea-container:first-child {
    margin-top: 0;
}

.idea-container:last-child {
    margin-bottom: 0;
}

.idea-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    gap: 8px;
}

.idea-header-row > .idea-angle {
    max-width: calc(100% - 36px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.idea-container:hover {
    border-color: #cbd5e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.idea-container.selected {
    border-color: #48bb78;
    background-color: #f0fff4;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.15);
}

.idea-content {
    width: 100%;
    margin: 0;
    padding: 0;
}

.idea-angle {
    font-size: 10px;
    font-weight: 600;
    color: #4a5568;
    background: #edf2f7;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.3;
    display: inline-block;
}

.idea-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 4px 0;
    line-height: 1.2;
    width: 100%;
}

.idea-container.selected .idea-angle {
    background: #c6f6d5;
    color: #22543d;
}

.idea-meta {
    margin-bottom: 4px;
    font-size: 12px;
}

.idea-meta-row {
    margin: 0;
    line-height: 1.35;
}

.idea-meta-row:last-child {
    margin-bottom: 0;
}

.idea-meta-label {
    font-weight: 600;
    color: #2d3748;
}

.idea-meta-value {
    color: #4a5568;
}

.idea-details {
    font-size: 12px;
    line-height: 1.35;
    color: #2d3748;
    margin: 0;
    padding: 0;
}

.idea-details strong {
    color: #1a202c;
    font-weight: 600;
}

.idea-details em {
    font-style: italic;
    color: #4a5568;
}

.btn-add-idea {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    background: white;
    color: #4a5568;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.btn-add-idea:hover {
    border-color: #48bb78;
    background: #f0fff4;
    color: #48bb78;
    transform: scale(1.05);
}

.btn-add-idea.selected {
    border-color: #48bb78;
    background: #48bb78;
    color: white;
}

.btn-add-idea.selected:hover {
    background: #38a169;
    border-color: #38a169;
}

.btn-add-idea span {
    display: block;
    line-height: 1;
}

/* Responsive adjustments for idea cards */
@media (max-width: 768px) {
    .idea-container {
        padding: 8px 10px;
    }
    
    .idea-header-row {
        gap: 8px;
    }
    
    .idea-angle {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .btn-add-idea {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}

/* ===========================
   Facebook Ad Card Styles
   Wrapper contains metadata + ad mock
   =========================== */

/* Wrapper - contains everything */
.pe-fb-ad-wrapper {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.pe-fb-ad-wrapper * {
    box-sizing: border-box;
}

/* First ad wrapper shouldn't have top border */
.pe-fb-ad-wrapper:first-child {
    border-top: none !important;
    padding-top: 0 !important;
}

/* Spacing between multiple FB ad wrappers is handled by border-top */

/* Add button inside ad - positioned absolutely at top right */
.pe-fb-ad-wrapper__add {
    /* Inline styles handle positioning */
    transition: background 0.15s ease, transform 0.15s ease;
}

.pe-fb-ad-wrapper__add:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    transform: scale(1.05);
}

.pe-fb-ad-wrapper__add:focus-visible {
    outline: 2px solid var(--brand-color, #B9F040);
    outline-offset: 2px;
}

.pe-fb-ad-wrapper__add.is-selected {
    background: var(--brand-color, #B9F040) !important;
    color: var(--bg-black, #000000) !important;
}

/* VoC Evidence Section - styled to match ads-card__voc-item */
.pe-fb-ad-wrapper__voc {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border, #e2e8f0);
}

.pe-fb-ad-wrapper__voc-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted, #718096);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.pe-fb-ad-wrapper__voc-list {
    display: block;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pe-fb-ad-wrapper__voc-item {
    font-style: italic;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.875rem;
    color: var(--text, #1a202c);
    line-height: 1.5;
    border-left: 3px solid var(--brand-color, #B9F040);
}

.pe-fb-ad-wrapper__voc-item:last-child {
    margin-bottom: 0;
}

/* The actual Facebook Ad Mock - isolated from parent styles */
.pe-fb-ad {
    /* Margin controlled by inline styles for flexibility */
    padding: 0 !important;
    /* border controlled by inline styles for flexibility */
    /* Establish fresh styling */
    display: block;
    width: 100%;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.3333;
    color: #050505;
}

.pe-fb-ad *,
.pe-fb-ad *::before,
.pe-fb-ad *::after {
    box-sizing: border-box;
    margin: 0 !important;
    padding: 0;
    border: none;
    /* Reset typography that parent might set */
    text-indent: 0;
    text-decoration: none;
    /* Reset list styles */
    list-style: none !important;
    list-style-type: none !important;
}

/* Ad Header with profile pic and page name */
.pe-fb-ad__header {
    padding: 12px 12px 0 !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pe-fb-ad__profile-pic {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.pe-fb-ad__info {
    flex: 1;
    min-width: 0;
}

.pe-fb-ad__page-name {
    font-weight: 600;
    font-size: 15px;
    color: #050505;
}

.pe-fb-ad__sponsored {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #65676b;
}

.pe-fb-ad__dot {
    width: 3px;
    height: 3px;
    background: #65676b;
    border-radius: 50%;
}

/* Primary text area - always expanded */
.pe-fb-ad__primary-text-wrapper {
    padding: 8px 12px !important;
}

.pe-fb-ad__primary-text {
    font-size: 15px;
    line-height: 1.4;
    color: #050505;
    /* Reset any inherited list/block styles */
    list-style: none !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    font-weight: 400 !important;
    font-style: normal !important;
}

/* Force regular weight on every descendant — defends against any rogue
   <strong>/<b>/<em> wrapping injected by upstream markdown processing. */
.pe-fb-ad__primary-text,
.pe-fb-ad__primary-text * {
    font-weight: 400 !important;
    font-style: normal !important;
}

/* Paragraph divs inside primary text */
.pe-fb-ad__primary-text > div {
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
}

.pe-fb-ad__primary-text > div:last-child {
    margin-bottom: 0 !important;
}

/* Reset list styles that might be applied inside primary text */
.pe-fb-ad__primary-text ol,
.pe-fb-ad__primary-text ul,
.pe-fb-ad__primary-text li {
    all: unset !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Media/Image area - placeholder only */
.pe-fb-ad__media {
    width: 100%;
    aspect-ratio: 1.91 / 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Link details section */
.pe-fb-ad__link-details {
    background: #f8fafb;
    padding: 10px 12px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pe-fb-ad__link-text {
    flex: 1;
    min-width: 0;
}

.pe-fb-ad__link-url {
    font-size: 12px;
    color: #65676b;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pe-fb-ad__headline {
    font-weight: 600;
    font-size: 15px;
    color: #050505;
    line-height: 1.2;
}

.pe-fb-ad__description {
    font-size: 14px;
    color: #65676b;
    line-height: 1.3;
}

.pe-fb-ad__cta {
    background: #e2e5e9;
    color: #050505;
    border: none !important;
    padding: 8px 12px !important;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    cursor: default;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Footer (decorative) */
.pe-fb-ad__footer {
    padding: 4px 12px 8px !important;
    display: flex;
    justify-content: space-around;
    border-top: 1px solid #e4e6eb !important;
}

.pe-fb-ad__action {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #65676b;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 0 !important;
}

.pe-fb-ad__action-icon {
    font-size: 16px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pe-fb-ad__header {
        padding: 10px 10px 0;
    }
    
    .pe-fb-ad__profile-pic {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
    
    .pe-fb-ad__page-name {
        font-size: 14px;
    }
    
    .pe-fb-ad__primary-text-wrapper {
        padding: 6px 10px;
    }
    
    .pe-fb-ad__primary-text {
        font-size: 14px;
    }
    
    .pe-fb-ad__link-details {
        padding: 8px 10px;
    }
    
    .pe-fb-ad__headline {
        font-size: 14px;
    }
    
    .pe-fb-ad__footer {
        padding: 4px 10px 6px;
    }
    
    .pe-fb-ad__action {
        font-size: 12px;
    }
    
    .pe-fb-ad-wrapper__add {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* ===========================
   VoC Evidence Callout (Standalone before cards)
   =========================== */

.pe-voc-callout {
    margin: 16px 0;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #B9F040;
}

.pe-voc-callout__label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #718096;
    margin-bottom: 8px;
}

.pe-voc-callout__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pe-voc-callout__item {
    font-size: 13px;
    font-style: italic;
    color: #4a5568;
    line-height: 1.5;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* ===========================
   Skeleton Loaders for Streaming Cards
   =========================== */

@keyframes pe-skeleton-pulse {
    0%, 100% {
        background-color: #e2e8f0;
    }
    50% {
        background-color: #cbd5e1;
    }
}

.pe-skeleton {
    border-radius: 12px;
    overflow: hidden;
    margin: 16px 0;
}

.pe-skeleton__line,
.pe-skeleton__badge,
.pe-skeleton__button,
.pe-skeleton__avatar,
.pe-skeleton__fb-image {
    background-color: #e2e8f0;
    animation: pe-skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.pe-skeleton__line {
    height: 14px;
    margin-bottom: 10px;
    width: 100%;
}

.pe-skeleton__line--short {
    width: 40%;
}

.pe-skeleton__line--medium {
    width: 70%;
}

.pe-skeleton__line--tiny {
    width: 25%;
    height: 10px;
}

.pe-skeleton__spacer {
    height: 16px;
}

/* Email Skeleton */
.pe-skeleton--email {
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.pe-skeleton__header {
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.pe-skeleton__badge {
    width: 120px;
    height: 24px;
    margin-bottom: 12px;
    border-radius: 4px;
}

.pe-skeleton__body {
    padding: 24px 20px;
}

.pe-skeleton__button {
    width: 180px;
    height: 48px;
    border-radius: 6px;
    margin-top: 8px;
}

/* FB Ad Skeleton */
.pe-skeleton--fb-ad {
    background: #fff;
    border: 1px solid #dddfe2;
    max-width: 500px;
}

.pe-skeleton__fb-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
}

.pe-skeleton__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pe-skeleton__fb-meta {
    flex: 1;
}

.pe-skeleton__fb-meta .pe-skeleton__line {
    margin-bottom: 6px;
}

.pe-skeleton__fb-body {
    padding: 0 12px 12px;
}

.pe-skeleton__fb-image {
    width: 100%;
    height: 250px;
    border-radius: 0;
}

.pe-skeleton__fb-footer {
    padding: 12px;
    border-top: 1px solid #e4e6eb;
}

/* Idea Card Skeleton */
.pe-skeleton--idea {
    background: #fff;
    border: 1px solid #d1d5db;
    padding: 16px;
}

.pe-skeleton__idea-header {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.pe-skeleton__idea-body .pe-skeleton__line:last-child {
    margin-bottom: 0;
}

/* ===========================
   FAQ Card Styles
   =========================== */

.pe-faq-wrapper {
    margin: 0;
    padding: 0;
}

.pe-faq-card {
    position: relative;
    margin: 0 0 16px 0;
    padding: 20px;
    background: var(--surface, #fff);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-family: var(--font-lato), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.pe-faq-card__copy {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    padding: 5px 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted, #94a3b8);
    transition: all 0.2s;
    opacity: 0;
}

.pe-faq-card:hover .pe-faq-card__copy {
    opacity: 1;
}

.pe-faq-card__copy:hover {
    background: #f0f4f8;
    border-color: var(--brand-color, #6366f1);
}

.pe-faq-card__copy img {
    display: block;
}

.pe-faq-card:last-child {
    margin-bottom: 0;
}

.pe-faq-card__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.pe-faq-card__pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: rgba(185, 240, 64, 0.14);
    color: var(--text, #1a202c);
    border: 1px solid rgba(185, 240, 64, 0.25);
}

.pe-faq-card__pill--intent {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
    color: #4338ca;
}

.pe-faq-card__question {
    font-size: 16px;
    font-weight: 700;
    color: var(--text, #1a202c);
    line-height: 1.35;
    margin-bottom: 10px;
}

.pe-faq-card__answer {
    font-size: 14px;
    line-height: 1.6;
    color: #4a5568;
    margin-bottom: 0;
}

.pe-faq-card__meta {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    display: grid;
    gap: 6px;
}

.pe-faq-card__meta-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px;
    align-items: start;
    font-size: 13px;
}

.pe-faq-card__meta-label {
    font-weight: 600;
    color: #718096;
}

.pe-faq-card__meta-value {
    color: var(--text, #1a202c);
}

.pe-faq-card__meta-value--voc {
    font-style: italic;
    color: #4a5568;
}

@media (max-width: 768px) {
    .pe-faq-card {
        padding: 14px;
    }
    .pe-faq-card__question {
        font-size: 15px;
    }
    .pe-faq-card__meta-row {
        grid-template-columns: 100px 1fr;
    }
}

/* FAQ Skeleton */
.pe-skeleton--faq {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pe-skeleton--faq-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}
