body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

.error-page {
    text-align: center;
    margin-top: 100px;
}

.error-page h1 {
    font-size: 10em;
    margin: 0;
}

.error-page p {
    font-size: 1.5em;
    margin: 20px 0;
}

.error-page .btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007BFF;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.error-page .btn:hover {
    background-color: #0056b3;
}

.dark-theme {
    background-color: #333;
    color: #f4f4f4;
}

.dark-theme .error-page .btn {
    background-color: #4da6ff;
}

.dark-theme .error-page .btn:hover {
    background-color: #1a73e8;
}

header {
    text-align: center;
    margin-top: 50px;
}

.typewriter h1 {
    width: fit-content;
    overflow: hidden;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: .12em;
}

.blinking-caret {
    border-right: .15em solid black;
    animation: blink-title-caret .75s step-end infinite;
}

@keyframes blink-title-caret {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

#terminal {
    font-family: 'Courier New', Courier, monospace;
    background-color: #f4f4f4;
    color: #333;
    border: 1px solid #ccc;
    padding: 20px;
    margin-top: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
    text-align: left; /* Align text to the left */
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #e0e0e0;
    padding: 5px 10px;
    border-bottom: 1px solid #ccc;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.terminal-header .buttons {
    display: flex;
    gap: 5px;
}

.terminal-header .buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.terminal-header .buttons .close {
    background-color: #ff5f56;
}

.terminal-header .buttons .minimize {
    background-color: #ffbd2e;
}

.terminal-header .buttons .maximize {
    background-color: #27c93f;
}

.terminal-body {
    padding: 30px 10px 10px; /* Adjusted padding to account for header */
}

.terminal-body .output {
    color: #007BFF;
}

.terminal-body .caret-container {
    display: inline-block;
    position: relative;
    height: 20px; /* Ensure height is defined */
}

.terminal-body .caret-container::before {
    content: '>';
    margin-right: 5px; /* Add margin to separate '>' from caret */
}

.terminal-body .caret-container::after {
    content: ''; /* Remove the content '|' */
    display: inline-block;
    width: 2px; /* Adjust the width of the caret */
    height: 1em; /* Ensure caret height matches text height */
    background-color: #333; /* Visible caret color */
    animation: blink-terminal-caret 1s steps(20, end) infinite;
    position: absolute;
    left: calc(100% + 5px); /* Position caret after '>' */
}

.dark-terminal .terminal-body .caret-container::after {
    background-color: #333; /* White caret for dark terminal */
}

@keyframes blink-terminal-caret {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes blink-terminal-caret-dark {
    from, to { border-color: transparent }
    50% { border-color: #fff; }
}

.dark-terminal {
    background-color: #000;
    color: #fff;
    border: 1px solid #555;
}

.dark-terminal .terminal-header {
    background-color: #444;
    border-bottom: 1px solid #555;
}

.dark-terminal .terminal-body .output {
    color: #4da6ff;
}

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

#portfolio h2 {
    margin-bottom: 20px;
    font-size: 2rem;
}

/* Project Item Styling */
.portfolio-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background-color: #f0f0f0; /* Light background for the project card */
    border-radius: 15px; /* Rounded corners */
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-5px); /* Lift effect on hover */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* Darker shadow on hover */
}

/* Image Styling */
.project-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 10px; /* Rounded corners for image */
    margin-right: 20px;
}

/* Project Details Styling */
.project-details {
    flex: 1; /* Take up remaining space */
    text-align: left;
}

.project-details h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.project-details p {
    margin: 10px 0;
    color: #666;
    font-size: 1rem;
}

/* Link Styling */
.project-details a {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff; /* Blue background */
    color: white;
    text-decoration: none;
    border-radius: 5px; /* Slight rounding for button look */
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.project-details a:hover {
    background-color: #0056b3; /* Darker blue on hover */
}

#portfolio, #contact {
    margin-top: 50px;
}

.portfolio-item {
    margin-bottom: 20px;
}

.portfolio-item h3 {
    margin: 0;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.social-icons a {
    color: #333;
    font-size: 2em;
    transition: color 0.3s;
}

.social-icons a:hover {
    color: #555;
}

footer {
    text-align: center;
    justify-content: center;
    padding: 10px;
    color: #333;
    font-size: 0.8em;
    position: relative;
    bottom: 0;
    transition: background-color 0.3s, color 0.3s;
}

button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;  /* Circular size */
    height: 50px; /* Circular size */
    border-radius: 50%; /* Make it a circle */
    background-color: #333; /* Default background for dark mode */
    color: #fff; /* Text/emoji color */
    border: none;
    cursor: pointer;
    font-size: 1.5em; /* Larger emoji */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, color 0.3s;
}

button:hover {
    background-color: #555; /* Slightly lighter on hover */
}

.dark-theme button {
    background-color: #f4f4f4; /* Light background in dark mode */
    color: #333; /* Dark emoji color */
}

.dark-theme {
    background-color: #333;
    color: #f4f4f4;
}

.dark-theme footer {
    background-color: #333;
    color: #f4f4f4;
}

.dark-theme .social-icons a {
    color: #f4f4f4;
}

.dark-theme .social-icons a:hover {
    color: #ddd;
}

.dark-theme .portfolio-item {
    background-color: #333;
}

.dark-theme .project-details {
    h3 { color: #ddd }
    p { color: #cac1c1 }
}