:root {
    --primary-color: #333;
    --secondary-color: #f4f4f4;
    --highlight-color: #893864;
    --hover-color: #FFD600;
    --text-color: white;
    --text-hover-color: black;
    --light-color: #FFE3A4;
    --item-bg-color: #fff;
    --item-border-color: #ccc;
    --nav-hover-bg-color: #d3d3d3; /* Gray color for highlight */

    --prussian-blue: #0f384f;
    --rich-black: #04151f;
    --princeton-orange: #ff8f0f;
    --antiflash-white: #EBEBEB;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: "Gill Sans", sans-serif;
    height: 100%;
    background: linear-gradient(-45deg, var(--prussian-blue), var(--rich-black), var(--princeton-orange));
    background-size: 1000% 1000%;
    animation: gradient 15s ease infinite;
    scroll-behavior: smooth;
}

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

.container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    color: var(--antiflash-white);
}

header {
    background-color: var(--primary-color);
    text-align: center;
    padding: 0rem;
    overflow: hidden;
    position: relative;
    animation: slide-in 1s ease;
    font-size: 1.1rem;
    flex: 0 0 auto;
}

header h1 {
    background: linear-gradient(270deg, var(--secondary-color), var(--highlight-color), var(--secondary-color));
    background-size: 800% 800%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-animation 20s ease infinite;
}

@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes slide-in {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fade-in {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.navbar {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 1rem 0;
    position: -webkit-sticky; /* For Safari */
    position: sticky;
    top: 0;
    z-index: 1000; /* Ensure the navbar is above other elements */
}

.menu-icon {
    display: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--antiflash-white);
}

.navbar ul {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.navbar ul li {
    margin: 0 1rem;
}

.navbar ul li a {
    text-decoration: none;
    color: var(--antiflash-white);
    font-weight: bold;
    transition: color 0.3s, background-color 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.navbar ul li a:hover {
    color: var(--princeton-orange);
    background-color: rgba(0, 0, 0, 0.3);
}

.navbar ul li a.active {
    background-color: var(--princeton-orange);
    color: var(--rich-black);
}

nav ul li a:hover {
    color: var(--highlight-color);
    background-color: var(--nav-hover-bg-color); /* Gray highlight effect */
}

@media (max-width: 768px) {
    .navbar ul {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: rgba(0, 0, 0, 0.7);
    }

    .navbar ul li {
        margin: 0.5rem 0;
    }

    .menu-icon {
        display: block;
    }
}

.show {
    display: flex !important;
    flex-direction: column;
}

main {
    padding: 1rem;
    animation: fade-in 2s ease-out;
    flex: 0 0 auto;
}

.container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.item {
    background-color: var(--item-bg-color);
    border: 1px solid var(--item-border-color);
    border-radius: 5px;
    padding: 1rem;
    flex: 1 1 calc(33.333% - 10px);
    max-width: 500px; /* Set maximum width */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 10px;
}

.item h2 {
    color: var(--highlight-color);
}

.item p {
    color: var(--primary-color);
}

.item.video video {
    width: 100%;
    height: auto;
}

.item.image img,
.item.chart img {
    width: 100%;
    height: auto;
}

@media (max-width: 900px) {
    .item {
        flex: 1 1 calc(50% - 20px);
    }
}

@media (max-width: 600px) {
    .item {
        flex: 1 1 100%;
    }

    nav ul {
        flex-direction: column;
    }

    nav ul li {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .cta-button {
        padding: 10px;
    }
}

.cta-button {
    display: inline-block;
    background-color: var(--highlight-color);
    color: var(--text-color);
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.cta-button:hover {
    background-color: var(--hover-color);
    color: var(--text-hover-color);
}

footer {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--antiflash-white);
    text-align: center;
    padding: 1rem 0;
    position: fixed;
    bottom: 0;
}

footer p {
    font-size: 0.9rem; /* Smaller font size for footer text */
}

footer p a {
    font-size: 0.9rem; /* Ensure links in the footer are also smaller */
}

footer a {
    color: var(--princeton-orange);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Tooltip container */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

/* Tooltip text */
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%; /* Adjust the distance above the text */
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px;
    border-radius: 5px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

/* Tooltip arrow */
[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: 100%; /* Adjust the position above the text */
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #333 transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

/* Show the tooltip */
[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Project Card Styling */
.project-card {
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--antiflash-white);
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem;
    width: 300px;
    max-width: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.project-card img {
    width: 100%;
    border-radius: 10px 10px 0 0;
}

.project-card h2 {
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

.project-card p {
    font-size: 0.8rem;
    margin: 0.5rem 0 1rem 0;
}

.project-card a {
    text-decoration: none;
    color: var(--princeton-orange);
    font-weight: bold;
}

.project-card a:hover {
    text-decoration: underline;
}

.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 3s ease;
    min-height: 100vh; /* Ensure each content section takes full height of the viewport */
    padding: 2rem 1rem;
    opacity: 0; /* Start hidden */
    transition: opacity 2s ease-in-out; /* Smooth fade-in */
}

.content.appear {
    opacity: 1; /* Visible when in view */
}

h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

p {
    font-size: 1rem;
    margin-bottom: 1.1rem;
}

form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

input[type="email"] {
    padding: 0.5rem;
    border: none;
    border-radius: 5px;
    margin-bottom: 1rem;
    width: 250px;
    max-width: 80%;
}

button[type="submit"] {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    background-color: var(--princeton-orange);
    color: var(--rich-black);
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

button[type="submit"]:hover {
    background-color: var(--prussian-blue);
    color: var(--princeton-orange);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

table th, table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--item-border-color);
}

table th {
    background-color: var(--primary-color);
    color: var(--text-color);
}

table tr:nth-child(even) {
    background-color: var(--secondary-color);
}
