/* === Container and Search === */
#cipfv-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

#cipfv-search {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    margin-bottom: 20px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

/* === Card Layout === */
.cipfv-card {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    align-items: flex-start;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    background: #fff;
}

/* Thumbnail image */
.cipfv-card img {
    flex-shrink: 0;
    width: 120px;
    height: auto;
    border-radius: 6px;
    cursor: zoom-in;
    object-fit: cover;
}

/* Card content in two-column grid */
.cipfv-card div {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
    font-size: 15px;
}

/* PDF button */
.cipfv-pdf-btn {
    grid-column: span 2;
    background-color: #0073aa;
    color: white;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 8px;
    text-align: center;
    transition: background 0.3s ease;
}
.cipfv-pdf-btn:hover {
    background-color: #005f8d;
}

/* === Lightbox === */
#cipfv-lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

#cipfv-lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 0 15px #000;
}

/* === PDF Modal === */
#cipfv-pdf-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.85);
    z-index: 1001;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}

#cipfv-pdf-modal iframe {
    width: 90%;
    height: 80%;
    border: none;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 20px #000;
}

#cipfv-pdf-modal-close {
    position: absolute;
    top: 16px;
    right: 24px;
    font-size: 32px;
    color: white;
    cursor: pointer;
    z-index: 1002;
}

#cipfv-pdf-download {
    background-color: #28a745;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 15px;
    margin-top: 12px;
    z-index: 1002;
}
#cipfv-pdf-download:hover {
    background-color: #218838;
}

/* === Scroll Lock (while modal open) === */
body.cipfv-scroll-lock {
    overflow: hidden;
}

/* === Responsive Layout === */
@media (max-width: 768px) {
    .cipfv-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .cipfv-card img {
        width: 80px;
        margin-bottom: 10px;
    }

    .cipfv-card div {
        grid-template-columns: 1fr;
        text-align: left;
    }

    #cipfv-pdf-modal iframe {
        width: 100%;
        height: 70%;
    }

    #cipfv-pdf-download {
        font-size: 14px;
        padding: 8px 16px;
    }

    #cipfv-pdf-modal-close {
        font-size: 28px;
        top: 10px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    #cipfv-pdf-modal iframe {
        height: 65%;
    }

    #cipfv-pdf-download {
        font-size: 13px;
        padding: 6px 14px;
    }
}
