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

html, body {
    height: 100%;
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background-color: #000;
    display: flex;
    flex-direction: column;
    font-family: 'Fira Code', monospace;
    cursor: url('../images/cursor1.png'), auto;
}

/* Preloader Styles */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #9b59b6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header Styling */
header {
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 0.5rem 0; /* Reduced padding for smaller navbar */
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    
}

.navbar {
    display: flex;
    justify-content: center;  /* Centers the navbar */
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px; /* Reduced padding for a more compact design */
    position: relative;
}

.nav-links {
    list-style: none;
    display: flex;
    justify-content: space-evenly;  /* Spreads out the nav items evenly */
    width: 100%;  /* Ensures the space is distributed across the whole navbar */
    padding: 0;
    margin: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-links li {
    margin-left: 15px; /* Reduced spacing between nav items */
}

.nav-links a {
    text-decoration: none;
    color: #fff;
    font-weight: 500;
    font-size: 1rem; /* Reduced font size */
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #9b59b6;
}

/* Dropdown Menu */
.portfolio {
    position: relative;  /* To position the dropdown relative to the portfolio item */
}

.portfolio .dropdown {
    display: none;  /* Hide by default */
    position: absolute;  /* Position it below the Portfolio item */
    top: 100%;  /* Position directly below */
    background-color: rgba(0, 0, 0, 0.9);  /* Matches the navbar background */
    padding: 0;
    margin: 0;
    list-style: none;
    width: 250px;  /* Adjust the width as needed */
    border-radius: 5px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);  /* Adds a subtle shadow */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    margin-left: -60px;
}

.portfolio:hover .dropdown {
    display: block;
    opacity: 1;
    visibility: visible;  /* Show the dropdown when hovering over Portfolio */
}

.dropdown li {
    padding: 10px;

}

.dropdown li:last-child {
    border-bottom: none;  /* Remove the last border */
}

.dropdown a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    display: block;
    padding: 0px 0px;
    margin-left: 10px;
    transition: background-color 0.3s ease, padding 0.3s ease;
}

.dropdown a:hover {
    color: #fff;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle span {
    background: #fff;
    height: 3px;
    width: 25px;
    margin: 4px 0;
    transition: 0.3s;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg);
    position: relative;
    top: 8px;
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
    position: relative;
    top: -8px;
}

/* Hero Section */
.hero {
    background: linear-gradient(to bottom, rgba(130, 100, 162, 0.573), rgba(0, 0, 0, 0.9));
    background-size: cover;
    color: #fff;
    text-align: center;
    padding: 120px 20px;
    margin-top: 40px;
    flex: 1;
    transition: background-position 0.1s ease-out;
    background-position: center center;
    animation: moveBackground 20s infinite linear;
}

@keyframes moveBackground {
    0% {
        background-position: center center;
    }
    100% {
        background-position: center top;
    }
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: fadeInUp 1s ease-out;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 25px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button Styling */
.btn {
    width: 80px;
    height: 40px;
    font-family: 'Fira Code', monospace;
    background-color: rgba(255, 255, 255, 0);
    color: white;
    border: 3px solid rgba(255, 255, 255, 0);
    border-radius: 50px;
    font-size: 15px;
    pointer-events: auto; /* Allow interaction with the button */
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
}

.btn:hover {
    background: rgba(130, 100, 162, 0.142);
    color: white;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
    transform: translateY(-5px);
}

/* Button 1 Styling */
.btn1 {
    background: #9c59b600; /* Transparent background */
    color: #fff;
    text-decoration: none;
    padding: 10px 15px;
    font-size: 0.9rem;
    border-radius: 5px; /* Same radius as the button */
    border: 2px solid transparent; /* Creates a transparent border to apply the gradient */
    background-clip: padding-box; /* Ensures the background doesn't cover the border */
    border-image: linear-gradient(to right, rgba(208, 183, 236, 0.817), rgba(130, 100, 162, 0.7)) 1; /* Two-colored gradient border */
    transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
    font-family: 'Fira Code', monospace;
}

.btn1:hover {
    transform: translateY(-5px);
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}


/* Section Transitions */
.fade-in-section {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.fade-in-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Portfolio Section */
#work {
    padding: 60px 20px;
    text-align: center;
}

#work h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

/* About Section */
#about {
    padding: 60px 20px;
    text-align: center;
}

#about h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

/* Contact Section */
#contact {
    padding: 60px 20px;
    text-align: center;
}

#contact h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

/* Footer Styling */
footer {
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    color: #e0e0e0;
    padding: 10px 0;
    flex-shrink: 0;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        top: 40px;
        right: 0;
        background: rgba(0, 0, 0, 0.9);
        flex-direction: column;
        align-items: center;
        width: 100%;
        transform: translateY(-150%);
        opacity: 0;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
    }

    .nav-links li {
        margin: 15px 0;
    }

    .menu-toggle {
        display: flex;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .hero-content img {
       width: 50%;
    }
}


/* GitHub and LinkedIn Icons */
.github-icon, .linkedIn-icon {
    font-size: 25px;
    color: #fff;
    text-decoration: none;
    transition: transform 0.3s ease, color 0.3s;
}

.github-icon:hover, .linkedIn-icon:hover {
    transform: scale(1.1);
    color: #9b59b6;
}

img{
    width: 600px;
    height: 120px;
}


/* Mobile Responsiveness */
@media (max-width: 768px) {
    .portfolio-cards {
        flex-direction: column;
        gap: 15px;
    }
}


/* Portfolio Section */
#work {
    padding: 60px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Portfolio Cards Container */
.portfolio-cards {
    display: flex;
    justify-content: space-evenly; /* Distribute cards evenly */
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 30px;
    transform: translateX(-100%); /* Start off-screen */
    transition: opacity 2s ease-out, transform 1s ease-out;
}

.portfolio-cards.visible {
    opacity: 1;
    transform: translateX(0); /* Move to its original position */
}

.portfolio-cards1 {
    display: flex;
    justify-content: space-evenly; /* Distribute cards evenly */
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 30px;
    transform: translateX(200%); /* Start off-screen */
    transition: opacity 2s ease-out, transform 1s ease-out;
}

.portfolio-cards1.visible {
    opacity: 1;
    transform: translateX(0); /* Move to its original position */
}

/* Individual Card */
#card {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 15px;
    width: 70px;
    height: 70px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, filter 0.3s;
    position: relative;
    overflow: hidden; /* Ensures child elements don't overflow */
    transform: perspective(1000px) rotateY(0deg); /* 3D perspective */
}

#card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    transform: scale(1.1) rotateY(10deg); /* Tilt effect */
}

/* Card Hover: Tilt Effect */
#card:hover {
    transform: scale(1.05) rotateX(15deg) rotateY(10deg); /* Tilt effect */
}

/* Add Image and Text Fade-In */
#card img {
    width: 100%;
    height: auto;
    transition: opacity 0.5s ease-in-out;
}

#card:hover img {
    opacity: 0.7; /* Fade image on hover */
}

#card h1, #card p {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

#card:hover h1, #card:hover p {
    opacity: 1;
    transform: translateY(0);
}

/* Card Border Animation */
#card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #fff;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    pointer-events: none;
}

#card:hover:before {
    opacity: 1; /* Border appears on hover */
}

/* Pulse effect on hover */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

#card:hover {
    animation: pulse 1s ease-in-out infinite;
}

/* Hover animation for internal links or buttons */
#card a {
    text-decoration: none;
    color: #fff;
    font-size: 1.2rem;
    transition: color 0.3s, transform 0.3s;
}

#card a:hover {
    color: #9b59b6;
    transform: scale(1.1);
}



.card:hover {
    transform: rotateY(15deg) rotateX(15deg);
}

#dots-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Make sure it doesn't block other elements */
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 85%;
    margin-top: 40px;
    background: rgba(0, 0, 0, 0.1);
}

.aboutMePic {
    width: 200px; /* Set the width */
    height: 200px; /* Set the height equal to the width */
    border-radius: 50%; /* Makes it a circle */
    overflow: hidden; /* Ensures the image doesn't overflow the circle */
    display: flex;
    justify-content: center;
    align-items: center; /* Centers the image inside the circle */
}

.aboutMePic img {
    height: 100%;
    width: 100%;
    object-fit: cover; /* Ensures the image covers the area without distortion */
}

.aboutMeContainer {
    display: flex; /* Use Flexbox to align children side by side */
    align-items: center; /* Vertically centers the content */
    justify-content: flex-start; /* Aligns the items to the left */
    gap: 20px; /* Adds space between the image and text */
}

.aboutMePic {
    flex-shrink: 0; /* Prevents the image from shrinking */
}

.aboutMeText {
    max-width: 600px; /* Optionally set a max width for the text */
}

.aboutMePic img {
    height: 450px; /* Set image height */
    width: 400px; /* Set image width */
    object-fit: cover; /* Ensures the image covers its box without distortion */
}


/* Modal Styles */
#gameModal {
    display: block;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: rgba(0, 0, 0, 0.5);
    margin: 5% auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 800px;
    color: #fff;
    position: relative;
}

.close-btn {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 25px;
    padding: 0 5px;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* Game Container */
.game-container {
    display: grid;
    align-items: center;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 20px;
}

.card {
    position: relative;
    width: 150px;
    height: 150px;
    border: 2px solid #ccc;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    perspective: 1000px;
    transition: transform 0.3s ease;
}

.card .card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 15px;
    border-radius: 8px;
    transition: transform 0.5s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card .front {
    background-color: #f0f0f0;
    color:rgba(0, 0, 0, 0.5);
}

.card .back {
    background-color: rgba(0, 0, 0, 0.5);
    transform: rotateY(180deg);
}

.card.flipped .front {
    transform: rotateY(180deg);
}

.card.flipped .back {
    transform: rotateY(0);
}

.card.matched {
    background-color: rgba(0, 0, 0, 0.5);
    color: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* Game Stats */
.game-stats {
    margin-top: 20px;
    font-size: 1.2rem;
}

/* Responsive Layout */
@media (max-width: 600px) {
    .game-container {
        grid-template-columns: repeat(3, 1fr);
    }

    .card {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 400px) {
    .game-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .card {
        width: 60px;
        height: 60px;
    }
}

/* Reset Button */
#resetGameBtn {
    margin-top: 10px;
    width: 150px;
    height: 40px;
    font-family: 'Fira Code', monospace;
    background-color: rgba(255, 255, 255, 0);
    color: white;
    border: 3px solid rgba(255, 255, 255, 0);
    border-radius: 50px;
    font-size: 15px;
    pointer-events: auto; /* Allow interaction with the button */
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
}

#resetGameBtn:hover {
    transform: translateY(-5px);
    color: white;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
}