/* Responsive gallery container for all layouts */
.pdf-gallery-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 10px;
}

/* Single PDF item base style */
.pdf-gallery-item {
    width: 150px;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    font-family: Arial, sans-serif;
    transition: transform 0.3s ease;
    display: block;
}

.pdf-gallery-item:hover {
    transform: scale(1.05);
}

.pdf-icon img {
    width: 100%;
    height: auto;
    max-width: 80px;
    margin: 0 auto;
    display: block;
    border-radius: 4px;
}

.pdf-view-link {
    color: #7db3da;
    font-size: 14px;
    text-decoration: none;
    margin-top: 5px;
    display: block;
}

.pdf-view-link:hover {
    text-decoration: underline;
}

/* Truncated title with ellipsis and consistent height */
.pdf-title {
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2em;
    height: 2.4em;
    word-break: break-word;
    width: 100%;
}

/* Responsive widths */
@media (max-width: 600px) {
    .pdf-gallery-item {
        width: 100px;
    }
}

@media (min-width: 600px) and (max-width: 900px) {
    .pdf-gallery-item {
        width: 120px;
    }
}

/* Modal viewer styles */
.pdf-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
}

.pdf-modal-content {
    background-color: #fff;
    margin: auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    position: relative;
}

.pdf-modal-close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.pdf-modal-close:hover {
    color: #000;
}

.pdf-modal-controls {
    text-align: center;
    margin-bottom: 10px;
}

.pdf-modal-controls button,
.pdf-modal-controls a {
    background-color: #7db3da;
    color: #fff;
    border: none;
    padding: 6px 10px;
    margin: 0 5px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
}

.pdf-modal-controls button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.pdf-modal-controls button i,
.pdf-modal-controls a i,
.pdf-modal-close i {
    font-size: 18px;
    color: #333;
}

.pdf-modal-navigation {
    text-align: center;
    margin-top: 15px;
}

.pdf-modal-navigation button {
    background-color: #7db3da;
    color: #fff;
    border: none;
    padding: 6px 12px;
    margin: 0 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.pdf-modal-navigation button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Grid layout (default) */
.pdf-gallery-container.layout-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

/* List layout styles */
.pdf-gallery-container.layout-list {
    display: block;
    padding: 0 20px;
}

.pdf-gallery-container.layout-list .pdf-gallery-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 700px;
    margin: 10px auto;
}

.pdf-gallery-container.layout-list .pdf-icon {
    flex: 0 0 80px;
}

.pdf-gallery-container.layout-list .pdf-info {
    flex: 1;
    text-align: left;
}

/* Slider layout via Swiper */
.swiper.layout-slider {
    padding: 30px 0;
}

.layout-slider .swiper-slide.pdf-gallery-item {
    flex-shrink: 0;
    width: 180px !important;
    max-width: 180px;
    min-width: 180px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.swiper-button-next,
.swiper-button-prev {
    color: #7db3da;
}

.swiper-pagination-bullet-active {
    background-color: #7db3da;
}