.certificate_main_div .post_slider {
    aspect-ratio: unset;
}

.certificate_main_div {
    row-gap: 10px;
    width: 90%;
    margin: auto;
    margin-bottom: 50px;
}

.certificate_div {
    height: auto;
    width: 100%;
    border: 2px solid var(--text-color);
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.4s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.certificate_div::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(28, 111, 172, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(28, 111, 172, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.certificate_div>* {
    position: relative;
    z-index: 1;
}

.certificate_div:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(28, 111, 172, 0.2);
    border-color: rgba(28, 111, 172, 0.8);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.certificate_div p {
    margin: 0 0 15px 0;
    text-align: center;
    background: var(--background-color);
    color: #fff;
    padding: 12px 15px;
    font-size: 18px;
    border-radius: 10px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
    letter-spacing: 0.5px;
}

.certificate_div img {
    object-fit: contain;
    height: 100%;
    width: 100%;
    border-radius: 8px;
    background: #f8f9fa;
    padding: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.certificate_div:hover img {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: scale(1.02);
}

/* Carousel Styles */
.post_slider {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.post_slider .carousel-inner {
    border-radius: 10px;
}

.post_slider .carousel-item {
    height: 400px;
    position: relative;
    background: #f8f9fa;
}

.post_slider .post_slider_image {
    object-fit: contain !important;
    width: 100%;
    height: 100%;
    background: white;
    padding: 10px;
    border-radius: 8px;
}

.post_slider .slider_count {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 12px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.9) 100%);
    color: #fff;
    backdrop-filter: blur(5px);
    padding: 6px 12px;
    border-radius: 20px;
    z-index: 10;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Carousel Controls */
.post_slider .carousel-control-prev,
.post_slider .carousel-control-next {
    width: 45px;
    height: 45px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.8) 100%);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 15;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.post_slider .carousel-control-prev {
    left: 15px;
}

.post_slider .carousel-control-next {
    right: 15px;
}

.post_slider .carousel-control-prev-icon,
.post_slider .carousel-control-next-icon {
    background-size: 14px 14px !important;
    background-color: transparent;
    border: none;
    padding: 0 !important;
    margin: 0 !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.post_slider .carousel-control-prev:hover,
.post_slider .carousel-control-next:hover {
    background: linear-gradient(135deg, rgba(28, 111, 172, 0.8) 0%, rgba(28, 111, 172, 0.9) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(28, 111, 172, 0.3);
}

/* PDF Preview Styles */
.pdf-thumbnail-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f9fa;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.pdf-thumbnail-container iframe {
    transition: transform 0.3s ease;
    filter: contrast(1.1) brightness(1.05);
}

.pdf-thumbnail-container:hover iframe,
.carousel-item:hover .pdf-preview-iframe {
    transform: scale(0.75) translate(-16.7%, -16.7%) !important;
    filter: contrast(1.2) brightness(1.1);
}

/* Enhanced PDF preview styling */
.pdf-preview-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    overflow: hidden;
    box-shadow:
        inset 0 1px 3px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.1);
}

.pdf-preview-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(0, 0, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.pdf-preview-iframe {
    width: 120%;
    height: 120%;
    border: none;
    transform: scale(0.83) translate(-10%, -10%);
    transform-origin: center center;
    pointer-events: none;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pdf-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    z-index: 5;
    backdrop-filter: blur(2px);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.6) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.3s ease;
    border-radius: 10px;
    z-index: 8;
    backdrop-filter: blur(2px);
}

.carousel-item:hover .preview-overlay {
    opacity: 1;
}

.preview-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
    font-size: 14px;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.preview-btn:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.4);
}

.preview-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.preview-btn i {
    margin-right: 6px;
    color: #dc3545;
}

/* PDF Fallback Styles */
.pdf-fallback {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    min-height: 400px;
}

.pdf-fallback:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.pdf-fallback::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* PDF Content Styling */
.pdf-fallback .btn {
    transition: all 0.2s ease;
}

.pdf-fallback .btn:hover {
    transform: translateY(-1px);
}

.pdf-fallback .btn-danger:hover {
    background: #c82333 !important;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.pdf-fallback .btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

/* Animation for PDF icon */
.pdf-fallback:hover .fas.fa-file-pdf {
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    .certificate_main_div {
        gap: 40px;
        width: 95%;
    }

    .certificate_div {
        padding: 12px;
        border-radius: 12px;
    }

    .certificate_div p {
        font-size: 16px;
        padding: 10px 12px;
        margin-bottom: 12px;
    }

    .post_slider .carousel-item {
        height: 300px;
    }

    .pdf-fallback {
        min-height: 300px;
    }

    .post_slider .carousel-control-prev,
    .post_slider .carousel-control-next {
        width: 38px;
        height: 38px;
    }

    .post_slider .carousel-control-prev-icon,
    .post_slider .carousel-control-next-icon {
        background-size: 11px 11px !important;
    }

    .preview-overlay {
        opacity: 1;
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.5) 100%);
    }

    .preview-btn {
        padding: 10px 18px;
        font-size: 12px;
    }

    .preview-btn {
        padding: 8px 16px;
        font-size: 12px;
    }

    .pdf-badge {
        font-size: 9px;
        padding: 3px 6px;
    }

    .post_slider .slider_count {
        font-size: 11px;
        padding: 4px 8px;
    }
}

@media screen and (max-width: 480px) {
    .certificate_main_div {
        width: 98%;
    }

    .certificate_div {
        padding: 5px;
    }

    .certificate_div p {
        font-size: 14px;
        padding: 6px;
    }

    .post_slider .carousel-item {
        height: 250px;
    }

    .pdf-fallback {
        min-height: 250px;
    }

    .preview-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
}