/* CSS Variables for Light and Dark Themes */
:root {
    --background-color: #ffffff;
    --text-color: #333333;
    --accent-color: #007acc;
    --header-background: rgba(249, 249, 249, 0.9);
    --nav-background: rgba(255, 255, 255, 0.95);
    --footer-background: rgba(249, 249, 249, 0.9);
    --progress-bg: #eaeaea;
    --progress-bar: #007acc;
    --card-background: #ffffff;
    --modal-background: #ffffff;
    --button-background: #007acc;
    --button-text: #ffffff;
    --link-color: #555555;
    --link-hover-color: #1e90ff; /* Changed to bluish on hover */
    --margin: 20px;
    --padding: 20px;
    --svg-filter: brightness(0) saturate(100%) invert(0);
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #121212;
        --text-color: #e0e0e0;
        --accent-color: #90caf9;
        --header-background: rgba(30, 30, 30, 0.9);
        --nav-background: rgba(30, 30, 30, 0.95);
        --footer-background: rgba(30, 30, 30, 0.9);
        --progress-bg: #333333;
        --progress-bar: #90caf9;
        --card-background: #1e1e1e;
        --modal-background: #1e1e1e;
        --button-background: #90caf9;
        --button-text: #121212;
        --link-color: #bbbbbb;
        --link-hover-color: #1e90ff;
        --svg-filter: brightness(0) saturate(100%) invert(100%);
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    scroll-behavior: smooth;
    transition: background-color 0.3s, color 0.3s;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

/* WebGL Background */
#webgl-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Navigation */
nav {
    background-color: var(--nav-background);
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    border-bottom: 1px solid #eaeaea;
    z-index: 1000;
    transition: background-color 0.3s;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin: 0 20px;
}

nav ul li a {
    text-decoration: none;
    color: var(--link-color);
    font-weight: bold;
    padding: 8px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
}

nav ul li a:hover {
    color: var(--link-hover-color);
}

nav ul li a i {
    margin-right: 5px;
    font-size: 1.1em;
}

/* Header */
.header-content {
    background-color: var(--header-background);
    padding: 180px 20px 80px 20px;
    text-align: left;
    width: 100%;
    margin: 0 auto;
    position: relative;
    transition: background-color 0.3s;
}

.header-content h1 {
    font-size: 60px;
    margin-bottom: 20px;
}

.header-content p {
    font-size: 24px;
    color: var(--text-color);
}

/* Main Content */
main {
    padding: 100px 20px 80px 20px;
    width: 100%;
    margin: 0 auto;
}

section {
    margin-bottom: 80px;
    /* Add scroll-margin-top to prevent header overlap */
    scroll-margin-top: 80px; /* Adjust based on header height */
}

.university-logo {
    width: 24px;
    height: 24px;
    margin-left: 8px;
}

.bw-icon {
    filter: var(--svg-filter);
}

/* Styled Links */
main a {
    font-weight: bold;
    color: var(--link-color);
    text-decoration: none;
}

main a:hover {
    font-weight: bolder;
    color: var(--link-hover-color);
}

main a:visited {
    color: var(--link-color); /* Prevent color change after visit */
}

main ul {
    list-style-type: none; /* Remove default bullets */
    padding-left: 20px; /* Indent list */
}

main ul li::before {
    content: "– "; /* Use dash instead of bullet */
    color: var(--accent-color);
}

main .tech-icon {
    height: 18px;
    width: 18px;
}

/* Skills */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
}

.skill {
    flex: 1 1 45%;
    min-width: 250px;
}

.skill h3 {
    font-size: 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.skill h3 i {
    margin-right: 10px;
    font-size: 1.3em;
}

/* .icon-circle {
    background-color: #ffffff;
    border-radius: 50%;
    padding: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
} */

.skill .tech-icon {
    width: 1.3em;
    height: 1.3em;
    margin-right: 8px;
}

.tech-icon svg {
    fill: var(--link-color);
}

.skill h3 a {
    color: var(--link-color);
    text-decoration: none;
}

.skill h3 a:hover {
    color: var(--accent-color);
}

.skill h3 a:visited {
    color: var(--link-color);
}

.progress {
    background-color: var(--progress-bg);
    border-radius: 20px;
    overflow: hidden;
    height: 20px;
}

.progress-bar {
    height: 100%;
    background-color: var(--progress-bar);
    width: 0;
    transition: width 2s;
}

.progress-bar.outlined {
    border-radius: 20px 0px 0px 20px;
    border: #ffffff 1px solid;
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: var(--card-background);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-left: 5px solid var(--accent-color); /* Default color */
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 24px rgba(0, 0, 0, 0.2);
}

.project-card h3 {
    margin-bottom: 15px;
    color: var(--accent-color);
    display: flex;
    align-items: center;
}

.project-card h3 i {
    margin-right: 8px;
}

.project-card p {
    flex-grow: 1;
    font-size: 16px;
    color: var(--text-color);
}

/* Project Tags */
.project-tags {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.project-tags i {
    font-size: 1.2em;
    color: var(--accent-color);
}

/* Contact */
.contact-links {
    list-style: none;
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    padding: 0;
    margin-top: 20px;
}

.contact-links li {
    /* No additional styles needed */
}

.contact-links a {
    text-decoration: none;
    color: var(--link-color);
    font-weight: bold;
    font-size: 18px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
}

.contact-links a:hover {
    color: var(--link-hover-color);
}

.contact-links a:visited {
    color: var(--link-color);
}

.contact-links a i {
    margin-right: 8px;
    font-size: 1.2em;
}

/* Footer */
footer {
    background-color: var(--footer-background);
    padding: 30px 20px;
    text-align: center;
    transition: background-color 0.3s;
}

footer p {
    margin: 5px 0;
}

footer a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--link-hover-color);
}

footer a:visited {
    color: var(--link-color);
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 2000; /* Sit on top */
    padding-top: 100px; /* Location of the box */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.7); /* Black w/ opacity */
}

.modal-content {
    background-color: var(--modal-background);
    margin: auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 700px;
    border-radius: 15px;
    position: relative;
    transition: background-color 0.3s, color 0.3s;
}

.close {
    color: var(--text-color);
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
}

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

.modal-button {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 25px;
    background-color: var(--button-background);
    color: var(--button-text);
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.3s, opacity 0.3s;
}

.modal-button:hover {
    opacity: 0.9;
}

/* Modal Icons */
.modal-icons {
    margin-top: 15px;
    display: flex;
    gap: 15px;
}

.modal-icons i {
    font-size: 1.8em;
    color: var(--accent-color);
}

/* Icon Circle for GitHub and OpenAI */
.icon-circle {
    background-color: #ffffff;
    border-radius: 50%;
    padding: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    /* Add box-shadow for better visibility */
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.icon-circle i,
.icon-circle img {
    color: #181717; /* GitHub's color */
    font-size: 1.3em;
}

.icon-circle img.tech-icon {
    width: 1.3em;
    height: 1.3em;
}

/* Responsive Design */
@media (max-width: 1200px) {
    section p {
        max-width: 900px;
    }
}

@media (max-width: 1024px) {
    .header-content {
        padding: 140px 20px 60px 20px;
    }

    .header-content h1 {
        font-size: 48px;
    }

    .header-content p {
        font-size: 20px;
    }

    section h2 {
        font-size: 32px;
    }

    .project-card {
        padding: 20px;
    }

    /* Adjust scroll-margin-top for smaller headers */
    section {
        scroll-margin-top: 70px; /* Adjust as needed */
    }
}

@media (max-width: 768px) {
    .skills-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .skill {
        width: 100%;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    nav ul {
        flex-direction: column;
        gap: 10px;
    }

    .contact-links {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 36px;
    }

    .header-content p {
        font-size: 18px;
    }

    section h2 {
        font-size: 28px;
    }

    .project-card h3 {
        font-size: 20px;
    }

    .contact-links a {
        font-size: 16px;
    }

    /* Adjust scroll-margin-top for very small screens */
    section {
        scroll-margin-top: 60px; /* Adjust as needed */
    }
}
