/* --- General Page & Header Styling --- */
.certificate-header {
    text-align: center;
    padding: 80px 20px 60px;
    background: linear-gradient(180deg, var(--bg-color) 80%, transparent);
}

.main-title {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.main-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--secondary-color);
    margin: 20px auto 0;
    border-radius: 2px;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- Staggered Animation for Cards --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cert-card {
    opacity: 0; /* Initially hidden */
    animation: fadeInUp 0.6s ease-out forwards;
}

/* --- Certificate Grid & Card Styling --- */
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 35px;
    padding: 20px 0;
}

.cert-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    height: 350px;
    display: flex;
    flex-direction: column;
}

.cert-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-strong);
}

.cert-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 40px 20px 20px;
    text-align: left;
    transition: opacity 0.4s ease;
}

.card-info h3 {
    font-size: 1.5rem;
    color: #fff;
    margin: 0;
    font-weight: 600;
}

.card-info p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 5px 0 0;
}

/* --- Card Hover Overlay --- */
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(21, 52, 98, 0.8); /* Using primary color with transparency */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none; /* Allows clicks to go through to the card */
}

.cert-card:hover .card-overlay {
    opacity: 1;
}

.cert-card:hover .card-info {
    opacity: 0; /* Hide info text on hover to show overlay */
}

.overlay-content {
    text-align: center;
    color: #fff;
    transform: scale(0.9);
    transition: transform 0.4s ease;
}

.cert-card:hover .overlay-content {
    transform: scale(1);
}

.overlay-content i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.overlay-content p {
    font-size: 1.1rem;
    font-weight: 500;
}


/* --- New "Why It Matters" Section --- */
.info-section {
    text-align: center;
    padding: 80px 20px;
    background-color: var(--bg-light);
    margin-top: 60px;
}

.section-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 50px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.info-box {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.info-box i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.info-box h3 {
    font-size: 1.4rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.info-box p {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* --- Enhanced Fullscreen Modal Styles --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.cert-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 95vh;
    animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

#modal-cert-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 5px;
}

.details-caption {
    text-align: center;
    color: #eee;
    margin-top: 15px;
    font-size: 1.1rem;
    padding: 10px;
    line-height: 1.5;
}

/* Close & Navigation Buttons */
.modal-close-btn, .modal-nav-btn {
    position: absolute;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s, transform 0.3s;
    z-index: 10001;
}

.modal-close-btn:hover, .modal-nav-btn:hover {
    background-color: var(--primary-color);
    transform: scale(1.1);
}

.modal-close-btn {
    top: 20px;
    right: 20px;
}

.modal-nav-btn {
    top: 50%;
    transform: translateY(-50%);
}

.modal-nav-btn.prev {
    left: 20px;
}

.modal-nav-btn.next {
    right: 20px;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .main-title { font-size: 2.2rem; }
    .subtitle { font-size: 1rem; }
    .modal-close-btn { top: 10px; right: 10px; width: 40px; height: 40px; }
    .modal-nav-btn { width: 40px; height: 40px; }
    .modal-nav-btn.prev { left: 5px; }
    .modal-nav-btn.next { right: 5px; }
    #modal-cert-image { max-height: 75vh; }
}