* {
    box-sizing: border-box;
}

body {
    background-color: #f9f9f9;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

img {
    -webkit-user-drag: none;
}

#menu {
    background-color: #fff;
    color: #333;
    margin-right: 20px;
    padding: 5px;
    width: 14vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: width 0.3s ease;
}

body.dark-mode #menu {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

#menu #icp {
    color: #999;
    text-decoration: none;
}

body.dark-mode #menu #icp {
    color: #a0a0a0;
}

#menu #profile {
    margin-top: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#menu #profile img {
    width: 60%;
    height: 100%;
    border-radius: 50%;
    margin: 30px;
    transition: transform 0.39s ease;
}

#menu #profile img:hover {
    transform: rotate(360deg);
}

#menu #profile p {
    font-size: 1.2vw;
    max-width: 80%;
    margin: 0;
    padding: 0;
    color: #666;
}

body.dark-mode #menu #profile p {
    color: #a0a0a0;
}

.menu-items {
    background-color: #fff;
    margin-top: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: auto;
}

body.dark-mode .menu-items {
    background-color: #1e1e1e;
}

.menu-items div {
    width: 100%;
    height: 8vh;
    margin-top: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2vw;
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

.menu-items div:hover {
    background-color: #f0f0f0;
    color: #007bff;
    cursor: pointer;
}

body.dark-mode .menu-items div:hover {
    background-color: #2a2a2a;
    color: #007bff;
}

.menu-footer {
    color: #999;
    position: fixed;
    bottom: 0;
    padding: 2vh 5px;
    font-size: 0.8vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

body.dark-mode .menu-footer {
    color: #a0a0a0;
}

.link {
    width: 20%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

.link a img {
    width: 100%;
    transition: transform 0.3s ease;
}

.view-box {
    margin-left: 16vw;
    color: #333;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    flex: 1;
}

body.dark-mode .view-box {
    color: #e0e0e0;
}

.footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    position: relative;
    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 1rem 0;
    background-color: #f9f9f9;
    color: #999;
    font-size: 1rem;
    margin-top: auto;
}

body.dark-mode .footer {
    background-color: #121212;
    color: #a0a0a0;
}

.footer a {
    color: #999;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer a img {
    width: 1rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.footer a:hover {
    color: #007bff;
}

body.dark-mode .footer a {
    color: #a0a0a0;
}

body.dark-mode .footer a:hover {
    color: #007bff;
}

.theme-switch {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    background: white;
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.theme-btn:active {
    transform: scale(0.95);
}

body.dark-mode .theme-btn {
    background: #2a2a2a;
    color: white;
}

.theme-switch.hidden {
    transform: translateX(100px);
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 768px) {
    #menu {
        width: 100%;
        height: auto;
        position: relative;
        box-shadow: none;
    }

    #menu #profile img {
        width: 100px;
        height: 100px;
        margin: 10px;
    }

    #menu #profile p {
        font-size: 16px;
    }

    .menu-items {
        flex-direction: row;
        justify-content: center;
        margin-top: 10px;
    }

    .menu-items div {
        width: auto;
        height: auto;
        padding: 10px;
        font-size: 16px;
    }

    .menu-footer {
        position: relative;
        padding: 10px;
        height: auto;
        font-size: 14px;
    }

    .view-box {
        margin-left: 0;
        padding: 1rem;
    }

    .footer {
        flex-direction: column;
        gap: 0.3rem;
        font-size: 0.8rem;
    }

    .footer a img {
        width: 0.8rem;
    }
}