/* General styles */
body {
    font-family: 'Fraunces', serif;
    margin: 0;
    padding: 0;
    text-align: center;
    background-color: #121212; /* Dark background */
    color: #ffffff; /* Light text color */
}

h2 {
    margin-bottom: 10px;
    margin-top: 80px;
}

p {
    margin-top: 0px;
}

section p {
    max-width: 60%; /* Limit width to 60% */
    margin-left: auto; /* Center align */
    margin-right: auto; /* Center align */
}

header, footer {
    background-color: #1f1f1f; /* Dark color for header and footer */
}

header h1 {
    margin: 0;
}

header {
    background-color: #1f1f1f; /* Dark color for header */
    color: white;
    padding: 20px 20px; /* Adjust padding for increased header height */
    position: -webkit-sticky; /* For Safari compatibility */
    position: sticky;
    top: 0;
    z-index: 1000; /* Ensure header is above other elements */
}

/* Navbar styles */
nav ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    display: inline-flex;
    gap: 15px;
}

nav ul li a {
    color: #ffffff; /* White text color for navigation links */
    text-decoration: none;
}

nav ul li a:hover {
    text-decoration: underline;
}

nav ul li.dropdown {
    position: relative;
}

nav ul li .dropdown-content {
    display: none;
    position: absolute;
    background-color: #1f1f1f; /* Dark background for dropdown */
    min-width: 160px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

nav ul li .dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

nav ul li .dropdown-content a:hover {
    background-color: #575757;
}

nav ul li:hover .dropdown-content {
    display: block;
}

main {
    padding: 20px;
}

section {
    margin: 20px 0;
    scroll-margin-top: 110px; /* Offset top scroll to account for sticky header */
}

/* Flex container for Gallery */
.gallery-grid {
    display: flex;
    flex-wrap: wrap; /* Wrap content to new rows */
    justify-content: center; /* Center last row */
    gap: 15px; /* Space between content */
    padding: 0 10px; /* Add some padding to container */
}

.gallery-grid .gallery-item {
    position: relative;
    flex: 1 1 calc(33.33% - 30px); /* 3 items per row */
    max-width: calc(33.33% - 30px); /* Limit max width */
    aspect-ratio: 4 / 3; /* 4:3 ratio for Gallery */
    overflow: hidden; /* Hide content that exceeds boundaries */
    border-radius: 20px; /* Add border radius */
    border: 1px solid #ccc; /* Add border if needed */
}

.gallery-grid .gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crop image to fit 4:3 ratio */
    cursor: pointer; /* Add cursor pointer on hover */
}

/* Flex container for Projects */
.image-grid {
    display: flex;
    flex-wrap: wrap; /* Wrap content to new rows */
    justify-content: center; /* Center last row */
    gap: 15px; /* Space between content */
    padding: 0 10px; /* Add some padding to container */
}

.image-grid .image-container {
    position: relative;
    flex: 1 1 calc(33.33% - 30px); /* 3 items per row */
    max-width: calc(33.33% - 30px); /* Limit max width */
    aspect-ratio: 1; /* Ensure 1:1 ratio for Projects */
    overflow: hidden; /* Hide content that exceeds boundaries */
    box-sizing: border-box; /* Ensure padding doesn't affect size */
    margin-bottom: 30px; /* Increase margin between rows */
    border-radius: 20px; /* Add border radius */
    border: 1px solid #ccc; /* Add border if needed */
}

.image-grid .image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crop image to fit 1:1 ratio */
    cursor: pointer; /* Add cursor pointer on hover */
}

.image-title {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 5px;
    border-radius: 5px;
	border-top-left-radius: 0px;
	border-top-right-radius: 0px;
    opacity: 0;
    transition: opacity 0.3s;
}

.image-container:hover .image-title {
    opacity: 1;
}

/* Flex container for Videos */
.video-grid {
    display: flex;
    flex-wrap: wrap; /* Wrap content to new rows */
    justify-content: center; /* Center last row */
    gap: 15px; /* Space between content */
    padding: 0 10px; /* Add some padding to container */
}

.video-grid video {
    flex: 1 1 calc(33.33% - 30px); /* 3 items per row */
    max-width: calc(33.33% - 30px); /* Limit max width */
    aspect-ratio: 4 / 3; /* 4:3 ratio for Videos */
    object-fit: cover; /* Crop video to fit ratio */
    box-sizing: border-box; /* Ensure padding doesn't affect size */
    border-radius: 20px; /* Add border radius */
    border: 1px solid #ccc;
    cursor: pointer; /* Add cursor pointer on hover */
}

/* Skills section */
#skills .icon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center; /* Center all content */
}

#skills .icon-grid img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

/* Responsiveness for small screens */
@media (max-width: 768px) {
    .image-grid .image-container, .video-grid video, .gallery-grid .gallery-item {
        flex: 0 0 100%; /* One item per row */
        max-width: 100%;
    }
    #skills .icon-grid {
        gap: 8px; /* Slightly tighter for small screens */
    }
}

footer {
    text-align: center;
    padding: 10px;
    background-color: #333;
    color: white;
}

#modal {
    display: none;
}

/* Modal styles */
.modal {
    display: none; /* Hide the modal by default */
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    background-color: #1f1f1f; /* Dark background for modal */
    padding: 20px;
    border-radius: 20px; /* Add border radius */
    width: 70%; /* Change max-width to width */
    max-width: none; /* Remove max-width limit */
    max-height: 90%;
    box-sizing: border-box;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow: hidden;
}

.modal-text {
    flex: 1;
    margin-left: 5px;
    text-align: left;
    width: 100%;
    max-width: none; /* Remove max-width limit */
    box-sizing: border-box;
    overflow-y: auto; /* Allow scrolling */
    color: #ffffff; /* Ensure text color is visible */
}

.modal-text p {
    text-align: justify; /* Add this line */
}

.modal-content, #modal-video {
    margin: 10px;
    max-width: 90%; /* Increase to 90% of the available width */
    max-height: 90vh; /* Increase to 90% of the viewport height */
    object-fit: contain; /* Maintain aspect ratio */
}

.modal-media {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-text h2 {
    margin-bottom: 10px;
}

.modal-text p {
    margin-bottom: 0;
}

/* The Close Button */
.close {
    position: absolute;
    top: 15px; /* Adjust as needed */
    right: 35px; /* Adjust as needed */
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    z-index: 2; /* Ensure it is above other elements */
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Navigation buttons */
.modal-nav {
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem; /* Reduce font size */
    padding: 5px 15px; /* Reduce padding */
    cursor: pointer;
    transition: background-color 0.3s;
    z-index: 2; /* Ensure it is above other elements */
}

.modal-nav:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

#prev {
    position: fixed; /* Change to fixed position */
    left: 20px; /* Move further outside the modal wrapper */
    top: 50%;
    transform: translateY(-50%);
}

#next {
    position: fixed; /* Change to fixed position */
    right: 20px; /* Move further outside the modal wrapper */
    top: 50%;
    transform: translateY(-50%);
}