/**
 * Menu Accordion Styles
 * - Removes hover effects
 * - Adds smooth slide and fade transitions
 * - Styles for active/expanded state
 * - Arrow rotation animation
 */

/* Remove hover-content visibility on hover for ALL items (we use click now) */
.menucat-list:hover .hover-content {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Override existing hover padding on data-colom */
/* .menu-cat .menucat-list:hover .data-colom,
.menucat-list:hover .data-colom {
    padding: 0 !important; 
} */

/* Keep normal padding for non-hover state if needed */
.menucat-list .data-colom {
    /* Add your desired default padding here if needed */
}

/* CRITICAL: Keep content visible when hovering over ACTIVE items */
.menucat-list.active:hover .hover-content {
    display: grid !important; /* Keep grid layout, not block */
    grid-template-columns: 1fr 1fr !important; /* Maintain 2 columns */
    opacity: 1 !important;
    visibility: visible !important;
    max-height: none !important; /* Ensure it stays expanded */
}

/* Keep image hidden when hovering over active items */
.menucat-list.active:hover .image-box {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Make menucat-list clickable with pointer cursor */
.menucat-list {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible; /* Allow container to grow */
    min-height: auto; /* Let it grow naturally */
}

/* Image box transition */
.menucat-list .image-box {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Ensure data-colom container grows with content */
.menucat-list .data-colom {
    position: relative;
    overflow: visible;
    transition: all 0.6s ease;
}

/* Hover content - hidden by default, controlled by JavaScript */
.menucat-list .hover-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    display: none;
    transition: max-height 0.6s ease, opacity 0.5s ease;
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6); /* Semi-transparent dark background for readability */
    border-radius: 8px;
    box-sizing: border-box; /* Include padding in height calculation */
    position: relative; /* Keep it in document flow */
    width: 100%; /* Full width of parent */
}

/* Active state - when menu item is expanded */
.menucat-list.active {
    /* Add any active state styles here */
}

/* When active: Make data-colom a flex container with column direction */
.menucat-list.active .data-colom {
    display: flex;
    flex-direction: column;
}

/* When active: Title-box styling (no width/margin changes as per user request) */
.menucat-list.active .title-box {
    order: -1; /* Ensure it stays at top */
    text-align: center;
}

.menucat-list.active .title-box h3 {
    font-size: 2.5em;
    margin: 0;
    display: none;
}

/* When active: Hover-content becomes 2-column grid layout */
.menucat-list.active .hover-content {
    display: grid !important;
    grid-template-columns: 1fr 1fr; /* 50% - 50% */
    gap: 30px;
    opacity: 1;
    overflow: visible;
    order: 1; /* Comes after title-box */
}

/* Column wrapper for sections */
.menucat-list.active .hover-content .menu-section {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

/* First column sections */
.menucat-list.active .hover-content .menu-section:nth-child(odd) {
    grid-column: 1;
}

/* Second column sections */
.menucat-list.active .hover-content .menu-section:nth-child(even) {
    grid-column: 2;
}

/* Hide HR tags as they're now section dividers */
.menucat-list.active .hover-content hr {
    display: none;
}

/* Arrow button should come last */
.menucat-list.active .arrow-btn {
    order: 2;
}

/* Responsive: Stack columns on mobile */
@media (max-width: 768px) {
    .menucat-list.active .data-colom {
        display: flex;
        flex-direction: column;
    }
    
    .menucat-list.active .title-box {
        order: -1; /* Keep at top on mobile */
    }
    
    /* On mobile: Show as simple block, not grid */
    .menucat-list.active .hover-content {
        display: block !important; /* Not grid on mobile */
        grid-template-columns: none !important;
        order: 1; /* After title-box */
    }
    
    /* On mobile hover: Keep as block */
    .menucat-list.active:hover .hover-content {
        display: block !important;
        grid-template-columns: none !important;
    }
    
    .menucat-list.active .arrow-btn {
        order: 2; /* Last */
    }
    
    /* Hide menu-section wrappers on mobile (won't exist anyway) */
    .menucat-list.active .hover-content .menu-section {
        padding: 0;
        background: none;
    }
}

/* Hide image-box when active */
.menucat-list.active .image-box {
    display: none !important;
    opacity: 0;
    visibility: hidden;
}

.menucat-list.active .hover-content {
    display: block;
    opacity: 1;
    overflow: auto; /* Allow scrolling if needed, but content should be visible */
    /* max-height is set dynamically by JavaScript */
}

/* Arrow button styles */
.menucat-list .arrow-btn {
    transition: all 0.3s ease;
}

/* When active, position arrow button with title */
.menucat-list.active .arrow-btn {
    position: absolute;
    right: 20px;
    top: 20px;
}

.menucat-list .arrow-btn a {
    pointer-events: none; /* Prevent arrow link from interfering with main click */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.menucat-list .arrow-btn a i {
    transition: transform 0.4s ease;
    display: inline-block;
}

/* Rotate arrow when active */
.menucat-list.active .arrow-btn a i.rotated,
.menucat-list .arrow-btn a i.rotated {
    transform: rotate(90deg);
}

/* Optional: Add subtle hover effect on the entire card */
.menucat-list:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Optional: Add visual indicator for active item */
.menucat-list.active {
    border-left: 4px solid #your-theme-color; /* Replace with your theme color */
}

/* Ensure smooth transitions for all states */
.menucat-list * {
    transition-timing-function: ease-in-out;
}

/* Hover content typography - ensure it's visible when expanded */
.menucat-list .hover-content {
    color: #ffffff !important; /* White text for visibility on dark background */
}

.menucat-list .hover-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #d62324 !important
    font-weight: bold;
}

.menucat-list .hover-content h6 {
    margin-bottom: 20px;
    color: #ffffff !important;
    opacity: 0.9;
}

.menucat-list .hover-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #ffffff !important;
}

.menucat-list .hover-content hr {
    margin: 20px 0;
    border-color: rgba(255, 255, 255, 0.3) !important;
    opacity: 0.3;
}

.menucat-list .hover-content .col-title {
    font-weight: bold;
    color: #ffffff !important;
}

/* Animation for fade in effect */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menucat-list .hover-content.animated.fadeIn {
    animation: fadeIn 0.5s ease forwards;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .menucat-list .hover-content {
        font-size: 14px;
    }
    
    .menucat-list.active {
        border-left: 2px solid #your-theme-color;
    }
}

/* Prevent text selection during rapid clicking */
.menucat-list {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Re-enable text selection for hover content */
.menucat-list .hover-content {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}
