/* Certificates Section */
.certificates-section {
    padding: 6rem 5%;
    background-color: var(--bg-color);
    position: relative;
    overflow: hidden;
}

.certificates-intro {
    margin-bottom: 4rem;
    text-align: left;
    max-width: 800px;
}

.certificates-intro p {
    color: #8b949e;
    font-size: 1.1rem;
    margin-top: 1rem;
}

.certificates-timeline {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 4rem;
    padding: 2rem 0;
}

/* Timeline Line Connector */
.certificates-timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    z-index: 0;
    opacity: 0.3;
}

.cert-card {
    position: relative;
    width: 100%;
    max-width: 350px;
    /* Responsive width */
    background: #161b22;
    border-radius: 12px;
    border: 1px solid #30363d;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.cert-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(88, 166, 255, 0.2);
}

/* Connection Dot on Card */
.cert-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -10px;
    /* Left anchor */
    width: 20px;
    height: 20px;
    background-color: var(--bg-color);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    z-index: 2;
    transform: translateY(-50%);
    box-shadow: 0 0 10px var(--primary-color);
}

.cert-card:nth-child(even)::before {
    left: auto;
    right: -10px;
    /* Right anchor for alternating look if needed, or keep uniform */
}

/* Actually, let's make the dot central to the timeline flow. */
/* If creating a specific visual like the reference: */
/* Reference shows cards connected by a line that goes straight through or zig-zags. */

.cert-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 1px solid #30363d;
    transition: opacity 0.3s ease;
}

.cert-info {
    padding: 1.5rem;
}

.cert-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.cert-issuer {
    font-size: 0.9rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Responsive */
@media (max-width: 900px) {
    .certificates-timeline {
        flex-direction: column;
        gap: 2rem;
        /* Reduced gap */
        padding: 0 1rem;
    }

    .certificates-timeline::before {
        width: 2px;
        height: 100%;
        /* Full height */
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        background: linear-gradient(180deg, transparent, var(--primary-color), transparent);
    }

    .cert-card {
        margin: 0 auto;
        /* Center cards */
    }

    .cert-card::before {
        top: -10px;
        left: 50%;
        transform: translateX(-50%);
    }
}