/* --- Scoped CSS for Certificate Slider --- */

/* Root container to replace <section> */
#cert-slider-root {
    position: relative;
    padding: 0rem 1rem;
    /*background-color: #FEEED4;*/
    /* Beige background */
    font-family: 'Roboto', sans-serif;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* Scalloped Border Top */
.cert-scallop-top {
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
    background-image: radial-gradient(circle, transparent 70%, #FFF3E0 71%);
    background-size: 40px 40px;
    background-repeat: repeat-x;
    background-position: center bottom;
    z-index: 10;
}

/* Header Styling */
.cert-header-wrap {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}

.cert-title {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    color: #dc2626;
    text-transform: uppercase;
    font-size: 2.5rem;
    letter-spacing: -0.025em;
    display: inline-block;
    position: relative;
    padding-bottom: 0.5rem;
    margin: 0;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .cert-title {
        font-size: 3rem;
    }
}

/* Decorative underlines */
.cert-line-main {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: #ef4444;
    border-radius: 9999px;
    opacity: 0.8;
    transform: scaleX(0.9);
}

.cert-line-sub {
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #f87171;
    border-radius: 9999px;
    opacity: 0.4;
    transform: scaleX(0.75);
}

/* Slider Wrapper */
.cert-swiper-container {
    position: relative;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

/* CRITICAL: Force linear transition for marquee effect */
.swiper-wrapper {
    transition-timing-function: linear !important;
}

/* Slide Items */
.cert-slide-item {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    cursor: grab;
    background: #FFFFFF;
    border-radius: 12px;
    padding: 20px 35px 20px 35px;
}

.cert-slide-item:active {
    cursor: grabbing;
}

.cert-img-box {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.cert-img-box:hover {
    transform: scale(1.1);
}

.cert-img {
    object-fit: contain;
    height: 100%;
    width: 100%;
    opacity: 0.8;
    transition: opacity 0.3s;
    max-width: 100%;
}

.cert-img:hover {
    opacity: 1;
}

/* Custom GMP Circle Badge */
.cert-badge-gmp {
    border-radius: 50%;
    border: 4px solid #16a34a;
    height: 7rem;
    width: 7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    color: #16a34a;
    font-weight: bold;
    font-size: 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* View Link */
.cert-view-btn {
    position: relative;
    display: inline-block;
    cursor: pointer;
    color: #dc2626;
    font-family: 'Bayon';
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    text-decoration: none;
}

.cert-view-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #ef4444;
    transform: scaleX(1);
    transform-origin: bottom left;
    transition: transform 0.3s ease-out;
}

.cert-view-btn:hover::after {
    transform: scaleX(0);
    transform-origin: bottom right;
}

/* --- Lightbox / Modal --- */
.cert-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cert-modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cert-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: background 0.3s, color 0.3s;
    z-index: 10;
}

.cert-modal-close:hover {
    color: #ef4444;
    background: rgba(255, 255, 255, 0.2);
}

.cert-modal-content {
    position: relative;
    width: 100%;
    max-width: 50rem;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.cert-modal-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 2px solid white;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.cert-modal-overlay.is-active .cert-modal-img {
    transform: scale(1);
}

.cert-modal-caption {
    color: white;
    margin-top: 1rem;
    font-family: 'Oswald', sans-serif;
    font-size: 1.25rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
}

/* Side Fade Gradients */
.cert-fade-left,
.cert-fade-right {
    position: absolute;
    top: 0;
    right: -1px !important;
    width: 15%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.cert-fade-left {
    left: 0;
    background: linear-gradient(to right, #FEEED4, transparent);
}

.cert-fade-right {
    right: 0;
    background: linear-gradient(to left, #FEEED4, transparent);
}

/* Helpers */
.cert-d-none {
    display: none !important;
}

.cert-img-box img.cert-img {
    width: 7rem;
    height: 7rem;
    object-fit: contain;
}

/* Container holds the variable */
.cert-swiper-container {
    --fade-color: #FEF5E6; /* Default fallback */
}

.cert-fade-left,
.cert-fade-right {
    position: absolute;
    top: 0;
    width: 150px;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

/* Left Fade: From Transparent to Solid Color */
.cert-fade-left {
    left: 0;
    background: linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, var(--fade-color) 60%);
}

/* Right Fade: Mirrored */
.cert-fade-right {
    right: 0;
    background: linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, var(--fade-color) 60%);
    transform: matrix(-1, 0, 0, 1, 0, 0);
}

@media screen and (max-width: 768px) {
    .cert-img-box img.cert-img {
        width: 5rem;
        height: 5rem;
        object-fit: contain;
    }
    #cert-slider-root{
        padding: 0rem 0rem;
    }
    /* Left Fade: From Transparent to Solid Color */
    .cert-fade-left {
        left: 0;
        background: linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, var(--fade-color) 86.58%);
    }
    
    /* Right Fade: Mirrored */
    .cert-fade-right {
        right: 0;
        background: linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, var(--fade-color) 86.58%);
        transform: matrix(-1, 0, 0, 1, 0, 0);
    }
}