*,
*::before,
*::after {
    box-sizing: border-box;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

/* Background Video Styling */
.background-video {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 50%;
    object-fit: cover;
    transform: translate(-50%, -50%);
    z-index: -1;
}

@media (orientation: portrait) {
    .background-video {
        position: fixed;
        width: 100%;
        object-fit: cover;
        z-index: -1;
    }
}

.title {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2em;
    font-weight: bold;
    color: black;
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
    width: auto;
    padding: 10px 20px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.7);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease, background-color 0.3s ease, color 0.3s ease;
    border: 2px solid black;
    border-radius: 25px;
}

.title.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Panel styles */
.info-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    z-index: 1000;
    overflow: auto;
    transform: translateY(-100%);
}

.info-content {
    max-width: 600px;
    text-align: center;
}

/* Arrow up button */
.close-top-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    position: absolute;
    top: 0%;
    right: 50%;
    transform: translateX(50%);
    padding: 10px;
    transition: transform 0.3s ease;
}

.close-top-btn:hover {
    transform: translateX(50%) translateY(-5px);
}

.show-panel-top {
    display: flex;
    animation: slideDownTop 0.5s ease-in-out forwards;
}

.hide-panel-top {
    animation: slideUpTop 0.5s ease-in-out forwards;
}

@keyframes slideDownTop {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes slideUpTop {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-100%);
    }
}

/* Social Icons */
.social-icons {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    max-width: 95%;
}

.social-icons i {
    color: white;
    transition: transform 0.3s ease, color 0.3s ease;
    font-size: 4vh; /* Use viewport width units to scale the font size */
    width: 100%;
    height: auto; /* Maintain aspect ratio */
}

.social-icons i:hover {
    transform: translateY(-5px);
}

/* Info Title at the Bottom */
.info-title {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2em;
    color: black;
    cursor: pointer;
    font-weight: bold;
    display: block;
    border: 2px solid black;
    border-radius: 25px;
    background-color: rgba(255, 255, 255, 0.5);
    /* See-through background */
    padding: 10px 20px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Styling when hiding the infoTitle button */
.hide-info-title {
    opacity: 0;
    transform: translate(-50%);
    pointer-events: none;
    /* Prevents interaction when hidden */
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Styling when showing the infoTitle button */
.show-info-title {
    opacity: 1;
    transform: translate(-50%);
    pointer-events: auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.new-info-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    display: none;
    justify-content: center;
    align-items: flex-start;
    /* Align content to the top */
    padding: 20px;
    box-sizing: border-box;
    z-index: 1001;
}

/* Custom scrollbar styles */
.new-info-content::-webkit-scrollbar {
    width: 8px;
    /* Width of the scrollbar */
}

.new-info-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    /* Background of the scrollbar track */
    border-radius: 10px;
}

.new-info-content::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    /* Color of the scrollbar thumb */
}

.new-info-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5);
    /* Color of the scrollbar thumb on hover */
}

.new-info-content {
    width: 100%;
    max-height: calc(100% - 60px);
    /* Reserve space for the close button */
    display: flex;
    flex-wrap: wrap;
    /* Wrap content on smaller screens */
    gap: 16px;
    /* Space between items */
    padding-bottom: 20px;
    /* Prevent content from overlapping the close button */
    overflow-y: auto;
    /* Enable vertical scrolling */
}

/* Ensure scrollability only on smaller screens */
@media (max-width: 768px) {
    .new-info-content {
        max-height: calc(100% - 60px);
        /* Reserve space for the close button */
        overflow-y: auto;
        /* Enable scrolling only on mobile */
    }
}

.project {
    flex: 1 1 calc(33.333% - 16px);
    /* Adjusts to 1/3 of the width minus the gap */
    box-sizing: border-box;
    padding: 16px;
}

@media (max-width: 768px) {
    .project {
        flex: 1 1 100%;
        /* Make items take full width on smaller screens */
    }
}

.close-bot-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    position: fixed;
    /* Position relative to the scrollable content */
    bottom: 10px;
    /* Position the button with a small offset */
    left: 50%;
    transform: translateX(-50%);
    padding: 10px;
    transition: transform 0.3s ease;
    z-index: 1002;
    /* Ensure it is above other content */
}

.close-bot-btn:hover {
    transform: translateX(-50%) translateY(5px);
}

.show-panel-bot {
    display: flex;
    animation: slideUpBot 0.5s ease-in-out forwards;
}

.hide-panel-bot {
    animation: slideDownBot 0.5s ease-in-out forwards;
}

/* Slide-up animation for the new info panel */
@keyframes slideUpBot {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Slide-down animation for closing the new panel */
@keyframes slideDownBot {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(100%);
    }
}

.info-icon {
    position: fixed;
    bottom: 20px;
    left: 20px;
    font-size: 24px;
    cursor: pointer;
}

.info-box {
    display: none;
    position: fixed;
    bottom: 60px; /* Adjusted to be higher than the projects button */
    left: 20px;
    width: 300px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.7); /* Slightly see-through */
    color: white;
    border-radius: 5px;
    font-size: 14px;
}

.info-box.active {
    display: block;
}

/* Media query for mobile devices */
@media (max-width: 768px) {
    .info-box {
        left: 50%;
        bottom: 50%;
        transform: translate(-50%, 50%);
        width: 90%; /* Adjust width as needed */
    }
}
