/* Certs Section */

.certs-container {
    max-width: 1200px;
    padding: 80px 20px;
    margin: 0 auto;
}

/* Header */
.certs-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 60px;
}

.certs-header img {
    width: 50px;
    height: 50px;
}

.certs-header h1 {
    font-size: 2.5em;
    font-weight: 400;
    color: #333;
    margin: 0;
    text-align: left;
}

/* Certs Grid */
.certs-grid-top {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    max-width: 925px;
    margin: 0 auto;
}

.certs-grid-bottom {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    max-width: 925px;
    margin: 0 auto;
}

/* Card Base Styling */
.cert-card {
    border: 3px solid #ffffff;
    border-radius: 25px;
    padding: 40px 30px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

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

/* PSG Card - Top Left (Purple Background) */
.cert-card.psg {
    background: linear-gradient(135deg, #2d1b69, #1e1348);
    color: white;
    grid-column: 1 / 2.5;
    grid-row: 1;
    background-clip: padding-box;
}

.psg-title {
    font-size: 1.8em;
    font-weight: 400;
    margin-bottom: 30px;
}

.psg-badge img {
    min-width: 350px;
    height: auto;
    object-fit: cover;
}

/* Tech SME Award - Top Right (Light Background with Outline) */
.cert-card.tech-sme {
    background: linear-gradient(270deg, #eef8ff 0%, #f5ebff 100%);
    grid-column: 2.5 / 4;
    grid-row: 1;
}

.tech-sme-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
    height: 100%;
}

.tech-sme-title {
    font-size: 1.5em;
    color: #333;
    font-weight: 400;
    text-align: left;
}

.sme500-logo {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sme500-logo img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* Changed from 'cover' to 'contain' */
    border-radius: 10px;
}

/* App Defense Alliance - Bottom Left (Light Background with Outline) */
.cert-card.ada {
    background: linear-gradient(135deg, #f9f8ff 0%, #f2efff 20%, #f7f5ff 60%, #faf9ff 100%);
    grid-column: 1 / 2;
    grid-row: 2;
}

.ada-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ada-content h3 {
    font-size: 1.4em;
    margin-bottom: 0px;
    color: #333;
    font-weight: 400;
    line-height: 1;
    margin-bottom: 15px;
}

.ada-content span {
    font-size: 15px;
    font-weight: 500;
    color: #525050;
}

.ada-content h4 {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 25px;
    font-weight: 400;
}

.ada-content img {
    width: 120px;
    object-fit: contain;
    max-height: 240px;
}

/* Cyber Security - Bottom Right (Purple Background) */
.cert-card.cyber {
    background: linear-gradient(135deg, #2d1b69, #1e1348);
    color: white;
    grid-column: 2 / 4;
    grid-row: 2;
    background-clip: padding-box;
}

.cyber-title {
    font-size: 1.5em;
    margin-bottom: 25px;
    font-weight: 400;
}

.cyber-badge {
    background: white;
    border-radius: 5px;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70%;
}

.cyber-badge-ada {
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.cyber-badge img {
    width: 100%;
    height: auto;
}

/* General image optimization */
.cert-card img {
    width: 80%;
    height: auto;
    display: block;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .certs {
        padding: 60px 15px;
    }

    .certs-container {
        max-width: 70%;
    }

    .certs-header h1 {
        font-size: 1.5em;
        text-align: left;
    }

    .certs-header {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        margin-bottom: 40px;
    }

    .certs-grid-top,
    .certs-grid-bottom {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .certs-grid-top {
        margin-bottom: 20px;
    }

    .cert-card {
        grid-column: 1 !important;
        grid-row: auto !important;
        padding: 30px 20px;
        min-height: 180px;
    }

    .psg-title {
        font-size: 1.5em;
        margin-bottom: 20px;
    }

    .tech-sme-content {
        font-size: 1em;
    }

    .ada-content h3 {
        font-size: 1.2em;
    }

    .cyber-title {
        font-size: 1.2em;
        margin-bottom: 20px;
    }

    /* Mobile image sizing */
    .psg-badge img {
        width: 100%;
        min-width: unset; /* Explicitly override the min-width */
    }

    .sme500-logo img {
        width: 100%;
    }

    .ada-content img {
        width: 80%;
    }

    .cyber-badge img {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .certs-container {
        max-width: 90%;
    }

    .certs-header h1 {
        font-size: 1.2em;
    }

    .cert-card {
        padding: 20px 15px;
        min-height: 150px;
    }

    .psg-title,
    .ada-content h3,
    .cyber-title {
        font-size: 1.2em;
    }

    .cyber-badge {
        width: 90%;
    }

    .cyber-badge img {
        width: 120%;
    }
}
