/*
 * Styles for the Single Plan Template (single-plan.php)
 * VERSION 8.0: Cleaned up! Removed verification and collapsible classes.
 */

/* === 1. Main Layout === */
.sp-container { 
    max-width: var(--py-container-width); 
    margin: 40px auto; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 40px; 
    padding: 0 20px; 
    width: 100%; 
}

.sp-main { flex: 1 1 65%; min-width: 0; max-width: 100%; }
.sp-sidebar { flex: 1 1 30%; min-width: 300px; max-width: 100%; }

/* === 1.5. Breadcrumb Fixes === */
.priceyoo-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    line-height: 1.5;
}
.priceyoo-breadcrumb > span:last-child {
    display: inline-block;
}

/* === 2. Modern Hero Section === */
.sp-hero { 
    display: flex; 
    align-items: center; 
    justify-content: flex-start; 
    gap: 30px; 
    margin-bottom: 50px; 
    padding: 30px; 
    background: var(--py-card-bg); 
    border-radius: 16px; 
    box-shadow: 0 8px 30px rgba(0,0,0,0.07); 
    border: 1px solid var(--py-border-color); 
    position: relative; 
    overflow: hidden; 
    width: 100%; 
}

.sp-hero::before { content: ''; position: absolute; top: 0; right: 0; width: 200px; height: 100%; background: linear-gradient(135deg, rgba(var(--py-primary-rgb), 0.02) 0%, rgba(var(--py-primary-rgb), 0.08) 100%); clip-path: polygon(25% 0%, 100% 0, 100% 100%, 0% 100%); z-index: 0; }

.sp-hero-image { flex: 0 0 90px; width: 90px; height: 90px; object-fit: contain; border-radius: 12px; padding: 10px; background: #fff; box-shadow: 0 5px 15px rgba(0,0,0,0.08); border: 1px solid var(--py-border-color); z-index: 1; }

.sp-hero-content-wrapper { flex: 1; z-index: 1; text-align: left; min-width: 0; }

.sp-hero-title { font-size: 2rem; color: var(--py-secondary-color); margin: 0 0 10px 0; font-weight: 700; line-height: 1.2; word-wrap: break-word; }

.sp-meta-info { display: flex; align-items: center; gap: 20px; font-size: 0.85rem; color: var(--py-text-light); margin-bottom: 20px; flex-wrap: wrap; }
.sp-meta-info p { margin: 0; display: flex; align-items: center; font-weight: 500; }
.sp-meta-info i { margin-right: 6px; color: var(--py-primary-color); }

/* === 3. Action Buttons (Hero) === */
.sp-action-buttons { display: flex; align-items: center; gap: 12px; margin-top: 15px; flex-wrap: wrap; }

.sp-action-buttons .sp-action-btn, 
.sp-action-buttons .py-btn, 
.sp-report-btn, 
.sp-action-buttons .plan-compare-button { 
    padding: 8px 16px !important; 
    font-size: 0.9rem !important; 
    border: 1px solid transparent; 
    cursor: pointer; 
    transition: all 0.3s ease; 
    border-radius: 8px !important; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    gap: 8px; 
    font-weight: 600 !important; 
    line-height: 1.5 !important; 
    min-width: auto; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.08); 
}

.sp-report-btn { background: #fff; color: var(--py-text-light) !important; border-color: var(--py-border-color); box-shadow: none; }
.sp-report-btn:hover { background-color: #f8f9fa; border-color: #ccc; }

.sp-action-buttons .plan-compare-button { background: #28a745; color: white !important; }
.sp-action-buttons .plan-compare-button:hover { background: #218838; transform: translateY(-2px); }

.sp-action-buttons .favorite-button { background: var(--py-primary-color); color: white !important; }
.sp-action-buttons .favorite-button:hover { background: var(--py-primary-dark); transform: translateY(-2px); }
.sp-action-buttons .favorite-button.is-favorite { background: #ffc107; color: #212529 !important; }

/* === 4. Dynamic Content Area Styling === */
.sp-dynamic-content-area {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--py-text-color);
    margin-bottom: 40px;
}

.sp-dynamic-content-area h2 {
    margin-top: 2em;
    margin-bottom: 1em;
    font-size: 1.5rem;
    color: var(--py-secondary-color);
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.sp-dynamic-content-area ul {
    background: #f8fafc;
    padding: 20px 20px 20px 40px;
    border-radius: 8px;
    border: 1px solid var(--py-border-color);
    margin-bottom: 1.5em;
}

.sp-dynamic-content-area ul li {
    margin-bottom: 10px;
}

.sp-dynamic-content-area ul li:last-child {
    margin-bottom: 0;
}

/* === 5. Social Sharing === */
.sp-social-sharing { text-align: center; margin-bottom: 40px; }
.sp-sharing-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 15px; color: var(--py-text-light); }
.sp-social-links { display: flex; align-items: center; justify-content: center; gap: 12px; }
.sp-social-links .social-link { width: 40px; height: 40px; color: #fff; font-size: 1rem; transition: all 0.3s ease; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.sp-social-links .social-link:hover { transform: translateY(-3px); }
.sp-social-links .facebook { background-color: #1877F2; }
.sp-social-links .twitter { background-color: #1DA1F2; }
.sp-social-links .whatsapp { background-color: #25D366; }
.sp-social-links .email { background-color: #7f8c8d; }

/* === 6. Comment Section === */
.sp-comment-section { margin-bottom: 40px; background: var(--py-card-bg); padding: 30px; border-radius: 12px; border: 1px solid var(--py-border-color); box-shadow: 0 4px 15px rgba(0,0,0,0.04); width: 100%; }
.sp-comment-section h2 { padding-left: 0; text-align: center; font-size: 1.3rem; margin-bottom: 20px; }

/* === 7. Latest Posts Section === */
.sp-latest-posts { margin-top: 40px; margin-bottom: 40px; padding-top: 40px; border-top: 1px solid var(--py-border-color); width: 100%; }
.sp-latest-posts h2 { text-align: center; font-size: 1.5rem; font-weight: 700; color: var(--py-secondary-color); margin-bottom: 30px; }
.sp-latest-posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.sp-latest-post-item { background: var(--py-card-bg); border: 1px solid var(--py-border-color); border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.04); overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.sp-latest-post-item:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.08); }
.sp-latest-post-item .sp-post-item-link { text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.sp-latest-post-item .post-thumbnail { position: relative; width: 100%; background-color: #f0f0f0; aspect-ratio: 16 / 9; }
.sp-latest-post-item .post-thumbnail img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sp-latest-post-item .post-thumbnail-placeholder { width: 100%; aspect-ratio: 16 / 9; background-color: #f0f0f0; }
.sp-latest-post-item .post-content { padding: 15px; flex-grow: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
.sp-latest-post-item h3 { font-size: 0.95rem; margin: 0; line-height: 1.4; color: var(--py-secondary-color); transition: color 0.2s ease; }
.sp-latest-post-item .sp-post-item-link:hover h3 { color: var(--py-primary-color); }

/* === 8. Sidebar === */
.sp-sidebar .sp-info-box { background: var(--py-card-bg); padding: 25px; border-radius: 12px; border: 1px solid var(--py-border-color); width: 100%; }
.sp-sidebar .sp-info-box h2 { font-size: 1.3rem; margin-top: 0; margin-bottom: 25px; }
.sp-related-post { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px dashed var(--py-border-color); }
.sp-related-post:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.sp-related-post h3 { font-size: 1rem; margin: 0 0 10px 0; line-height: 1.4; font-weight: 600; }
.sp-related-post h3 a { color: var(--py-secondary-color); }
.sp-related-post p { font-size: 0.9em; margin: 0 0 8px 0; color: var(--py-text-light); }
.sp-related-post-details { margin-bottom: 15px; }
.sp-related-actions { display: flex; gap: 10px; margin-top: 15px; }
.sp-related-actions a, .sp-related-actions button { flex: 1; padding: 6px 10px; font-size: 0.8em; border-radius: 6px; text-align: center; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: all 0.3s ease; }
.sp-related-actions .sp-view-btn { background-color: rgba(var(--py-primary-rgb), 0.1); color: var(--py-primary-color) !important; }
.sp-related-actions .sp-view-btn:hover { background-color: var(--py-primary-color); color: #fff !important; }
.sp-related-actions .plan-compare-button { background-color: #f8f9fa; color: var(--py-text-color); border: 1px solid var(--py-border-color); }
.sp-related-actions .plan-compare-button:hover { background-color: #e9ecef; border-color: #ccc; }

/* === 9. Report Modal === */
.sp-report-modal { display: none; position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); backdrop-filter: blur(4px); justify-content: center; align-items: center; padding: 20px; box-sizing: border-box; }
.sp-report-modal-content { background-color: #fff; padding: 25px; border-radius: 16px; width: 100%; max-width: 450px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); position: relative; animation: modalFadeIn 0.3s ease; max-height: 85vh; overflow-y: auto; }
.sp-report-modal-content h2 { font-size: 1.2rem; margin-top: 0; margin-bottom: 20px; color: var(--py-secondary-color); text-align: center; font-weight: 700; }
@keyframes modalFadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.sp-report-modal-close { background: #f1f3f5; color: #333; border: none; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px; position: absolute; top: 15px; right: 15px; transition: all 0.2s; }
.sp-report-modal-close:hover { background: #e9ecef; transform: rotate(90deg); }
.sp-report-modal .form-group { margin-bottom: 15px; }
.sp-report-modal label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--py-secondary-color); font-size: 0.9rem; }
.sp-report-modal select, .sp-report-modal textarea { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 0.9rem; transition: border-color 0.3s ease; box-sizing: border-box; font-family: inherit; }
.sp-report-modal select:focus, .sp-report-modal textarea:focus { border-color: var(--py-primary-color); outline: none; box-shadow: 0 0 0 2px rgba(var(--py-primary-rgb), 0.1); }
.sp-report-modal textarea { min-height: 120px; resize: vertical; }
.sp-report-modal .sp-submit-btn { display: inline-block; background-color: var(--py-primary-color); color: white; padding: 10px 20px; border-radius: 8px; font-size: 0.95rem; border: none; cursor: pointer; transition: background-color 0.3s ease, transform 0.2s ease; font-weight: 600; width: 100%; margin-top: 10px; }
.sp-report-modal .sp-submit-btn:hover { background-color: var(--py-primary-dark); transform: translateY(-1px); }
.sp-report-modal .sp-submit-btn:active { transform: translateY(0); }
.sp-report-status { margin: 12px 0; padding: 10px; border-radius: 6px; display: none; font-size: 0.85rem; text-align: center; }
.sp-report-status.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.sp-report-status.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* === 10. Responsive === */
@media (max-width: 992px) { 
    .sp-container { flex-direction: column; } 
    .sp-main, .sp-sidebar { flex: 1 1 100%; min-width: 100%; } 
}

@media (max-width: 768px) { 
    .sp-container { margin: 20px auto; padding: 0 15px; } 
    
    .sp-hero { 
        display: grid;
        grid-template-columns: min-content 1fr; 
        grid-template-rows: auto auto auto; 
        gap: 15px 15px; 
        align-items: center;
        padding: 20px; 
    } 
    
    .sp-hero-logo {
        grid-row: 1;
        grid-column: 1;
        width: auto;
        margin-right: 0;
        position: relative;
        z-index: 2; 
    }
    
    .sp-hero-image { width: 60px; height: 60px; padding: 5px; flex: 0 0 60px; }
    
    .sp-hero-content-wrapper { 
        display: contents; 
    } 
    
    .sp-hero-title-row {
        grid-row: 1;
        grid-column: 2;
        text-align: left;
        width: 100%;
        position: relative;
        z-index: 2; 
    }
    
    .sp-hero-title { font-size: 1.4rem; margin-bottom: 0; line-height: 1.2; padding-right: 20px; } 
    
    .sp-meta-info { 
        grid-row: 2;
        grid-column: 1 / -1; 
        justify-content: space-between; 
        flex-wrap: nowrap; 
        gap: 10px; 
        margin-bottom: 0; 
        width: 100%;
        background: #f9fafb; 
        padding: 8px 10px;
        border-radius: 8px;
        position: relative;
        z-index: 2; 
    } 

    .sp-meta-info .sp-meta-label { display: none; }
    
    .sp-action-buttons { 
        grid-row: 3;
        grid-column: 1 / -1; 
        justify-content: space-between; 
        flex-wrap: nowrap; 
        gap: 8px; 
        width: 100%;
        margin-top: 0;
        position: relative;
        z-index: 5; 
    } 

    .sp-action-buttons .sp-action-btn, 
    .sp-action-buttons .py-btn, 
    .sp-report-btn, 
    .sp-action-buttons .plan-compare-button {
        flex: 1; 
        padding: 10px 0 !important; 
        font-size: 0.9rem !important;
        gap: 0;
        justify-content: center;
        min-width: 0;
        height: 40px; 
    }

    .sp-favorite-wrapper {
        flex: 1; 
        display: flex;
        height: 40px;
    }
    
    .sp-favorite-wrapper .simplefavorite-button,
    .sp-favorite-wrapper button {
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 0 !important;
        border-radius: 8px !important;
        margin: 0 !important;
    }

    .sp-action-buttons span { display: none; }
    .sp-action-buttons i { margin-right: 0 !important; font-size: 1rem !important; }

    .sp-report-modal { padding: 15px; }
    .sp-report-modal-content { padding: 20px; max-height: 90vh; max-width: 95%; }
    .sp-report-modal-content h2 { font-size: 1.1rem; margin-bottom: 15px; }
    .sp-report-modal-close { width: 30px; height: 30px; top: 10px; right: 10px; }
    .sp-report-modal select, .sp-report-modal textarea { font-size: 0.85rem; padding: 8px 10px; }
    .sp-report-modal textarea { min-height: 100px; }
    .sp-report-modal .sp-submit-btn { padding: 10px 15px; font-size: 0.9rem; }

    .sp-latest-posts-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .sp-latest-post-item .post-content { padding: 12px; }
    .sp-latest-post-item h3 { font-size: 0.85rem; }
}

/* ==========================================================================
   11. SMART INTERNAL LINKING
   ========================================================================== */
.sp-smart-links-section { margin: 40px 0; padding: 25px; background-color: #f8f9fa; border-radius: 12px; border: 1px solid var(--py-border-color); width: 100%; }
.sp-smart-title { font-size: 1.2rem; margin-top: 0; margin-bottom: 20px; text-align: center; color: var(--py-secondary-color); }
.sp-smart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; }
.sp-smart-card { display: flex; flex-direction: column; align-items: flex-start; background: #fff; border: 1px solid var(--py-border-color); border-radius: 8px; padding: 15px; text-decoration: none; position: relative; transition: transform 0.2s, box-shadow 0.2s; overflow: hidden; height: 100%; }
.sp-smart-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.08); border-color: var(--py-primary-color); }
.smart-badge { display: inline-block; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; color: #fff; margin-bottom: 10px; letter-spacing: 0.5px; }
.sp-smart-card.upgrade .smart-badge { background-color: #8e44ad; } 
.sp-smart-card.saver .smart-badge { background-color: #27ae60; }   
.sp-smart-card.competitor .smart-badge { background-color: #e67e22; } 
.smart-content { width: 100%; margin-bottom: 10px; }
.smart-content h4 { font-size: 0.95rem; margin: 0 0 8px 0; color: var(--py-secondary-color); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.smart-price { font-weight: 700; color: var(--py-primary-color); font-size: 1rem; display: block; }
.smart-footer { margin-top: auto; width: 100%; display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid #f1f1f1; color: var(--py-primary-color); font-size: 0.8rem; font-weight: 600; }
@media (max-width: 768px) { .sp-smart-grid { grid-template-columns: 1fr; } }

/* === ADDITIONAL STYLES FOR ENHANCED REPORT MODAL === */
.sp-radio-group { display: flex; flex-direction: column; gap: 10px; }
.sp-radio-option { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid #e0e0e0; border-radius: 8px; transition: all 0.2s ease; }
.sp-radio-option:hover { background-color: #f8f9fa; border-color: var(--py-primary-color); }
.sp-radio-option input[type="radio"] { margin: 0; width: 18px; height: 18px; }
.sp-radio-option label { margin: 0; font-weight: 500; cursor: pointer; font-size: 0.9rem; color: var(--py-text-color); }
.sp-form-label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--py-secondary-color); font-size: 0.9rem; }
.sp-required { color: #dc3545; }
.sp-form-hint { display: block; margin-top: 4px; font-size: 0.8rem; color: #6c757d; }
.sp-form-note { margin-top: 15px; padding: 8px 12px; background-color: #f8f9fa; border-radius: 6px; font-size: 0.85rem; color: #6c757d; border-left: 3px solid var(--py-primary-color); }
.sp-form-note i { color: var(--py-primary-color); margin-right: 8px; }
.sp-form-footer { margin-top: 20px; padding-top: 15px; border-top: 1px solid #e9ecef; }
.loading-spinner { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 768px) { .sp-radio-option { padding: 10px 12px; } .sp-radio-option label { font-size: 0.85rem; } }

/* ==========================================================================
   12. PRICE HISTORY CHART SECTION
   ========================================================================== */
.sp-price-chart-section {
    margin-bottom: 40px;
    background: var(--py-card-bg);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--py-border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    width: 100%; 
}

.sp-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--py-secondary-color);
    margin-top: 0;
    margin-bottom: 20px;
    padding-left: 15px;
    position: relative;
}

.sp-section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 70%;
    width: 4px;
    background: var(--py-primary-color);
    border-radius: 2px;
}

.sp-chart-container {
    position: relative;
    height: 300px; 
    width: 100%;
    overflow: hidden; 
    max-width: 100%; 
}

canvas#priceHistoryChart {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
}

.sp-chart-note {
    font-size: 0.85rem;
    color: var(--py-text-light);
    text-align: center;
    margin-top: 15px;
    margin-bottom: 0;
    font-style: italic;
}

@media (max-width: 768px) {
    .sp-price-chart-section {
        padding: 15px; 
    }
    .sp-chart-container {
        height: 220px; 
    }
}