/* ========================================
   MODERN CERTIFICATES PAGE STYLES
   Premium Dark Theme with Glassmorphism
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(66, 165, 245, 0.15) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.certificates-container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

/* Header Section */
.certificates-container h2 {
    text-align: center;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 5s ease infinite;
    letter-spacing: -0.5px;
}

@keyframes gradientFlow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    margin-bottom: 50px;
    font-weight: 300;
}

/* Certificate Grid */
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    padding: 10px;
}

/* Certificate Card - Glassmorphism */
.certificate-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.certificate-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transition: left 0.5s ease;
    z-index: 10;
}

.certificate-card:hover::before {
    left: 100%;
}

.certificate-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(102, 126, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(102, 126, 234, 0.5);
}

/* Glowing border effect on hover */
.certificate-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb, #667eea);
    background-size: 400% 400%;
    border-radius: 26px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: borderGlow 3s ease infinite;
}

.certificate-card:hover::after {
    opacity: 1;
}

@keyframes borderGlow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Certificate Image */
.certificate-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/11;
}

.certificate-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: brightness(0.95);
}

.certificate-card:hover .certificate-image img {
    transform: scale(1.05);
    filter: brightness(1);
}

/* Overlay with Icon */
.certificate-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(102, 126, 234, 0.85),
            rgba(118, 75, 162, 0.85));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.certificate-card:hover .certificate-overlay {
    opacity: 1;
}

.view-icon {
    font-size: 3rem;
    color: white;
    transform: scale(0) rotate(-180deg);
    transition: all 0.3s ease;
    text-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.certificate-card:hover .view-icon {
    transform: scale(1) rotate(0deg);
}

.view-text {
    color: white;
    font-size: 0.9rem;
    margin-top: 10px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.certificate-card:hover .view-text {
    opacity: 1;
    transform: translateY(0);
}

/* Certificate Info */
.certificate-info {
    padding: 24px;
    background: rgba(0, 0, 0, 0.2);
}

.certificate-info h3 {
    margin: 0 0 12px 0;
    font-size: 1.15rem;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.certificate-badge {
    display: inline-block;
    padding: 8px 18px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    color: white;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* ========================================
   LIGHTBOX MODAL - Premium Dark Theme
   ======================================== */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.97);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: scaleIn 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 16px;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lightbox-close:hover {
    color: #fff;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
}

#lightbox-caption {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin-top: 20px;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Navigation Arrows */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 20px;
    user-select: none;
}

.lightbox-nav:hover {
    color: #fff;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 30px;
    padding: 12px 24px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.back-link:hover {
    color: #fff;
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateX(-5px);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media screen and (max-width: 768px) {
    .certificates-container {
        padding: 30px 15px;
    }

    .certificates-container h2 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
        margin-bottom: 35px;
    }

    .certificates-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .certificate-card:hover {
        transform: translateY(-8px);
    }

    .certificate-info {
        padding: 20px;
    }

    .certificate-info h3 {
        font-size: 1rem;
    }

    .lightbox-content {
        max-width: 95%;
        padding: 10px;
    }

    .lightbox-close {
        top: -45px;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .lightbox-nav {
        font-size: 2rem;
        padding: 10px;
    }
}

/* Floating Particles Effect (Optional Enhancement) */
@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* Scroll hint animation */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}