/* ==========================================================================
   Project List Plugin - Carousel Grid Styles
   Version: 1.0.0
   ========================================================================== */

/* Main wrapper - Fixed height container */
.plp-projects-wrapper {
    position: relative;
    padding: 20px 50px;
    overflow: hidden;
    box-sizing: border-box;
}

/* Filters */
.plp-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.plp-filter-btn {
    padding: 8px 20px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
}

.plp-filter-btn:hover {
    background: #e0e0e0;
}

.plp-filter-btn.plp-active {
    background: #0B72CF;
    color: #fff;
}

/* Carousel container - Fixed height */
.plp-carousel-container {
    position: relative;
    height: var(--plp-height, 500px);
    overflow: hidden;
    border-radius: 8px;
}

/* Pages track for horizontal sliding */
.plp-pages-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Individual page */
.plp-page {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    opacity: 1;
}

/* Grid inside each page */
.plp-projects-grid {
    display: grid;
    grid-template-columns: repeat(var(--plp-columns, 4), 1fr);
    grid-template-rows: repeat(var(--plp-rows, 2), 1fr);
    gap: 4px;
    height: 100%;
    width: 100%;
}

/* Individual project item */
.plp-project-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #ffffff;
}

/* Project image - Cover the entire cell */
.plp-project-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: var(--plp-fit, cover);
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.4s ease, filter 0.4s ease;
}

/* Fit modes - contain needs background color visible */
.plp-projects-wrapper[data-fit="contain"] .plp-project-item {
    background: #ffffff;
}

.plp-projects-wrapper[data-fit="contain"] .plp-project-item:hover .plp-project-image {
    transform: scale(1.05);
}

.plp-project-image.plp-no-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.plp-project-item:hover .plp-project-image {
    transform: scale(1.1);
    filter: brightness(0.7);
}

/* Overlay with title */
.plp-project-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 50%, transparent 100%);
    color: #fff;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 40%;
}

.plp-project-item:hover .plp-project-overlay {
    transform: translateY(0);
}

.plp-project-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.plp-project-category {
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   NAVIGATION - Side Arrows
   ============================================ */
.plp-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: #e0e0e0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, opacity 0.3s ease;
    z-index: 10;
    padding: 0;
    line-height: 1;
}

.plp-nav-arrow:hover {
    background: #c0c0c0;
}

.plp-nav-arrow:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
    opacity: 0.5;
}

.plp-nav-arrow svg {
    width: 18px;
    height: 18px;
    fill: #666;
}

.plp-nav-arrow:hover svg {
    fill: #333;
}

.plp-nav-arrow:disabled svg {
    fill: #aaa;
}

.plp-prev-arrow {
    left: 0;
}

.plp-next-arrow {
    right: 0;
}

/* ============================================
   MODAL - Image Zoom
   ============================================ */
.plp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.plp-modal-overlay.plp-modal-active {
    opacity: 1;
    visibility: visible;
}

.plp-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.plp-modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.plp-modal-active .plp-modal-image {
    transform: scale(1);
}

.plp-modal-title {
    color: #fff;
    font-size: 18px;
    margin-top: 15px;
    text-align: center;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.plp-modal-category {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    margin-top: 5px;
}

.plp-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.plp-modal-close:hover {
    background: #fff;
    color: #000;
}

.plp-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.plp-modal-nav:hover {
    background: rgba(255,255,255,0.4);
}

.plp-modal-prev {
    left: -70px;
}

.plp-modal-next {
    right: -70px;
}

@media (max-width: 768px) {
    .plp-modal-nav {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
    .plp-modal-prev {
        left: -50px;
    }
    .plp-modal-next {
        right: -50px;
    }
    .plp-modal-close {
        top: -35px;
        width: 32px;
        height: 32px;
    }
}

/* ============================================
   PAGINATION - Dots
   ============================================ */
.plp-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.plp-pagination-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.plp-pagination-dot {
    width: 12px;
    height: 12px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    background: #ccc;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.plp-pagination-dot:hover {
    background: #999;
    transform: scale(1.2);
}

.plp-pagination-dot.plp-active {
    background: #0B72CF;
    transform: scale(1.3);
}

.plp-page-info {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

/* ============================================
   Animation Classes
   ============================================ */
.plp-projects-wrapper.plp-js-ready .plp-project-item {
    opacity: 0;
    transform: scale(0.9);
}

.plp-projects-wrapper.plp-js-ready .plp-project-item.plp-visible {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Staggered animation delay */
.plp-projects-wrapper.plp-js-ready .plp-project-item:nth-child(1) { transition-delay: 0.05s; }
.plp-projects-wrapper.plp-js-ready .plp-project-item:nth-child(2) { transition-delay: 0.10s; }
.plp-projects-wrapper.plp-js-ready .plp-project-item:nth-child(3) { transition-delay: 0.15s; }
.plp-projects-wrapper.plp-js-ready .plp-project-item:nth-child(4) { transition-delay: 0.20s; }
.plp-projects-wrapper.plp-js-ready .plp-project-item:nth-child(5) { transition-delay: 0.25s; }
.plp-projects-wrapper.plp-js-ready .plp-project-item:nth-child(6) { transition-delay: 0.30s; }
.plp-projects-wrapper.plp-js-ready .plp-project-item:nth-child(7) { transition-delay: 0.35s; }
.plp-projects-wrapper.plp-js-ready .plp-project-item:nth-child(8) { transition-delay: 0.40s; }
.plp-projects-wrapper.plp-js-ready .plp-project-item:nth-child(9) { transition-delay: 0.45s; }
.plp-projects-wrapper.plp-js-ready .plp-project-item:nth-child(10) { transition-delay: 0.50s; }
.plp-projects-wrapper.plp-js-ready .plp-project-item:nth-child(11) { transition-delay: 0.55s; }
.plp-projects-wrapper.plp-js-ready .plp-project-item:nth-child(12) { transition-delay: 0.60s; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .plp-projects-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .plp-project-title {
        font-size: 14px;
    }
}

@media (max-width: 992px) {
    .plp-projects-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .plp-projects-wrapper {
        padding: 15px 45px;
    }
    .plp-nav-arrow {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 768px) {
    .plp-projects-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        grid-template-rows: repeat(2, 1fr) !important;
    }
    .plp-projects-wrapper {
        padding: 10px 40px;
    }
    .plp-carousel-container {
        height: 350px !important;
    }
    .plp-project-overlay {
        transform: translateY(0);
        background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
        min-height: 30%;
        padding: 10px;
    }
    .plp-project-title {
        font-size: 12px;
    }
    .plp-project-category {
        font-size: 10px;
    }
    .plp-filter-btn {
        padding: 6px 14px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .plp-projects-grid {
        grid-template-columns: 1fr !important;
        grid-template-rows: repeat(2, 1fr) !important;
    }
    .plp-projects-wrapper {
        padding: 10px 35px;
    }
    .plp-carousel-container {
        height: 300px !important;
    }
    .plp-nav-arrow {
        width: 32px;
        height: 32px;
    }
    .plp-nav-arrow svg {
        width: 16px;
        height: 16px;
    }
}

/* No projects message */
.plp-no-projects {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* Hidden items (for filtering) */
.plp-project-item.plp-hidden {
    display: none !important;
}