/* Certificates Page Styling */
.certificates-section {
    padding: 60px 0;
    background-color: #f8f9fa;
}

.section-header {
    margin-bottom: 50px;
}

.section-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    position: relative;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.section-header h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: teal;
}

/* Certificate Card Styles */
.cert-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    height: 100%;
}

.cert-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.cert-img-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1/1.4;
    /* Typical certificate aspect ratio */
}

.cert-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.cert-card:hover .cert-img-container img {
    transform: scale(1.05);
}

.cert-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 128, 128, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cert-card:hover .cert-overlay {
    opacity: 1;
}

.view-btn {
    background: white;
    color: teal;
    border: none;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: 600;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.cert-card:hover .view-btn {
    transform: translateY(0);
}

.cert-body {
    padding: 20px;
    text-align: center;
}

.cert-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.cert-body p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0;
}

/* Modal Customization */
.modal-content {
    border-radius: 15px;
    overflow: hidden;
    border: none;
}

.modal-header {
    border-bottom: 1px solid #eee;
    padding: 15px 25px;
}

.modal-body {
    padding: 0;
    background: #f0f0f0;
}

.modal-body img {
    width: 100%;
    height: auto;
    display: block;
}

.btn-close:focus {
    box-shadow: none;
}

/* PDF Viewer Styles */
.pdf-viewer {
    width: 100%;
    height: 75vh;
    border: none;
    border-radius: 8px;
    background: #fff;
}

/* PDF Placeholder for Cards */
.pdf-placeholder {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f1f8f8;
    color: teal;
    padding: 20px;
    text-align: center;
}

.pdf-placeholder i {
    font-size: 4rem;
    margin-bottom: 10px;
}

.pdf-placeholder span {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cert-item.hidden {
    display: none !important;
    opacity: 0;
    transform: scale(0.8);
}

.cert-item.show {
    display: flex !important;
    animation: fadeInScale 0.5s ease forwards;
}

/* Zig-Zag Layout Styles */
.certificates-section {
    padding: 60px 0;
    background: #fff;
}

.cert-row {
    margin-bottom: 100px;
    align-items: center;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.cert-row.visible {
    opacity: 1;
    transform: translateY(0);
}

.cert-row:last-child {
    margin-bottom: 0;
}

.cert-content {
    padding: 40px;
}

.cert-content h2 {
    color: #008080;
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 2.2rem;
}

.cert-content p {
    color: #555;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 30px;
}

.cert-media-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    max-width: 420px;
    /* Constrain image size */
    width: 100%;
    margin: 0 auto;
    /* Center in column */
    aspect-ratio: 4 / 3;
    /* Maintain consistent feel */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.cert-media-container:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.15);
}

.cert-media-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cert-media-container .pdf-placeholder {
    height: 100%;
}

.cert-media-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 128, 128, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.cert-media-container:hover .cert-media-overlay {
    opacity: 1;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation for cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cert-item {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.cert-item:nth-child(1) {
    animation-delay: 0.1s;
}

.cert-item:nth-child(2) {
    animation-delay: 0.2s;
}

.cert-item:nth-child(3) {
    animation-delay: 0.3s;
}

.cert-item:nth-child(4) {
    animation-delay: 0.4s;
}

.cert-item:nth-child(5) {
    animation-delay: 0.5s;
}

.cert-item:nth-child(6) {
    animation-delay: 0.6s;
}