/* Flicker-Free Menu CSS - No animations that cause flickering */

.container {
    border: 1px solid #ddd;
    margin-bottom: 5px;
    background: #286b89;
    overflow: hidden;
}

.container .header-area {
    margin: 0;
    background: #286b89;
    color: white;
    cursor: pointer;
    padding: 12px 15px;
    font-weight: bold;
    user-select: none;
    position: relative;
    /* Remove any transitions that might cause flickering */
}

.container .header-area:hover {
    background: #1e5066;
}

/* Arrow styling - keep simple to avoid flickering */
.container .header-area .arrow {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    /* Remove transition to prevent flickering during rapid clicks */
}

/* Arrow when open - no animation */
.container:not(.collapsed) .header-area .arrow {
    transform: translateY(-50%) rotate(0deg);
}

/* Content areas - SIMPLE and stable display logic */
.container .content-area {
    background: white;
    display: none;
    /* Remove all transitions and animations to prevent flickering */
}

/* Show content when container is not collapsed - instant show/hide */
.container:not(.collapsed) .content-area {
    display: block;
}

/* Lists */
.container .content-area ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.container .content-area ul li {
    border-top: 1px solid #eee;
}

.container .content-area ul li a {
    display: block;
    padding: 5px 5px;
    text-decoration: none;
    color: #666;
    /* Keep only safe transitions that don't affect layout */
    transition: color 0.1s ease, background-color 0.1s ease;
}

.container .content-area ul li a:hover {
    background: #f8f8f8;
    color: #333;
    padding-left: 5px;
}

.container .content-area ul li.sel a {
    background: #e8f4fd;
    color: #0066cc;
    font-weight: bold;
}

/* Prevent any layout shifts during state changes */
.container * {
    box-sizing: border-box;
}

/* Ensure no unwanted transitions */
.container,
.container * {
    transition: none !important;
}

/* Only allow safe color transitions */
.container .content-area ul li a {
    transition: color 0.1s ease, background-color 0.1s ease !important;
}