/* ---------- LEFT PANNEL (MENU) ---------- */
.leftPannel {
    position: fixed;
    display: grid;
    grid-template-columns: 20% 1fr;
    align-items: start;
    z-index: 9999;
    top: 0px;
    justify-self: center;
    width: 100vw;
    height: 100vh;
    background-color: rgb(21, 21, 21);
    overflow: hidden;
    transform: translateY(-100vh);
    pointer-events: none; /* Prevent ghost clicking when invisible */
    transition: transform 0.5s ease-in-out; /* Smooth slide animation */
}

/* Menu image container */
.menuImage {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: start;
}

.menuImage img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 10;
    pointer-events: none;
}

.menuImage .menuImageContent {
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: start;
    padding: 20px;
    gap: 10px;
    color: #f1f1f1;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.menuImage .menuImageContent .Text {
    font-size: 2em;
    font-weight: bold;
    display: block;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
}

.menuImage .menuImageContent .subtitleText {
    font-size: 1em;
    display: block;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
}

/* Clock Styles */
.menuImageClock {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 20px;
    width: calc(100% - 40px);
    height: auto;
    z-index: 1;
}

.clock-face {
    width: 10vw;
    height: 10vw;
    border-radius: 50%;
    border: 3px solid #f1f1f1;
    background-color: rgba(21, 21, 21, 0.7);
    backdrop-filter: blur(10px);
    position: relative;
}

.clock-hand {
    position: absolute;
    
    transform-origin: bottom center;
    left: 50%;
    bottom: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.hour-hand {
    width: 4px;
    height: 2vw;
    background-color: red;
    margin-left: -2px;
}

.minute-hand {
    width: 3px;
    height: 4vw;
    background-color: #f1f1f1;
    margin-left: -1.5px;
}

.second-hand {
    width: 1px;
    height: 3vw;
    margin-left: -1px;
    background-color: #f1f1f1;
}

.clock-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #f1f1f1;
    z-index: 10;
}


/* When active, slide down from top */
.leftPannel.active { 
    transform: translateY(0);
    pointer-events: auto; /* Re-enable clicking when visible */
}

/* First menu item container (home + close button) */
.firstMenuItem {
    position: relative;
    display: flex;
    width: 100%;
    flex: 1 1 0;
    min-height: 0;
}

/* Ensure no static border on firstMenuItem */
.firstMenuItem {
    border-bottom: none !important;
}

.firstMenuItem .homeLink {
    flex: 1;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.firstMenuItem .homeLink::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 0;
    width: 100%;
    height: calc(100% - 1px);
    background-color: #f1f1f1;
    transform: translateY(-100%);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    pointer-events: none;
    clip-path: inset(0 0 1px 0);
}

.firstMenuItem .homeLink:hover:not(.slide-out):not(.resetting)::before {
    transform: translateY(0);
}

.firstMenuItem .homeLink.slide-out::before {
    transform: translateY(100%);
}

.firstMenuItem .homeLink.resetting::before {
    transition: none;
    transform: translateY(-100%);
}

.firstMenuItem .homeLink:hover {
    color: rgba(21, 21, 21);
}

/* Close button in first menu item */

.firstMenuItem button {
    all: unset;
    cursor: pointer;
    display: block;
}

.firstMenuItem .closeLeftPanel {
    position: relative;
    background: transparent;
    border: none;
    color: #f1f1f1;
    font-size: 4vw; /* Same base size as mainSection a text */
    cursor: pointer;
    width: auto;
    padding: 0 3vw;
    min-width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: color 0.2s ease;
    overflow: hidden;
    pointer-events: auto;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Animated left border for close button */
.firstMenuItem .closeLeftPanel {
    --border-height: 0px;
}

.firstMenuItem .closeLeftPanel::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: var(--border-height, 0);
    background-color: #f1f1f1;
    z-index: 11;
    pointer-events: none;
}

.firstMenuItem .closeLeftPanel:hover {
    color: rgba(21, 21, 21);
}

.firstMenuItem .closeLeftPanel .close-icon {
    width: 1em;
    height: 1em;
    color: inherit;
    position: relative;
    z-index: 2;
    pointer-events: none;
    --stroke-width: 1px;
    display: block;
    overflow: visible;
}

.firstMenuItem .closeLeftPanel .close-icon .close-line {
    position: absolute;
    width: 141.42%; /* sqrt(2) * 100% to reach corners when rotated 45deg */
    height: var(--stroke-width, 1px);
    background-color: currentColor;
    left: 50%;
    top: 50%;
    transform-origin: center center;
    transform: translate(-50%, -50%) scaleX(0);
}

.firstMenuItem .closeLeftPanel .close-icon .close-line-1 {
    transform: translate(-50%, -50%) rotate(45deg) scaleX(0);
}

.firstMenuItem .closeLeftPanel .close-icon .close-line-2 {
    transform: translate(-50%, -50%) rotate(-45deg) scaleX(0);
}

/* Hover effect for close button - slides from top, out to bottom */
.firstMenuItem .closeLeftPanel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f1f1f1;
    transform: translateY(-100%);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    pointer-events: none;
}

/* Disable transition when resetting close button */
.firstMenuItem .closeLeftPanel.resetting::before {
    transition: none;
    transform: translateY(-100%);
}

.firstMenuItem .closeLeftPanel:hover:not(.slide-out):not(.resetting)::before {
    transform: translateY(0);
}

.firstMenuItem .closeLeftPanel.slide-out::before {
    transform: translateY(100%);
}

/* Ensure content is properly positioned during animation */
.leftPannel .menu {
    opacity: 0;
    transition: opacity 0.2s ease-out;
    transition-delay: 0.1s; /* Delay for smooth appearance after panel slides */
}

.leftPannel.active .menu {
    display: flex;
    flex-direction: column;
    opacity: 1;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Animated left border for menu */
.leftPannel .menu {
    --border-height: 0px;
}

.leftPannel.active .menu::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: var(--border-height, 0);
    background-color: #f1f1f1;
    z-index: 1;
    pointer-events: none;
}

.leftPannel:not(.active) .menu::before {
    display: none;
}

.mainSection {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 60vh;
    overflow: hidden; /* Clip the sliding background */
}

.mainSection a {
    position: relative;
    display: flex;
    align-items: center;
    font-size: 5em;
    color: #f1f1f1;
    text-decoration: none;
    padding: 10px 0 10px 2vw;
    width: 100%;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    transition: color 0.2s ease;
    z-index: 1;
    cursor: pointer;
    justify-content: flex-start;
}

/* Animated bottom border for mainSection items */
/* Ensure no static borders on mainSection a */
.mainSection a {
    border-bottom: none !important;
}

.firstMenuItem .homeLink {
    border-bottom: none;
}

/* Individual hover container for each menu item */
.mainSection a::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 0;
    width: 100%;
    height: calc(100% - 1px);
    background-color: #f1f1f1;
    transform: translateY(-100%);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    pointer-events: none;
    clip-path: inset(0 0 1px 0);
}

/* Disable transition when resetting */
.mainSection a.resetting::before {
    transition: none;
    transform: translateY(-100%);
}

.mainSection a:hover:not(.slide-out):not(.resetting)::before {
    transform: translateY(0);
}

.mainSection a.slide-out::before {
    transform: translateY(100%);
}

.mainSection a:hover {
    color: rgba(21, 21, 21);
}

.mainSection a:hover {
    color: rgba(21, 21, 21);
}

/* Ensure text is above the sliding background */
.mainSection a .menuItems {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    height: 100%;
}

/* Animation styles for menu spans */
.mainSection a .menuItems span {
    display: inline-block;
    line-height: 1;
    overflow: hidden;
    position: relative;
}

.mainSection a .menuItems {
    overflow: hidden;
}

/* Base styles for second menu div - persist even when panel is closed */
.leftPannel .menu > div:nth-child(2) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 40vh;
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.leftPannel.active .menu > div:nth-child(2) {
    opacity: 1;
}

.leftPannel .menu > div:nth-child(2) .song {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: start;
    padding: 0;
    overflow: hidden; /* Clip the sliding background */
    position: relative;
}

/* Base styles for song link - persist even when panel is closed */
.leftPannel .menu > div:nth-child(2) .song a {
    position: relative;
    display: flex;
    align-items: center;
    font-size: 5em;
    color: #f1f1f1;
    text-decoration: none;
    padding: 10px 0 10px 2vw;
    width: calc(100% - 2vw);
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    transition: color 0.2s ease;
    z-index: 1;
    cursor: pointer;
}

.leftPannel.active .menu > div:nth-child(2) .song a {
    position: relative;
    display: flex;
    align-items: center;
    font-size: 5em;
    color: #f1f1f1;
    text-decoration: none;
    padding: 10px 0 10px 2vw;
    width: calc(100% - 2vw);
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    transition: color 0.2s ease;
    z-index: 1;
    cursor: pointer;
}

.leftPannel:not(.active) .menu > div:nth-child(2) .song a {
    pointer-events: none !important;
}

.leftPannel.active .menu > div:nth-child(2) .song a .menuItems {
    overflow: hidden;
    position: relative;
}

/* Hover effect for song link - same as mainSection a */
.leftPannel.active .menu > div:nth-child(2) .song a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f1f1f1;
    transform: translateY(-100%);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    pointer-events: none;
}

/* Disable transition when resetting */
.leftPannel.active .menu > div:nth-child(2) .song a.resetting::before {
    transition: none;
    transform: translateY(-100%);
}

.leftPannel.active .menu > div:nth-child(2) .song a:hover:not(.slide-out):not(.resetting)::before {
    transform: translateY(0);
}

.leftPannel.active .menu > div:nth-child(2) .song a.slide-out::before {
    transform: translateY(100%);
}

.leftPannel.active .menu > div:nth-child(2) .song a:hover {
    color: rgba(21, 21, 21);
}

/* Base styles for song link menuItems - persist even when panel is closed */
.leftPannel .menu > div:nth-child(2) .song a .menuItems {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: start;
    gap: 10px;
    overflow: hidden;
    height: 100%;
    width: 100%;
}

/* Ensure text is above the sliding background */
.leftPannel.active .menu > div:nth-child(2) .song a .menuItems {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: start;
    gap: 10px;
    overflow: hidden;
    height: 100%;
    width: 100%;
}

/* Base styles for song link menuItems span - persist even when panel is closed */
.leftPannel .menu > div:nth-child(2) .song a .menuItems span {
    overflow: hidden;
    position: relative;
    display: block;
}

.leftPannel.active .menu > div:nth-child(2) .song a .menuItems span {
    overflow: hidden;
    position: relative;
    display: block;
}

/* Base styles for contact section - persist even when panel is closed */
.leftPannel .menu > div:nth-child(2) .contactSection {
    display: flex;
    flex-direction: column;
    justify-content: end;
    align-items: start;
    height: -webkit-fill-available;
    width: -webkit-fill-available;
    gap: 10px;
    padding: 20px 20px 20px 2vw;
    overflow: hidden;
    position: relative;
}

/* Animated left border for contact section */
.leftPannel .menu > div:nth-child(2) .contactSection {
    --border-height: 0px;
}

.leftPannel .menu > div:nth-child(2) .contactSection::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: var(--border-height, 0);
    background-color: #f1f1f1;
    z-index: 0;
    pointer-events: none;
}

.leftPannel:not(.active) .menu > div:nth-child(2) .contactSection::before {
    display: none;
}

.leftPannel:not(.active) .firstMenuItem .closeLeftPanel::after {
    display: none;
}

/* Base styles for contact section links - persist even when panel is closed */
.leftPannel .menu > div:nth-child(2) .contactSection a {
    color: #f1f1f1;
    text-decoration: none;
    font-size: 1.2em;
}

.leftPannel.active .menu > div:nth-child(2) .contactSection a {
    color: #f1f1f1;
    text-decoration: none;
    font-size: 1.2em;
}

/* Base styles for contact section menuItems - persist even when panel is closed */
.leftPannel .menu > div:nth-child(2) .contactSection a .menuItems {
    display: grid;
    grid-template-columns: 50px 1fr;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.leftPannel.active .menu > div:nth-child(2) .contactSection a .menuItems {
    display: grid;
    grid-template-columns: 50px 1fr;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.leftPannel.active .menu > div:nth-child(2) .contactSection a .menuItems span {
    white-space: nowrap;
}

.leftPannel.active .menu > div:nth-child(2) .contactSection a .menuItems i {
    justify-self: center;
}




.exitMinimizeButtons {
    display: flex;
    flex-direction: row;
    gap: 7px;
    padding-left: 10px;
    padding-top: 10px;
    font-size: 0.8em;
    color: #cb712c;;
}

.menu {
    display: flex;
    flex-direction: column;
}

.leftSubSection {
    display: flex;
    flex-direction: column;
}



/* Backdrop effect when left panel is open */
.leftPannel::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: auto;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
    pointer-events: none;
    z-index: -1;
}

.leftPannel.active::before {
    opacity: 1;
    visibility: visible;
}


@media (max-width: 1400px) {

    .firstMenuItem .closeLeftPanel {
        font-size: 4em;
        padding: 0 4vw;
    }
}


@media (max-width: 1100px) {

    .mainSection a {
        font-size: 3em;
    }

    .leftPannel .menu > div:nth-child(2) .song a {
        font-size: 3em;
    }
}

@media (max-width: 900px) {

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

    .mainSection {
        flex: 1 1 0;
        min-height: 0;
        max-height: 100%;
        overflow: visible;
        display: flex;
        flex-direction: column;
    }

    .mainSection a {
        height: auto !important;
        flex: 0 0 auto;
        flex-shrink: 1;
        padding: 15px 0 15px 2vw;
    }

    .firstMenuItem {
        height: auto !important;
        flex: 0 0 auto;
        flex-shrink: 1;
    }

    .firstMenuItem .homeLink {
        height: auto;
    }

    .firstMenuItem .closeLeftPanel {
        height: auto;
        font-size: 3em;
        padding: 0 2vw;
        min-width: auto;
    }

    .leftPannel .menu > div:nth-child(2) {
        flex: 0 1 auto;
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .leftPannel.active .menu {
        overflow: hidden;
        display: flex;
        flex-direction: column;
        height: 100vh;
    }

    .leftPannel.active .menu > div:nth-child(2) .song {
        flex: 0 0 auto;
        height: auto !important;
        width: auto !important;
    }

    .leftPannel .menu > div:nth-child(2) .song a {
        font-size: 3em;
    }

    .leftPannel.active .menu > div:nth-child(2) .song a {
        height: auto;
        font-size: 3em;
    }

    .leftPannel.active .menu > div:nth-child(2) .contactSection {
        flex: 0 0 auto;
        height: auto;
    }

    .contactSection {
        border-top: 1px solid #f1f1f1;
    }

    .menuImage {
        display: none;
    }

    .leftPannel.active .menu > div:nth-child(2) {
        opacity: 1 !important;
        display: grid !important;
    }
}

@media (max-width: 550px) {
    .mainSection a {
        font-size: 2em;
    }

    .leftPannel .menu > div:nth-child(2) .song a {
        font-size: 2em;
    }

    .leftPannel.active .menu > div:nth-child(2) .song a {
        font-size: 2em;
    }
}