/* Portfolio Grid - Wrapper stays inside content area */
.pf-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.pf-grid {
    display: grid;
    gap: 25px;
    margin: 30px 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.pf-columns-2 { grid-template-columns: repeat(2, 1fr); }
.pf-columns-3 { grid-template-columns: repeat(3, 1fr); }
.pf-columns-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .pf-columns-3, .pf-columns-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .pf-columns-2, .pf-columns-3, .pf-columns-4 { grid-template-columns: 1fr; }
}

.pf-empty {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 8px;
    color: #666;
    font-size: 16px;
}

.pf-item {
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.pf-item:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    transform: translateY(-3px);
}

.pf-item-inner {
    position: relative;
    width: 100%;
    padding-bottom: 75%;
    overflow: hidden;
    background: #f0f0f0;
}

.pf-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.4s ease;
    image-rendering: auto;
}

.pf-item:hover .pf-thumbnail {
    transform: scale(1.08);
}

.pf-thumbnail.pf-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.pf-thumbnail.pf-no-image .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: rgba(255,255,255,0.7);
}

.pf-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pf-item:hover .pf-overlay {
    transform: translateY(0);
}

.pf-title {
    color: #fff;
    font-size: 16px;
    margin: 0;
    line-height: 1.3;
}

.pf-view-btn {
    display: inline-block;
    background: #fff;
    color: #333;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    align-self: flex-start;
    transition: background 0.2s;
}

.pf-view-btn:hover {
    background: #f0f0f0;
}

/* Mobile: always show overlay */
@media (max-width: 600px) {
    .pf-overlay {
        transform: translateY(0);
        background: linear-gradient(transparent 0%, rgba(0,0,0,0.8) 50%);
        padding: 15px;
    }
    .pf-title { font-size: 14px; }
    .pf-view-btn { font-size: 11px; padding: 4px 12px; }
}

/* === MODAL === */
.pf-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.pf-modal.pf-active {
    opacity: 1;
    visibility: visible;
}

.pf-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}

.pf-modal-wrap {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
}

.pf-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.pf-modal.pf-active .pf-modal-content {
    transform: scale(1) translateY(0);
}

.pf-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 20px;
    line-height: 1;
}

.pf-modal-close:hover {
    background: rgba(0,0,0,0.8);
}

.pf-modal-close .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

.pf-modal-body {
    padding: 0;
}

.pf-modal-loading {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* Modal Screenshots Slider */
.pf-modal-screenshots {
    position: relative;
    background: #1a1a2e;
    min-height: 300px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.pf-slider-container {
    width: 100%;
    position: relative;
}

.pf-slider-track {
    display: flex;
    transition: transform 0.4s ease;
}

.pf-slide {
    min-width: 100%;
    box-sizing: border-box;
}

.pf-slide img {
    width: 100%;
    display: block;
    max-height: 500px;
    object-fit: contain;
    margin: 0 auto;
    image-rendering: auto;
}

.pf-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 5;
}

.pf-slider-btn:hover {
    background: rgba(255,255,255,0.3);
}

.pf-slider-prev { left: 12px; }
.pf-slider-next { right: 12px; }

.pf-slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}

.pf-slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.pf-slider-dot.pf-active {
    background: #fff;
}

.pf-no-screenshots {
    width: 100%;
    text-align: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.5);
    font-size: 16px;
}

/* Modal Info */
.pf-modal-info {
    padding: 30px;
}

.pf-modal-title {
    font-size: 28px;
    margin: 0 0 15px;
    color: #222;
    font-weight: 700;
}

.pf-modal-description {
    font-size: 16px;
    line-height: 1.7;
    color: #555;
    margin-bottom: 20px;
}

.pf-modal-description p:last-child {
    margin-bottom: 0;
}

.pf-modal-url {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f0f4ff;
    color: #3b82f6;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 14px;
}

.pf-modal-url:hover {
    background: #3b82f6;
    color: #fff;
}

.pf-modal-url .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

/* Scrollbar styling */
.pf-modal-content::-webkit-scrollbar {
    width: 8px;
}
.pf-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.pf-modal-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}
.pf-modal-content::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Body lock when modal open */
body.pf-modal-open {
    overflow: hidden;
}
