/*
 * Styles for the Single Plan Template (single-plan.php)
 * VERSION 4.1: Added rule to hide meta info text labels on mobile for a cleaner look.
 */

/* === 1. Main Layout === */
.sp-container { max-width: var(--py-container-width); margin: 40px auto; display: flex; flex-wrap: wrap; gap: 40px; padding: 0 20px; }
.sp-main { flex: 1 1 65%; min-width: 0; }
.sp-sidebar { flex: 1 1 30%; min-width: 300px; }

/* === 1.5. Breadcrumb Fixes (Global for this template) === */
/* ADDED: Styles to prevent breadcrumb from breaking awkwardly on mobile */
.priceyoo-breadcrumb {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on very small screens */
    align-items: center;
    line-height: 1.5;
}
.priceyoo-breadcrumb > span:last-child {
    display: inline-block; /* Ensures it behaves correctly within the flex container */
}


/* === 2. Modern Hero Section === */
.sp-hero { display: flex; align-items: center; 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; }
.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; /* Fix for flexbox overflow */ }
.sp-hero-title { font-size: 2rem; color: var(--py-secondary-color); margin: 0 0 10px 0; font-weight: 700; line-height: 1.2; }
.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; }
.sp-action-buttons .py-btn, .sp-report-btn, .sp-action-buttons .plan-compare-button { padding: 7px 15px !important; font-size: 0.85rem !important; border: 1px solid transparent; cursor: pointer; transition: all 0.3s ease; border-radius: 8px !important; display: inline-flex; align-items: 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. Plan Details Grid (Feature Cards) === */
.sp-details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 15px; margin-bottom: 50px; }
.sp-detail-box { background: var(--py-card-bg); padding: 20px 10px; border-radius: 12px; text-align: center; border: 1px solid #f0f0f0; transition: none; box-shadow: 0 4px 15px rgba(0,0,0,0.04); }
.sp-detail-box:hover { transform: none; border-color: #f0f0f0; box-shadow: 0 4px 15px rgba(0,0,0,0.04); }
.sp-detail-box .sp-detail-icon { font-size: 1.4em; color: var(--py-primary-color); margin-bottom: 15px; display: inline-flex; align-items: center; justify-content: center; width: 45px; height: 45px; background: rgba(var(--py-primary-rgb), 0.1); border-radius: 50%; }
.sp-detail-box strong { font-size: 1.3em; display: block; margin-bottom: 6px; color: var(--py-secondary-color); font-weight: 700; line-height: 1.2; }
.sp-detail-box span { font-size: 0.7em; color: var(--py-text-light); text-transform: uppercase; letter-spacing: 1px; font-weight: 500; }

/* === 5. Content Sections (Flat Design) === */
.sp-content-section { margin-bottom: 40px; padding: 0; background-color: transparent; border-radius: 0; box-shadow: none; border: none; }
.sp-content-section h2 { margin-top: 0; margin-bottom: 25px; font-size: 1.5em; font-weight: 700; color: var(--py-secondary-color); position: relative; padding-left: 18px; }
.sp-content-section h2::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); height: 80%; width: 5px; background: var(--py-primary-color); border-radius: 3px; }

/* === 6. Collapsible Box (Unified Style for All Info Boxes) === */
.sp-collapsible-box { margin-bottom: 20px; border: 1px solid var(--py-border-color); border-radius: var(--py-border-radius); overflow: hidden; background-color: var(--py-card-bg); }
.sp-collapsible-trigger { background-color: transparent; border: none; border-bottom: 1px solid var(--py-border-color); padding: 15px 20px; width: 100%; text-align: left; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: background-color 0.2s ease; }
.sp-collapsible-trigger h2 { font-size: 1.1rem; font-weight: 600; color: var(--py-secondary-color); margin: 0; padding: 0; padding-left: 0; }
.sp-collapsible-trigger h2::before { display: none; }
.sp-collapsible-trigger:hover { background-color: #f9fafb; }
.sp-collapsible-trigger:not(.active) { border-bottom-color: transparent; }
.sp-collapsible-trigger i { transition: transform 0.3s ease; font-size: 0.9em; }
.sp-collapsible-trigger.active i { transform: rotate(180deg); }
.sp-collapsible-content { display: block; }
.sp-collapsible-content ul { list-style: none; padding: 20px; margin: 0; }
.sp-collapsible-content li { padding-left: 25px; position: relative; margin-bottom: 10px; line-height: 1.6; }
.sp-collapsible-box.sp-benefits-box .sp-collapsible-content li { font-size: 1rem; color: var(--py-text-color); }
.sp-collapsible-box.sp-benefits-box .sp-collapsible-content li::before { content: '\f00c'; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; left: 0; top: 6px; font-size: 0.9em; color: #28a745; }
.sp-collapsible-box.sp-activation-box .sp-collapsible-content li { font-size: 0.9rem; color: var(--py-text-color); }
.sp-collapsible-box.sp-activation-box .sp-collapsible-content li::before { content: '\f111'; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; left: 0; top: 8px; font-size: 0.5em; color: #bdc3c7; }
.sp-collapsible-box:not(.sp-benefits-box):not(.sp-activation-box) .sp-collapsible-content li { font-size: 0.9rem; color: var(--py-text-light); }
.sp-collapsible-box:not(.sp-benefits-box):not(.sp-activation-box) .sp-collapsible-content li::before { content: '\f054'; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; left: 0; top: 6px; font-size: 0.7em; color: var(--py-primary-color); opacity: 0.6; }

/* === 7. 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; }

/* === 8. 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); }
.sp-comment-section h2 { padding-left: 0; text-align: center; font-size: 1.3rem; margin-bottom: 20px; }
.sp-comment-section h2::before { display: none; }

/* === 8.5. Latest Posts Section (Compact Version) === */
.sp-latest-posts {
    margin-top: 40px;
    margin-bottom: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--py-border-color);
}
.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; /* Keep the container 16:9 to maintain grid alignment */
}
.sp-latest-post-item .post-thumbnail img {
    width: 100%;
    height: 100%; /* Make image fill the container */
    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);
}

/* === 9. Sidebar === */
.sp-sidebar .sp-info-box { background: var(--py-card-bg); padding: 25px; border-radius: 12px; border: 1px solid var(--py-border-color); }
.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; }

/* === 10. 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; }
.sp-report-modal-content { background-color: #fff; padding: 30px; border-radius: 16px; width: 90%; max-width: 500px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); position: relative; animation: modalFadeIn 0.3s ease; }
@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: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; 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: 20px; }
.sp-report-modal label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--py-secondary-color); }
.sp-report-modal .sp-submit-btn { display: inline-block; background-color: var(--py-primary-color); color: white; padding: 12px 25px; border-radius: 8px; font-size: 1em; border: none; cursor: pointer; transition: background-color 0.3s ease; font-weight: 600; width: 100%; }
.sp-report-modal .sp-submit-btn:hover { background-color: var(--py-primary-dark); }
.sp-report-status { margin: 15px 0; padding: 12px; border-radius: 6px; display: none; font-size: 0.9em; }
.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; }

/* === 11. 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 { flex-direction: column; text-align: center; padding: 25px; } 
    .sp-hero-content-wrapper { text-align: center; } 
    
    /* MODIFICATION: Reduced title font size for mobile */
    .sp-hero-title { font-size: 1.6rem; } 
    
    /* MODIFICATION: Ensured meta info stays on one line and centered */
    .sp-meta-info { justify-content: center; flex-wrap: nowrap; gap: 15px; } 

    /* ADDED: Hide the text labels ("Views:", "Updated:") on mobile, showing only icons and values */
    .sp-meta-info .sp-meta-label {
        display: none;
    }
    
    /* MODIFICATION: Forced action buttons onto one line */
    .sp-action-buttons { justify-content: center; flex-wrap: nowrap; gap: 8px; } 

    /* ADDED: Made action buttons more compact */
    .sp-action-buttons .py-btn, 
    .sp-report-btn, 
    .sp-action-buttons .plan-compare-button {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
        gap: 5px;
    }

    /* ADDED: Made favorite button icon-only */
    .sp-action-buttons .favorite-button {
        padding: 6px 12px !important; /* Adjust padding for a better square shape */
    }
    .sp-action-buttons .favorite-button span {
        display: none; /* Hide the text inside the favorite button */
    }

    /* START: MODIFICATIONS FOR MOBILE VIEW (Existing) */
    .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;
    }
    /* END: MODIFICATIONS FOR MOBILE VIEW (Existing) */
}