/**
 * Quality Report Display (QA Widget) Styles
 * 
 * Theme-compatible styles that inherit from the host theme
 * while providing necessary structural styling.
 * 
 * @package AI_Article_Pipeline
 * @since 5.38.0
 */

/* Container - inherits theme fonts and colors */
.aiap-quality-report {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    
    /* Use WordPress theme.json custom properties when available */
    background: var(--wp--preset--color--base, #f8f9fa);
    border: 1px solid var(--wp--preset--color--contrast, #dee2e6);
    color: inherit;
    
    /* Structural styles */
    border-radius: 0.5em;
    margin-bottom: 1.5em;
    overflow: hidden;
}

/* Header - clickable toggle */
.aiap-qr-header {
    display: flex;
    align-items: center;
    padding: 0.75em 1em;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

.aiap-qr-header:hover {
    background: rgba(0, 0, 0, 0.03);
}

.aiap-qr-header:focus {
    outline: 2px solid var(--wp--preset--color--primary, #0073aa);
    outline-offset: -2px;
}

/* Title - article type label */
.aiap-qr-title {
    font-weight: 600;
    font-size: 0.9em;
    flex-grow: 1;
    color: inherit;
}

/* Toggle indicator - CSS chevron */
.aiap-qr-toggle {
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    opacity: 0.5;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-top: -3px;
}

.aiap-quality-report.expanded .aiap-qr-toggle {
    transform: rotate(-135deg);
    margin-top: 3px;
}

/* Summary line - stats left, date right */
.aiap-qr-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1em 0.75em;
    font-size: 0.85em;
    opacity: 0.7;
}

.aiap-qr-stats {
    flex-shrink: 0;
}

.aiap-qr-date {
    flex-shrink: 0;
    text-align: right;
}

/* Non-expandable variant */
.aiap-quality-report.no-expand .aiap-qr-header {
    cursor: default;
}

.aiap-quality-report.no-expand .aiap-qr-header:hover {
    background: transparent;
}

.aiap-quality-report.no-expand .aiap-qr-toggle {
    display: none;
}

/* Details panel */
.aiap-qr-details {
    border-top: 1px solid var(--wp--preset--color--contrast, #dee2e6);
    padding: 1em;
    background: var(--wp--preset--color--background, #fff);
}

.aiap-qr-details[hidden] {
    display: none;
}

/* Section containers */
.aiap-qr-section {
    margin-bottom: 1em;
}

.aiap-qr-section:last-child {
    margin-bottom: 0;
}

/* Section headers */
.aiap-qr-section h4 {
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
    margin: 0 0 0.5em 0;
    color: inherit;
}

/* Lists - single bullet only, override theme double-bullets */
.aiap-qr-section ul,
.aiap-quality-report ul,
.aiap-quality-report .aiap-qr-section ul,
ul.aiap-qr-sources-list,
ul.aiap-qr-claims-list {
    margin: 0 0 0 1.2em !important;
    padding: 0 !important;
    list-style: disc !important;
    list-style-position: outside !important;
    font-size: 0.85em;
}

.aiap-qr-section li,
.aiap-quality-report li,
.aiap-quality-report .aiap-qr-section li,
.aiap-qr-sources-list li,
.aiap-qr-claims-list li {
    padding: 0.1em 0 !important;
    margin: 0 !important;
    list-style: disc !important;
    line-height: 1.4 !important;
    display: list-item !important;
}

/* Remove any theme-added ::before pseudo-bullets */
.aiap-qr-section li::before,
.aiap-quality-report li::before,
.aiap-quality-report .aiap-qr-section li::before,
.aiap-qr-sources-list li::before,
.aiap-qr-claims-list li::before {
    content: none !important;
    display: none !important;
}

/* Claims list styling */
.aiap-qr-claims-list {
    display: flex;
    flex-direction: column;
    gap: 0.15em;
}

.aiap-qr-claims-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aiap-qr-claims-list .aiap-claim-label {
    opacity: 0.8;
}

.aiap-qr-claims-list .aiap-claim-count {
    font-weight: 600;
    opacity: 0.9;
}

/* Sources list styling */
.aiap-qr-sources-list {
    display: flex;
    flex-direction: column;
    gap: 0.15em;
}

/* Domain indicator */
.aiap-qr-domain {
    opacity: 0.6;
    font-size: 0.9em;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .aiap-qr-header {
        padding: 0.6em 0.8em;
    }
    
    .aiap-qr-title {
        font-size: 0.85em;
    }
    
    .aiap-qr-summary {
        font-size: 0.8em;
        padding: 0 0.8em 0.6em;
    }
    
    .aiap-qr-details {
        padding: 0.8em;
    }
    
    .aiap-qr-section ul {
        font-size: 0.8em;
    }
}

/* Print styles */
@media print {
    .aiap-quality-report {
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    .aiap-qr-header {
        cursor: default;
    }
    
    .aiap-qr-toggle {
        display: none;
    }
    
    .aiap-qr-details {
        display: block !important;
    }
    
    .aiap-qr-details[hidden] {
        display: block !important;
    }
}
