/**
 * WPAP Connect Frontend Styles
 * Generic styles for content elements imported from Autopost platform
 * Compatible with all WordPress themes
 * Version: 1.0.5
 */

/* Overview Section - Article summary */
.ap-overview {
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 25px;
    background-color: #fafafa;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
}

.ap-overview h3,
.ap-overview h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 600;
    color: #333;
}

.ap-overview ul {
    margin: 0;
    padding-left: 20px;
}

.ap-overview li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.ap-overview p {
    margin: 0 0 15px 0;
    line-height: 1.6;
}

/* Did You Know Section - Interesting facts within articles */
.ap-dyn {
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 25px 20px 20px 20px;
    border: 2px solid #f59e0b;
    border-radius: 8px;
    background-color: #fef3c7;
    position: relative;
}

.ap-dyn::before {
    content: "💡";
    position: absolute;
    top: -12px;
    left: 20px;
    background: #fef3c7;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 14px;
    border: 2px solid #f59e0b;
}

.ap-dyn p {
    margin: 0;
    font-weight: 500;
    line-height: 1.6;
    font-style: italic;
    color: #92400e;
}

/* FAQ Section - Questions and answers */
.ap-faq {
    border: none;
    background-color: transparent;
    padding: 0;
    margin: 20px 0;
}

.ap-faq h3,
.ap-faq h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 600;
}

/* FAQ Question Styles */
.ap-question {
    background-color: #f5f5f5;
    padding: 15px 20px;
    margin: 0 0 15px 0;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: background-color 0.3s ease;
    position: relative;
    border: 1px solid #e0e0e0;
    border-radius: 5px 5px 0 0;
}

.ap-question::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4em;
    font-weight: normal;
    color: #777;
    transition: transform 0.3s ease;
}

.ap-question.active::after {
    content: '−';
    transform: translateY(-50%) rotate(180deg);
}

.ap-question:hover {
    background-color: #eeeeee;
}

/* FAQ Answer Styles */
.ap-answer {
    padding: 20px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 5px 5px;
    display: none;
    line-height: 1.6;
    margin: 0 0 15px 0;
}

.ap-answer.active {
    display: block;
}

.ap-answer p {
    margin: 0 0 15px 0;
}

.ap-answer p:last-child {
    margin-bottom: 0;
}

/* Sources Section - References and citations */
.ap-sources {
    margin-top: 30px;
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #6c757d;
}

.ap-sources h3,
.ap-sources h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 600;
    color: #495057;
    font-size: 1.1em;
}

.ap-sources ul,
.ap-sources ol {
    margin: 0;
    padding-left: 20px;
    list-style-type: none;
}

.ap-sources li {
    margin-bottom: 10px;
    line-height: 1.5;
    position: relative;
    padding-left: 20px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.ap-sources li::before {
    content: "🔗";
    position: absolute;
    left: 0;
    top: 0;
    font-size: 14px;
}

.ap-sources a {
    color: #007cba;
    text-decoration: none;
    word-break: break-word;
}

.ap-sources a:hover {
    text-decoration: underline;
}

/* Spacer utility class */
.ap-spacer {
    height: 30px;
    clear: both;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ap-overview,
    .ap-dyn,
    .ap-faq,
    .ap-sources {
        padding: 15px;
        margin: 15px 0;
    }
    
    .ap-faq .faq-question {
        padding: 12px 15px;
        font-size: 1em;
    }
    
    .ap-faq .faq-answer {
        padding: 15px;
    }
}

/* Print Styles */
@media print {
    .ap-overview,
    .ap-dyn,
    .ap-faq,
    .ap-sources {
        background: #ffffff !important;
        border: 1px solid #000000 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .ap-faq .faq-question::after {
        display: none;
    }
    
    .ap-faq .faq-answer {
        display: block !important;
    }
}