/* Background overlay, blocks interaction behind it */
.web4t-prp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: none;
    /* Hidden by default, JS will set to display: flex */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.web4t-prp-overlay.show {
    opacity: 1;
}

/* Main popup container */
.web4t-prp-container {
    background: #fff;
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.web4t-prp-overlay.show .web4t-prp-container {
    transform: translateY(0) scale(1);
}

/* Header Popup */
.web4t-prp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #ebebeb;
    background: #fdfdfd;
}

.web4t-prp-container h3.web4t-prp-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #222 !important;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 430px) {
    .web4t-prp-container h3.web4t-prp-title{
        font-size: 16px !important;
    }
}

.web4t-prp-close {
    background: #f1f1f1;
    border: none;
    color: #555;
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    /* display: flex; */
    /* justify-content: center; */
    /* align-items: center; */
    transition: all 0.3s ease;
    /*padding-bottom: 5px; */
}

.web4t-prp-close:hover {
    background: #ff4757;
    color: #fff;
}

/* Post list content */
.web4t-prp-content {
    padding: 24px;
    overflow-y: auto;
}

/* Custom ultra-thin scrollbar */
.web4t-prp-content::-webkit-scrollbar {
    width: 6px;
}

.web4t-prp-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.web4t-prp-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.web4t-prp-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Footer button */
.web4t-prp-footer {
    padding: 16px 24px;
    background: #fafafa;
    border-top: 1px solid #ebebeb;
    text-align: right;
}

.web4t-prp-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #2b70fa;
    color: #fff;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.3s ease;
    font-size: 0.95rem;
}

.web4t-prp-btn:hover {
    background: #1852c9;
    color: #fff;
    text-decoration: none;
}

/* ================== TEMPLATE LIST ================== */
.web4t-prp-list .web4t-prp-item {
    display: flex;
    margin-bottom: 20px;
    gap: 16px;
    border-bottom: 1px solid #f2f2f2;
    padding-bottom: 20px;
}

.web4t-prp-list .web4t-prp-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.web4t-prp-item-thumb {
    flex: 0 0 140px;
    height: 100px;
    overflow: hidden;
    border-radius: 8px;
    position: relative;
    background-color: #f5f5f5;
}

.web4t-prp-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.web4t-prp-item:hover .web4t-prp-item-thumb img {
    transform: scale(1.05);
}

.web4t-prp-item-meta {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.web4t-prp-cat {
    background: #ffebe6;
    color: #ff523b;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.web4t-prp-domain {
    display: inline-block;
    color: #888;
}

.web4t-prp-item-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 8px 0;
}

.web4t-prp-container .web4t-prp-item-title a {
    color: #333 !important;
    text-decoration: none;
    transition: color 0.3s ease;
    word-break: break-word;
}

.web4t-prp-item-title a:hover {
    color: #2b70fa;
}


/* ================== TEMPLATE GRID ================== */
.web4t-prp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.web4t-prp-grid .web4t-prp-item {
    display: flex;
    flex-direction: column;
}

.web4t-prp-grid .web4t-prp-item-thumb {
    width: 100%;
    height: 160px;
    margin-bottom: 12px;
}

@media (max-width: 600px) {
    .web4t-prp-container {
        width: 95%;
    }

    .web4t-prp-list .web4t-prp-item {
        flex-direction: column;
    }

    .web4t-prp-item-thumb {
        flex: 0 0 auto;
        width: 100%;
        height: 180px;
    }
}
