/* =========================================
   Affiliated Writer Pro - Main Frontend Styles
   File: assets/css/aap-frontend.css
   ========================================= */

/* 1. Global Reset & Wrapper */
.aap-content-wrapper {
    position: relative;
    width: 100%;
    font-family: inherit;
    box-sizing: border-box;
}
.aap-content-wrapper * {
    box-sizing: inherit;
}
.aap-content-wrapper p {
    margin: 0 0 14px;
    line-height: 1.7;
    font-size: 1.05rem;
    color: #374151;
}

/* 2. Comparison Table (Desktop) */
.aap-unique-comparison-table {
    width: 100%;
    margin: 30px auto;
    border-collapse: collapse;
    table-layout: fixed;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}
.aap-unique-comparison-table th {
    background: #f8f8f8;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    color: #333;
    padding: 14px 10px;
    border-bottom: 2px solid #e5e7eb;
    text-align: center;
    vertical-align: middle;
}
.aap-unique-comparison-table td {
    background: #fff;
    padding: 16px 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    word-break: break-word;
}
/* Table Column Widths */
.aap-unique-comparison-table th:nth-child(1), .aap-unique-comparison-table td:nth-child(1) { width: 18%; }
.aap-unique-comparison-table th:nth-child(2), .aap-unique-comparison-table td:nth-child(2) { width: 32%; font-weight: 600; }
.aap-unique-comparison-table th:nth-child(3), .aap-unique-comparison-table td:nth-child(3) { width: 30%; }
.aap-unique-comparison-table th:nth-child(4), .aap-unique-comparison-table td:nth-child(4) { width: 20%; }

/* Table Images */
.aap-unique-comparison-table img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    max-height: 110px;
    object-fit: contain;
}

/* 3. Mobile Responsive Table */
@media (max-width: 780px) {
    .aap-unique-comparison-table thead { display: none !important; }
    .aap-unique-comparison-table, 
    .aap-unique-comparison-table tbody, 
    .aap-unique-comparison-table tr, 
    .aap-unique-comparison-table td {
        display: block !important;
        width: 100% !important;
    }
    .aap-unique-comparison-table tr {
        margin: 0 0 18px;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
        overflow: hidden;
    }
    .aap-unique-comparison-table td {
        padding: 14px 16px;
        border-bottom: 1px solid #f1f5f9;
        text-align: right; /* Align content to right */
        padding-left: 50%; /* Make space for label */
        position: relative;
    }
    .aap-unique-comparison-table tr > td:last-child {
        border-bottom: 0;
        background: #f8fafc;
        border-top: 1px dashed #e2e8f0;
        padding-left: 16px; /* Reset padding for CTA */
        text-align: center;
    }
    .aap-unique-comparison-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 16px;
        top: 14px;
        width: 40%;
        text-align: left;
        font-weight: 800;
        font-size: 0.75rem;
        text-transform: uppercase;
        color: #94a3b8;
    }
    /* Hide label for Image & Center it */
    .aap-unique-comparison-table td[data-label="Product Image"] {
        text-align: center;
        padding-left: 16px;
    }
    .aap-unique-comparison-table td[data-label="Product Image"]::before { display: none; }
    .aap-unique-comparison-table td[data-label="Product Image"] img { max-width: 140px; }
}

/* 4. CTA Button (Base Structure) */
.aap-cta-button, a.aap-cta-button {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    text-decoration: none;
    line-height: 1.2;
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin: 14px auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    /* Note: Color & Background come from PHP Dynamic CSS */
}
.aap-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    filter: brightness(1.05);
}

/* 5. My Honest Opinion Card (The Fix) */
.aap-summary-card {
    background: #f9fafb;
    border-left: 5px solid #667eea;
    padding: 20px;
    margin: 30px 0;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.aap-summary-card .aap-card-header h3 {
    font-size: 18px;
    color: #111827;
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px dashed #d1d5db;
    font-weight: 700;
}
.aap-summary-card p {
    font-size: 1em;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 0;
}

/* 6. Product Review Image Sizing (FIXED: 600px Max Width) */
.aap-product-review figure {
    margin: 20px auto;
    width: 100%;
    max-width: 600px; /* Increased from 350px for better visibility */
    text-align: center;
}
.aap-product-review figure img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
@media screen and (max-width: 480px) {
    .aap-product-review figure {
        width: 100%;
    }
}

/* 7. Related Posts Section (The Fix) */
.aap-related-posts {
    margin-top: 40px;
    padding: 25px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}
.aap-related-posts h3 {
    margin-top: 0;
    font-size: 20px;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: #111827;
}
.aap-related-posts ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.aap-related-posts li {
    margin-bottom: 12px;
    padding-left: 0 !important;
}
.aap-related-posts li a {
    text-decoration: none;
    font-weight: 600;
    color: #2563eb;
    font-size: 16px;
    display: block;
    transition: all 0.2s;
}
.aap-related-posts li a:hover {
    padding-left: 5px;
    /* Color handled by PHP dynamic CSS */
}