/* Certificates Page Styles */

/* FIXED: Smooth scrolling for all modes */
html {
    scroll-behavior: smooth !important;
}

body {
    scroll-behavior: smooth !important;
}

.certificates-hero {
    padding: 8rem 0 4rem;
    text-align: center;
}

.certificates-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #4CAF50, #2196F3);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.certificates-hero h1 span {
    background: linear-gradient(45deg,
            #4CAF50,
            #2196F3,
            #9C27B0);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-text 5s ease infinite;
}

@keyframes gradient-text {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.certificates-hero:hover h1 {
    transform: scale(1.05);
}

.certificates-hero p {
    color: var(--text-color, #ccc);
    font-size: 1.4rem;
    max-width: auto;
    margin: 0 auto;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .certificates-hero h1 {
        font-size: 2.5rem;
    }

    .certificates-hero p {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .certificates-hero h1 {
        font-size: 1.8rem;
    }

    .certificates-hero p {
        font-size: 1rem;
        padding: 0 1rem;
    }
}

@media (max-width: 360px) {
    .certificates-hero h1 {
        font-size: 1.5rem;
    }
}

.certificates-showcase {
    padding: 4rem 0;
}

/* Certificate Section Styles */
.certificate-section {
    margin-bottom: 6rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #4CAF50;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: #4CAF50;
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2.5rem !important;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.8rem !important;
    }
}

@media (max-width: 360px) {
    .section-title {
        font-size: 1.2rem !important;
    }
}

.microsoft-section .section-title {
    color: #0078D7;
}

.microsoft-section .section-title::after {
    background: #0078D7;
}

.training-section .section-title {
    color: #FF5722;
}

.training-section .section-title::after {
    background: #FF5722;
}

.view-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.view-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #ccc;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-btn.active,
.view-btn:hover {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border-color: #4CAF50;
}

.microsoft-section .view-btn.active,
.microsoft-section .view-btn:hover {
    background: rgba(0, 120, 215, 0.2);
    color: #0078D7;
    border-color: #0078D7;
}

.training-section .view-btn.active,
.training-section .view-btn:hover {
    background: rgba(255, 87, 34, 0.2);
    color: #FF5722;
    border-color: #FF5722;
}

.carousel-container {
    position: relative;
    perspective: 1500px;
    height: 500px;
    margin-top: 150px;
    margin-bottom: 150px;
    border-radius: 15px;
}

.carousel {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.certificate-item {
    position: absolute;
    width: 300px;
    height: 400px;
    left: 50%;
    top: 50%;
    margin-left: -150px;
    margin-top: -200px;
    transition: transform 0.5s ease, opacity 0.5s ease;
    transform-style: preserve-3d;
    cursor: pointer;
}

.certificate-item:hover {
    transform: translateZ(50px) scale(1.05);
}

.certificate-front,
.certificate-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.6s ease;
}

.certificate-front {
    background: linear-gradient(135deg, rgba(58, 190, 54, 0.1) 0%, rgba(10, 192, 19, 0.3) 100%) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    transform: rotateY(0deg);
    z-index: 2;
}

.certificate-front img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.certificate-front h3 {
    color: #4CAF50;
    font-size: 1.2rem;
    margin: 0;
    line-height: 1.3;
}

.certificate-back {
    background: rgba(10, 25, 47, 0.9);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    transform: rotateY(180deg);
    z-index: 1;
}

.certificate-back h3 {
    color: #4CAF50;
    margin-bottom: 1rem;
    margin-top: 0;
    font-size: 1.1rem;
    line-height: 1.3;
}

.certificate-back p {
    color: #ccc;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    margin-top: 0;
    font-size: 0.9rem;
}

.view-full-btn {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid #4CAF50;
    color: #4CAF50;
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: center;
    font-weight: 500;
    margin-top: auto;
    font-size: 0.85rem;
}

.view-full-btn:hover {
    background: #4CAF50;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 10;
    transition: all 0.3s ease;
}

.carousel-nav:hover {
    background: rgba(76, 175, 80, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
    left: 20px;
}

.carousel-nav.next {
    right: 20px;
}

/* Grid View Styles */
.grid-container {
    display: none;
    margin-top: 50px;
    margin-bottom: 50px;
}

.grid-container:not(.hidden) {
    display: block;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.grid-item {
    height: 380px;
    perspective: 1000px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.grid-item .certificate-front,
.grid-item .certificate-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.6s ease;
}

.grid-item .certificate-front {
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    transform: rotateY(0deg);
    z-index: 2;
}

.grid-item .certificate-front img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.grid-item .certificate-back {
    background: rgba(10, 25, 47, 0.9);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    transform: rotateY(180deg);
    z-index: 1;
}

/* Grid item flip - using transform on the item itself */
.grid-item.flipped {
    transform: rotateY(180deg);
}

/* Desktop hover effect - only on non-touch devices */
@media (hover: hover) and (pointer: fine) {
    .grid-item:hover {
        transform: rotateY(180deg);
    }
}

/* Carousel flip effect */
.certificate-item.flipped .certificate-front {
    transform: rotateY(180deg);
}

.certificate-item.flipped .certificate-back {
    transform: rotateY(0deg);
}

/* Section-specific styles */


/* Microsoft Section Styles */
.microsoft-section .certificate-front {
    background: linear-gradient(135deg, rgba(55, 116, 167, 0.1) 0%, rgba(16, 107, 182, 0.3) 100%) !important;
}

.microsoft-section .certificate-front h3 {
    color: #0078D7 !important;
}

.microsoft-section .certificate-back {
    background: rgba(0, 120, 215, 0.) !important;
}

.microsoft-section .certificate-back h3 {
    color: #0078D7 !important;
}

.microsoft-section .view-full-btn {
    background: rgba(0, 120, 215, 0.2);
    border: 1px solid #0078D7;
    color: #0078D7;
}

.microsoft-section .view-full-btn:hover {
    background: #0078D7;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 120, 215, 0.3);
}

.microsoft-section .carousel-nav:hover {
    background: rgba(0, 120, 215, 0.3);
}

/* Training Section Styles */
.training-section .certificate-front {
    background: linear-gradient(135deg, rgba(243, 85, 37, 0.1) 0%, rgba(219, 73, 29, 0.3) 100%) !important;
}

.training-section .certificate-front h3 {
    color: #FF5722 !important;
}

.training-section .certificate-back {
    background: rgba(255, 87, 34, 0.);
}

.training-section .certificate-back h3 {
    color: #FF5722 !important;
}

.training-section .view-full-btn {
    background: rgba(255, 87, 34, 0.2);
    border: 1px solid #FF5722;
    color: #FF5722;
}

.training-section .view-full-btn:hover {
    background: #FF5722;
    color: white;
    box-shadow: 0 5px 15px rgba(255, 87, 34, 0.3);
}

.training-section .carousel-nav:hover {
    background: rgba(255, 87, 34, 0.3);
}

.hidden {
    display: none !important;
}

/* Full View Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    background-color: rgba(10, 25, 47, 0.95);
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 900px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #aaa;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #4CAF50;
}

.modal-body {
    display: flex;
    flex-direction: column;
    height: 80vh;
    overflow: hidden;
    margin-bottom: 1rem;
}

.modal-body img {
    width: 100%;
    height: 68%;
    object-fit: contain;
    background: #000;
}

.modal-info {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-info h3 {
    color: #4CAF50;
    font-size: 1.5rem;
}

.modal-info p {
    color: #ccc;
    margin-top: 0.1rem;
    margin-bottom: 0.8rem;
    line-height: 1.5;
    justify-content: center !important;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid #4CAF50;
    color: #4CAF50;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.3s ease;
    align-self: flex-start;
    justify-content: center !important;
    align-items: center !important;
}

.download-btn:hover {
    background: #4CAF50;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

/* Light mode adjustments */

.light-mode body {
    scroll-behavior: smooth !important;
}

.light-mode html {
    scroll-behavior: smooth !important;
}

.light-mode * {
    scroll-behavior: smooth !important;
}

.light-mode .certificate-front {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .carousel-nav {
    background: rgba(0, 0, 0, 0.1);
    color: #2d3436;
}

.light-mode .carousel-nav:hover {
    background: rgba(33, 150, 243, 0.2);
}


.light-mode .microsoft-section .view-full-btn {
    background: rgba(0, 120, 215, 0.1);
    border-color: #0078D7;
    color: #0078D7;
}

.light-mode .microsoft-section .view-full-btn:hover {
    background: #0078D7;
    color: white;
}

/* Training section light mode */
.light-mode .training-section .certificate-front h3 {
    color: #FF5722 !important;
}

.light-mode .training-section .certificate-back h3 {
    color: #FF5722 !important;
}

.light-mode .training-section .view-full-btn {
    background: rgba(255, 87, 34, 0.1);
    border-color: #FF5722;
    color: #FF5722;
}

.light-mode .training-section .view-full-btn:hover {
    background: #FF5722;
    color: white;
}

.light-mode .modal-content {
    background-color: rgba(248, 249, 250, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .modal-info h3 {
    color: #2196F3;
}

.light-mode .modal-info p {
    color: #555;
}

.light-mode .download-btn {
    background: rgba(33, 150, 243, 0.1);
    border-color: #2196F3;
    color: #2196F3;
}

.light-mode .download-btn:hover {
    background: #2196F3;
    color: white;
}

.light-mode .close-modal {
    color: #666;
}

.light-mode .close-modal:hover {
    color: #2196F3;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .carousel-container {
        height: 500px !important;
        perspective: auto;
        margin-top: 50px;
        margin-bottom: 50px;
        max-width: 100%;
        overflow: hidden;
        transform-style: preserve-3d !important;
        border-radius: 15px !important;
    }

    .certificate-item {
        width: 250px !important;
        height: 500px !important;
        margin-left: -110px !important;
        margin-top: -250px !important;
        transform-style: preserve-3d;
    }

    .certificate-front img {
        height: 150px !important;
    }

    .certificate-front,
    .certificate-back {
        padding: 1rem !important;
    }

    .certificate-front h3 {
        font-size: 1rem !important;
    }

    .certificate-back h3 {
        font-size: 0.9rem !important;
        margin-top: 100px;
    }

    .certificate-back p {
        font-size: 0.75rem !important;
        margin-bottom: 0.3rem;
    }

    .view-full-btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.75rem !important;
        margin-bottom: 100px;
    }

    .carousel-nav {
        width: 35px !important;
        height: 35px !important;
        font-size: 0.9rem !important;
    }

    .carousel-nav.prev {
        left: 5px !important;
    }

    .carousel-nav.next {
        right: 5px !important;
    }

    .section-title {
        font-size: 2rem;
    }

    .view-controls {
        flex-direction: column;
        align-items: center;
    }

    .view-btn {
        width: 200px;
        justify-content: center;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .grid-item {
        height: 320px;
    }

    .grid-item .certificate-front img {
        height: 140px;
    }
}

@media (max-width: 480px) {
    .carousel-container {
        height: 500px !important;
        perspective: auto;
        margin-top: 10px !important;
        margin-bottom: 10px !important;
        max-width: 100%;
        overflow: hidden;
        border-radius: 15px !important;
    }

    .certificate-item {
        width: 180px !important;
        height: 250px !important;
        margin-left: -90px !important;
        margin-top: -125px !important;
        transform-style: preserve-3d;
    }

    .certificate-front img {
        height: 100px !important;
    }

    .certificate-front,
    .certificate-back {
        padding: 1rem !important;
    }

    .certificate-front h3 {
        font-size: 0.9rem !important;
    }

    .certificate-back h3 {
        font-size: 0.9rem !important;
    }

    .certificate-back p {
        font-size: 0.75rem !important;
        margin-bottom: 0.8rem;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .grid-item {
        height: 260px;
    }

    .grid-item .certificate-front img {
        height: 110px;
    }



    .view-controls {
        flex-direction: row;
        align-items: center;
    }

    .view-btn {
        width: 100px;
        justify-content: center;
    }
}

@media (max-width: 360px) {
    .carousel-container {
        height: 300px !important;
        border-radius: 15px !important;
    }

    .certificate-item {
        width: 160px !important;
        height: 220px !important;
        margin-left: -80px !important;
        margin-top: -110px !important;
    }

    .certificate-front img {
        height: 90px !important;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .grid-item {
        height: 220px;
    }

    .grid-item .certificate-front img {
        height: 90px;
    }

    .view-controls {
        flex-direction: row;
        align-items: center;
    }

    .view-btn {
        width: 100px;
        justify-content: center;
    }
}

/* Reduce hover effects on touch devices */
@media (hover: none) {
    .certificate-item:hover {
        transform: none;
    }

    .certificate-item:active {
        transform: translateZ(20px) scale(1.02);
    }
}
