/* Menu Styles */
#menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 25px;
    height: 100px;
    background-color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    font-size: 14px;
    transition: width 0.3s ease 0.3s, height 0.3s ease 0s;
    z-index: 1000;
    overflow: hidden;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}
#menu.expanded {
    width: 250px;
    height: 200px;
    background-color: rgba(255, 255, 255, 0.85);
    transition: width 0.3s ease 0s, height 0.3s ease 0.4s, background-color 0.4s ease 0.4s;
}
#menu.collapsed {
    width: 25px;
    height: 100px;
}
#menu ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}
#menu ul li {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
#menu ul li a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-decoration: none;
    padding: 0 20px;
    color: #000;
    transition: background-color 0.3s, color 0.3s;
    white-space: nowrap;
    position: relative;
    box-sizing: border-box;
    height: 100%;
}
#menu.collapsed ul li a {
    padding: 0 5px;
    justify-content: center;
}
#menu ul li a span {
    margin-left: 10px;
    transition: opacity 0.3s;
    opacity: 1;
    color: #000;
}
#menu.collapsed ul li a span {
    opacity: 0;
}
#menu ul li a::after {
    content: attr(data-text);
    color: #000;
    position: absolute;
    left: -250px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 5px 10px;
    white-space: nowrap;
    display: none;
    border: 1px solid #ccc;
    border-radius: 3px;
    z-index: 1001;
}
#menu.collapsed ul li a:hover::after {
    display: block;
}
#menu ul li a:hover {
    background-color: #000;
    color: #FFF;
}
#menu ul li a:hover span {
    color: #FFF;
}

/* Prevent hover effects on touch devices */
@media (hover: none) {
  #menu ul li a:hover {
    background-color: transparent !important;
    color: #000 !important;
  }
  #menu ul li a:hover span {
    color: #000 !important;
  }
  #menu.collapsed ul li a:hover::after {
    display: none !important;
  }
}

/* For touch devices that might still trigger hover, add explicit touch states */
@media (hover: none) and (pointer: coarse) {
  #menu ul li a:hover {
    background-color: transparent !important;
    color: #000 !important;
  }
}

