/* Base styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #eae7dc;
    color: #333;
    position: relative;
}
header {
    background-color: #eae7dc;
    color: #e85a4f;
    padding: 20px 0;
    text-align: center;
    position: relative; /* For button positioning */
}
header h1 {
    margin: 0;
    font-size: 2.5em;
}
#theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background-color: #d8c3a498;
    color: #e85a4f;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    backdrop-filter: blur(2px);
}
#theme-toggle:hover {
    background-color: #e8594fa1;
    color: #eae7dc;
}
nav {
    display: flex;
    justify-content: center;
    background-color: #d8c3a4;
    border-radius: 10px;
    max-width: 1200px;
    margin: 0 auto 20px; 
    padding: 0 10px;       
    /* width: 100%; */
}

nav {}
nav a {
    color: #e85a4f;
    text-decoration: none;
    padding: 15px 20px;
    display: inline-block;
}
nav a:hover {
    background-color: #eae7dc;
    color: #e85a4f;
}
.container {
    padding: 5px;
    max-width: 1200px;
    margin: 0 auto;
}
section {
    margin-bottom: 40px;
}
section h2 {
    color: #e85a4f;
    border-bottom: 2px solid #e85a4f;
    padding-bottom: 10px;
}
.portfolio-item {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.portfolio-item div {
    background-color: #d8c3a4;
    padding: 15px;
    border: 1px solid #e88073;
    flex: 1 1 calc(33.333% - 40px);
    box-sizing: border-box;
    border-radius: 10px;
    transition: transform 0.1s ease /* Smooth transition for scaling */
}
.portfolio-item div:hover {
    transform: scale(1.05); /* Slightly increase size on hover */
}
.portfolio-item img, .portfolio-item video {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    cursor: pointer; /* Make images clickable */
}
.description {
    display: none; /* Hide descriptions by default */
    margin-top: 10px; /* Add some space above the description */
}
.toggle-description {
    display: block;
    margin: 10px 0;
    background-color: #e85a4f;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
}
.toggle-description:hover {
    background-color: #d84a3f;
}
.copyright {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background-color: rgba(216, 195, 165, 0.151); /* Slightly transparent background */
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    color: #e85a4f;
    backdrop-filter: blur(2px);
}

/* Modal styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.356); /* Black w/ opacity */
    backdrop-filter: blur(3px); /* Blur background */
    justify-content: center;
    align-items: center;
}
.modal-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 80%;
    border-radius: 10px;
}
.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}
.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Dark Theme */
body.dark-theme header,
body.dark-theme {
    background-color: #292929;
    color: #eae7dc;
}
body.dark-theme nav,
body.dark-theme .portfolio-item div,
body.dark-theme footer {
    background-color: #3d3d3d;
    color: #eae7dc;
}
body.dark-theme nav a {
    color: #eae7dc;
}
body.dark-theme nav a:hover {
    background-color: #555;
    color: #e85a4f;
}
body.dark-theme #theme-toggle {
    background-color: #555;
    color: #eae7dc;
    backdrop-filter: blur(2px);
}
body.dark-theme #theme-toggle:hover {
    background-color: #777;
    color: #e85a4f;
}
/* Modal styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Hide overflow */
    background-color: rgba(0, 0, 0, 0.8); /* Black w/ opacity */
    backdrop-filter: blur(5px); /* Blur background */
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 80%;
    border-radius: 10px;
    position: absolute; /* Needed for transition */
    transition: all 0.5s ease-in-out;
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

@keyframes popIn {
    0% {
        transform: translate(var(--start-x), var(--start-y)) scale(var(--start-scale));
    }
    100% {
        transform: translate(0, 0) scale(1);
    }
}

@keyframes popOut {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(var(--start-x), var(--start-y)) scale(var(--start-scale));
    }
}

.modal.show .modal-content {
    animation: popIn 0.4s forwards;
}

.modal.hide .modal-content {
    animation: popOut 0.4s forwards;
}
