/* Reset some basic styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #000000; /* Black background */

    /* Geometric Pattern: Subtle Grid */
    background-image:
            repeating-linear-gradient(
                    45deg,
                    rgba(255, 255, 255, 0.05) 0,
                    rgba(255, 255, 255, 0.05) 1px,
                    transparent 1px,
                    transparent 20px
            ),
            repeating-linear-gradient(
                    -45deg,
                    rgba(255, 255, 255, 0.05) 0,
                    rgba(255, 255, 255, 0.05) 1px,
                    transparent 1px,
                    transparent 20px
            );
    background-size: 40px 40px, 40px 40px;

    /* Animation for the Background Pattern */
    animation: backgroundAnimation 120s linear infinite;

    color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Keyframes for Animated Background */
@keyframes backgroundAnimation {
    from {
        background-position: 0 0, 0 0;
    }
    to {
        background-position: 40px 40px, -40px 40px;
    }
}

/* Keyframes for Animated Gradient (Header and Footer) */
@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Header Styling */
header {
    /* Animated Gradient Background */
    background: linear-gradient(270deg, #000428, #004e92, #00c6ff, #004e92, #000428);
    background-size: 800% 800%;
    animation: gradientAnimation 30s ease infinite;

    padding: 20px 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

header::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 20px;
    background: inherit;
    filter: blur(8px);
    z-index: -1;
}

header h1 {
    margin-bottom: 15px; /* Reduced margin to accommodate paragraph */
    text-align: center;
    color: #ffffff;
    font-size: 2.5em; /* Increased font size for prominence */
    letter-spacing: 2px;
}

header p {
    max-width: 800px; /* Limits the width for better readability */
    margin: 0 auto 30px auto; /* Centers the paragraph and adds bottom margin */
    text-align: center; /* Centers the text */
    color: #dddddd; /* Slightly lighter color for contrast */
    font-size: 1.1em; /* Comfortable font size */
    line-height: 1.6; /* Improved line spacing */
    padding: 0 20px; /* Adds horizontal padding on smaller screens */
    opacity: 0.9; /* Slight transparency for subtlety */
    transition: opacity 0.3s ease; /* Smooth transition on hover */
}

header p:hover {
    opacity: 1; /* Enhances readability on hover */
}

.filters {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.filters label {
    margin-right: 10px;
    font-weight: bold;
    color: #ffffff;
}

.category-filters {
    display: flex;
    align-items: center;
}

#categories {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: 10px;
}

.category {
    background-color: #555;
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    color: #fff;
}

.category.active {
    background-color: #007BFF;
    color: #fff;
}

main {
    flex: 1;
    padding: 40px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.project-card {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(255, 255, 255, 0.1); /* Grey-whitish shadow */
    background-color: #3a3a3a;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    aspect-ratio: 1 / 1; /* Make the tile square */
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 20px rgba(255, 255, 255, 0.2);
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}

.project-card .project-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    padding: 10px;
    text-align: center;
    font-size: 1.1em;
}

.project-card .project-info {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-card:hover .project-info {
    transform: translateY(0);
}

.project-info h3 {
    margin-bottom: 10px;
    font-size: 1.5em;
}

.project-info p {
    font-size: 0.9em;
    margin-bottom: 15px;
}

.project-info .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 0.8em;
}

/* Footer Styling */
footer {
    /* Animated Gradient Background */
    background: linear-gradient(270deg, #0f2027, #203a43, #2c5364, #203a43, #0f2027);
    background-size: 800% 800%;
    animation: gradientAnimation 30s ease infinite;

    text-align: center;
    padding: 20px 0;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.3);
    color: #ffffff;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

#build-info {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
}

@media (max-width: 600px) {
    .filters {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    header {
        padding: 20px;
    }

    main {
        padding: 20px;
    }

    header p {
        font-size: 1em; /* Adjust font size for smaller screens */
        margin-bottom: 20px; /* Reduce bottom margin */
    }
}
