:root {
    --bg-color: #191f36;
    --snd-bg-color: #262B40;
    --text-color: #fff;
    --main-color: #d70b0bce;
}

* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Title animation */
.title {
    font-size: 2em;
    margin-top: 10px; /* Reduced top margin */
    margin-bottom: 10px;
    color: var(--text-color);
    opacity: 0;
    animation: fadeIn 0s forwards;
}

/* Fade-in effect for title */
@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    max-width: 1200px;
    margin: 20px auto; /* Reduced spacing at the top */
    padding: 10px 20px; /* Added some padding */
    background: var(--bg-color);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    opacity: 0;
    animation: fadeInContainer 1s 1.5s forwards; /* Delay to let the title animate first */
}

@keyframes fadeInContainer {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Certificate Grid Layout */
.certificate-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

/* Certificate Item animation */
.certificate-item {
    flex: 1 1 calc(50% - 40px); /* Two items per row with gap */
    max-width: 500px; /* Optional max width */
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 10px;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 0.8s ease forwards;
}

@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Adding a delay for each certificate item */
.certificate-item:nth-child(1) {
    animation-delay: 0.3s;
}

.certificate-item:nth-child(2) {
    animation-delay: 0.5s;
}

.certificate-item:nth-child(3) {
    animation-delay: 0.7s;
}

.certificate-item:nth-child(4) {
    animation-delay: 0.9s;
}

.certificate-image {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    transition: transform 0.3s;
}

.certificate-item:hover .certificate-image {
    transform: scale(1.05);
}

.description {
    margin: 10px 0;
    font-size: 1em;
}

/* Button Hover animation */
.download-button {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 15px;
    background-color: var(--main-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.3s;
}

.download-button:hover {
    background-color: #0056b3;
    transform: scale(1.1); /* Slight scaling effect */
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .certificate-item {
        flex: 1 1 100%; /* Stack items on smaller screens */
    }
}
