/* CSS Variables for Theme Colors */
:root {
    --primary-color: #1dd1a1;
    --secondary-color: #ff6b6b;
    --text-color: #333;
    --background-light: #f1f1f1;
}

/* General Styles */
body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    background-size: 150% 150%;
    color: var(--text-color);
    font-family: "Roboto", sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    animation: gradientAnimation 8s ease infinite, fadeIn 1s ease-in-out;
}

/* General Nav Styles */
.main-nav {
    background-color: var(--primary-color);
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.main-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    margin: 0 15px;
    padding: 10px 15px;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.main-nav a:hover,
.main-nav a:focus {
    background-color: var(--secondary-color);
    color: #fff;
    outline: 2px dashed var(--secondary-color);
    outline-offset: 2px;
}

.main-nav a.active {
    background-color: var(--secondary-color);
    color: #fff;
}

.hamburger {
    display: none;
    cursor: pointer;
    padding: 10px;
}

.hamburger div {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 5px;
    transition: all 0.3s ease;
}

/* Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Container for index.html */
.index-container {
    max-width: 600px;
    padding: 20px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
    margin: auto;
    text-align: center;
}

.index-container:hover {
    transform: scale(1.02);
}

/* Tree Node Styles */
.tree {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.tree-node {
    margin: 10px;
    padding: 15px 25px;
    background-color: var(--background-light);
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    font-weight: 500;
    text-align: center;
    min-width: 150px;
}

.tree-node:hover,
.tree-node:focus {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    outline: 2px dashed var(--secondary-color);
    outline-offset: 2px;
}

/* Modal Styles */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: auto;
}

.details {
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
    border-radius: 12px;
    max-width: 80%;
    width: 100%;
    text-align: center;
    position: relative;
    color: var(--text-color);
    max-height: 90vh;
    overflow: hidden;
    animation: fadeIn 0.5s ease-in-out;
}

.details img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    max-height: 80vh;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1.2em;
    cursor: pointer;
    z-index: 1001;
}

.close-btn:focus {
    outline: 2px dashed var(--secondary-color);
    outline-offset: 2px;
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {

    .details {
        max-width: 90%;
        max-height: 85vh;
        padding: 15px;
    }

    .tree-node {
        width: 100%;
        margin: 10px;
        padding: 15px 25px;
        font-size: x-large;
        background-color: var(--background-light);
        color: var(--text-color);
        border-radius: 8px;
        cursor: pointer;
        transition: background-color 0.3s, transform 0.3s;
        font-weight: 500;
        text-align: center;
        min-width: 150px;
        max-width: 100%;
    }

    .details img {
        max-height: 60vh;
    }

    .close-btn {
        top: 5px;
        right: 5px;
        width: 25px;
        height: 25px;
        font-size: 1em;
    }

    .main-nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav a {
        display: none;
        width: 100%;
        text-align: left;
        padding: 10px 20px;
        margin: 0;
    }

    .main-nav.active a {
        display: block;
        background-color: var(--primary-color);
    }

    .hamburger {
        display: block;
    }
}