@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');

:root {
    --background-color: #121212;
    --text-color: #ffffff;
    --primary-color: #424548;
    --secondary-color: #bb86fc;
    --card-background: #1e1e1e;
    --card-shadow: rgba(0, 0, 0, 0.5);
    --link-hover-color: #bb86fc;
}

html, body {
    height: 100%;
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
    justify-content: space-between; /* This pushes the cards to the sides */
    padding: 2rem 5%; /* Adds padding for spacing on the left and right */
}

/* Header and Navigation */
header {
    padding: 1rem;
    background: var(--primary-color);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--secondary-color);
}

.theme-toggle {
    background: none;
    border: 2px solid var(--text-color);
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: background 0.3s, color 0.3s;
}

.theme-toggle:hover {
    background: var(--text-color);
    color: var(--background-color);
}

/* Card Layout */
.container {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

/* Card styling */
.card {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px var(--card-shadow);
    flex: 1;
    max-width:400px; /* Limit width of cards */
}

/* Specific styles for the left and right cards */
.card-left {
    align-self: flex-start;
}

.card-right {
    align-self: flex-end;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    margin-top: 1rem;
    background-color: var(--secondary-color);
    color: var(--text-color);
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.3s;
}

.btn:hover {
    background-color: var(--text-color);
    color: var(--background-color);
    transform: scale(1.05);
}

/* Social links styling */
.social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.social-links img {
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease-in-out, filter 0.3s ease-in-out;
}

.social-links img:hover {
    transform: scale(1.1);
    filter: brightness(1.5);
}

.project-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem; /* Space between project cards */
}

.project-card {
    background-color: var(--card-background);
    border-radius: 10px;
    box-shadow: 0 4px 8px var(--card-shadow);
    overflow: hidden; /* Ensures the image and text stay inside the card */
    flex: 0 0 calc(33% - 2rem); /* Three cards per row */
    cursor: pointer;
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
}

/* Image styling */
.project-image {
    width: 100%;
    height: 200px; /* Adjust the height of the image */
    object-fit: cover; /* Ensures the image covers the area without distortion */
}

/* Text content styling */
.project-content {
    padding: 1.5rem;
    background-color: var(--card-background);
    text-align: center;
}

.project-content h3 {
    margin-bottom: 0.5rem;
}

.project-content p {
    color: var(--text-color);
    font-size: 1rem;
}

.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000; /* Sit on top */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Faded background */
    justify-content: center; /* Horizontally center */
    align-items: center; /* Vertically center */
    overflow: auto; /* Scroll if modal is larger than the viewport */
}

.modal-content {
    background-color: var(--primary-color);
    padding: 2rem;
    border: 1px solid var(--text-color);
    border-radius: 10px;
    width: 100%; /* Full width */
    max-width: 600px; /* Maximum width */
    box-sizing: border-box; /* Ensure padding is included in width */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.close {
    color: var(--text-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: var(--secondary-color);
    text-decoration: none;
    cursor: pointer;
}

#modal-image {
    max-width: 100%; /* Responsive image */
    height: auto; /* Maintain aspect ratio */
    object-fit: contain; /* Fit the image inside the modal */
    margin-bottom: 1rem; /* Space between image and other elements */
}

#modal-title, #modal-description {
    text-align: center;
    width: 100%; /* Ensure content takes full width */
}

#modal-github-link {
    align-self: center; /* Center the button */
    padding: 0.5rem 1rem;
    background-color: var(--secondary-color);
    color: var(--button-text-color);
    text-decoration: none;
    border-radius: 5px;
}



#modal-github-link:hover {
    background-color: var(--text-color);
    color: var(--background-color);
    transform: scale(1.05);
}

/* Centered card styling */
.about-card {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px var(--card-shadow);
    max-width: 800px;
    margin: 2rem auto; /* Centers the card */
    text-align: center;
    color: var(--text-color);
    line-height: 1.6;
}

.contact-card {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px var(--card-shadow);
    width: 1000px;
    margin: 0 auto;
    text-align: center;
}

form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 500px;
    margin: 0 auto;
}

input[type="text"],
input[type="email"],
textarea {
    width: 500px; /* Consistent width for all inputs */
    padding: 0.75rem;
    border-radius: 5px;
    border: 1px solid var(--primary-color);
    background-color: var(--background-color);
    color: var(--text-color);
}

input[type="text"],
input[type="email"] {
    height: 40px; /* Larger height for text and email inputs */
}

textarea {
    height: 150px; /* Adjust height for the message textarea */
    padding-top: 0.5rem; /* Ensures text starts at the top */
}

textarea::placeholder {
    text-align: left; /* Ensure the placeholder starts on the left */
}

button[type="submit"] {
    width: auto;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 5px;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
}
/* Footer */
footer {
    background: var(--primary-color);
    padding: 1rem;
    text-align: center;
    margin-top: auto;
}

/* Responsive design */
@media (max-width: 768px) {
    main {
        flex-direction: column;
        align-items: center;
    }

    .card-left, .card-right {
        flex: 1;
        width: 100%;
    }

    .about-card {
        padding: 1.5rem;
        max-width: 90%;
    }

    .contact-card {
        padding: 1.5rem;
        max-width: 90%;
    }
}