/**
 * Falling Menu Widget Styles - Full Screen Overlay Version
 * 
 * @package Pretpot Elementor Kit
 * @version 2.7.5
 */

/* Wrapper - Static positioning */
.pretpot-falling-menu-wrapper {
    position: relative;
    display: block;
}

/* Trigger Wrapper - For alignment */
.pretpot-falling-menu-trigger-wrapper {
    display: block;
    text-align: center;
}

/* Trigger Button - Simple static button */
.pretpot-falling-menu-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    padding: 0;
    overflow: hidden;
}

.pretpot-falling-menu-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.pretpot-falling-menu-trigger:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Hamburger Icon */
.pretpot-falling-menu-trigger .pretpot-icon-bar {
    display: block;
    width: 20px;
    height: 3px;
    background: #0a0a0a;
    border-radius: 2px;
    position: absolute;
    transition: all 0.3s ease;
    left: 50%;
    transform: translateX(-50%);
}

.pretpot-falling-menu-trigger .pretpot-icon-bar:nth-child(1) {
    top: 16px;
}

.pretpot-falling-menu-trigger .pretpot-icon-bar:nth-child(2) {
    top: 50%;
    transform: translate(-50%, -50%);
}

.pretpot-falling-menu-trigger .pretpot-icon-bar:nth-child(3) {
    bottom: 16px;
}

/* Active State - Transform to X */
.pretpot-falling-menu-trigger.active .pretpot-icon-bar:nth-child(1) {
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

.pretpot-falling-menu-trigger.active .pretpot-icon-bar:nth-child(2) {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
}

.pretpot-falling-menu-trigger.active .pretpot-icon-bar:nth-child(3) {
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Overlay - BREAKS OUT OF CONTAINER */
.pretpot-falling-menu-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    min-width: auto !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 999999 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    transform: none !important;
    transform-origin: center !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--pretpot-anim-duration, 500ms) ease;
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}

/* Force override any Elementor container constraints */
.elementor-element .pretpot-falling-menu-overlay,
.elementor-widget .pretpot-falling-menu-overlay,
.e-con .pretpot-falling-menu-overlay,
.elementor-column .pretpot-falling-menu-overlay,
.elementor-section .pretpot-falling-menu-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    transform: none !important;
}

.pretpot-falling-menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Dark Background (Default) */
.pretpot-falling-menu-overlay.pretpot-dark-bg {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Glass Background */
.pretpot-falling-menu-overlay.pretpot-glass-bg {
    background: linear-gradient(
        135deg, 
        rgba(255, 255, 255, calc(var(--pretpot-glass-opacity, 0.08) * 0.6)) 0%, 
        rgba(255, 255, 255, var(--pretpot-glass-opacity, 0.08)) 100%
    );
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pretpot-falling-menu-overlay.pretpot-glass-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at top left, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* Custom Background */
.pretpot-falling-menu-overlay.pretpot-custom-bg {
    /* Uses inline style for custom color */
}

/* Menu Items Container */
.pretpot-falling-menu-items {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    z-index: 1;
}

.pretpot-falling-menu-items::-webkit-scrollbar {
    width: 6px;
}

.pretpot-falling-menu-items::-webkit-scrollbar-track {
    background: transparent;
}

.pretpot-falling-menu-items::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

/* Menu Item */
.pretpot-falling-menu-item {
    position: relative;
    display: inline-block;
    padding: 22px 70px;
    text-decoration: none;
    color: var(--item-color, #0a0a0a);
    background: var(--item-bg, #ff7b2e);
    font-size: var(--item-font-size, 45px);
    font-weight: 600;
    cursor: pointer;
    transform: translateY(-100vh) rotate(0deg);
    opacity: 0;
    transition: 
        transform var(--pretpot-anim-duration, 500ms) cubic-bezier(0.68, -0.55, 0.265, 1.55),
        opacity var(--pretpot-anim-duration, 500ms) ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
    border: 3px solid #0a0a0a;
    white-space: nowrap;
    user-select: none;
    margin-bottom: -20px;
    text-align: center;
    z-index: 1;
}

/* Size Presets */
.pretpot-falling-menu-item.pretpot-size-small {
    font-size: 28px;
    padding: 15px 50px;
}

.pretpot-falling-menu-item.pretpot-size-medium {
    font-size: 45px;
    padding: 22px 70px;
}

.pretpot-falling-menu-item.pretpot-size-large {
    font-size: 60px;
    padding: 30px 90px;
}

/* Border Radius Variants */
.pretpot-falling-menu-item.pretpot-radius-pill {
    border-radius: 50px;
}

.pretpot-falling-menu-item.pretpot-radius-rounded {
    border-radius: 20px;
}

.pretpot-falling-menu-item.pretpot-radius-asymmetric1 {
    border-radius: 30px 60px 30px 60px;
}

.pretpot-falling-menu-item.pretpot-radius-asymmetric2 {
    border-radius: 20px 50px 50px 20px;
}

.pretpot-falling-menu-item.pretpot-radius-sharp {
    border-radius: 0;
}

/* Active State Animations */
.pretpot-falling-menu-overlay.active .pretpot-falling-menu-item {
    opacity: 1;
    transform: 
        translateY(0) 
        rotate(var(--item-rotation, 0deg)) 
        translateX(var(--item-offset, 0px));
}

/* Staggered Delays */
.pretpot-falling-menu-overlay.active .pretpot-falling-menu-item {
    transition-delay: calc(var(--item-index, 0) * var(--pretpot-stagger-delay, 100ms));
}

/* Hover Effects */
.pretpot-falling-menu-item:hover,
.pretpot-falling-menu-item:focus {
    transform: 
        translateY(0) 
        rotate(0deg) 
        translateX(var(--item-offset, 0px)) 
        scale(1.05) !important;
    z-index: 100 !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    outline: none;
}

/* Focus Visible */
.pretpot-falling-menu-item:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.8);
    outline-offset: 3px;
}

/* Exit Animation */
.pretpot-falling-menu-item.exiting {
    animation: pretpotFallingMenuExit var(--pretpot-exit-duration, 400ms) ease forwards;
}

@keyframes pretpotFallingMenuExit {
    0% {
        opacity: 1;
        transform: 
            translateY(0) 
            rotate(var(--item-rotation, 0deg)) 
            translateX(var(--item-offset, 0px)) 
            scale(1);
    }
    100% {
        opacity: 0;
        transform: 
            translateY(-50px) 
            rotate(var(--item-rotation, 0deg)) 
            translateX(var(--item-offset, 0px)) 
            scale(0.5);
    }
}

/* Float Animation */
.pretpot-falling-menu-overlay.active .pretpot-falling-menu-item {
    animation: pretpotFallingMenuFloat var(--pretpot-float-duration, 4s) ease-in-out infinite;
    animation-delay: calc(var(--item-index, 0) * 0.6s);
}

.pretpot-falling-menu-overlay.active .pretpot-falling-menu-item.exiting {
    animation: pretpotFallingMenuExit var(--pretpot-exit-duration, 400ms) ease forwards;
}

@keyframes pretpotFallingMenuFloat {
    0%, 100% {
        transform: 
            translateY(0) 
            rotate(var(--item-rotation, 0deg)) 
            translateX(var(--item-offset, 0px));
    }
    50% {
        transform: 
            translateY(-10px) 
            rotate(var(--item-rotation, 0deg)) 
            translateX(var(--item-offset, 0px));
    }
}

/* Close Hint */
.pretpot-close-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
    pointer-events: none;
    padding: 0 20px;
    z-index: 2;
}

.pretpot-falling-menu-overlay.active .pretpot-close-hint {
    opacity: 1;
    transition-delay: calc(var(--pretpot-stagger-delay, 100ms) * 4);
}

/* Glass style close hint */
.pretpot-glass-bg .pretpot-close-hint {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .pretpot-falling-menu-item,
    .pretpot-falling-menu-overlay,
    .pretpot-falling-menu-trigger {
        transition: none !important;
        animation: none !important;
    }
    
    .pretpot-falling-menu-overlay .pretpot-falling-menu-item {
        opacity: 1;
        transform: translateY(0) rotate(var(--item-rotation, 0deg)) translateX(var(--item-offset, 0px));
    }
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .pretpot-falling-menu-item {
        font-size: clamp(1.4rem, 5vw, 2.5rem);
        margin-bottom: -15px;
    }
    
    .pretpot-falling-menu-item.pretpot-size-small {
        font-size: 24px;
    }
    
    .pretpot-falling-menu-item.pretpot-size-medium {
        font-size: 38px;
    }
    
    .pretpot-falling-menu-item.pretpot-size-large {
        font-size: 50px;
    }
}

@media (max-width: 767px) {
    .pretpot-falling-menu-trigger {
        width: 45px;
        height: 45px;
    }
    
    .pretpot-falling-menu-trigger .pretpot-icon-bar {
        width: 18px;
    }
    
    .pretpot-falling-menu-item {
        font-size: clamp(1.2rem, 6vw, 2rem);
        margin-bottom: -10px;
    }
    
    .pretpot-falling-menu-item.pretpot-size-small {
        font-size: 20px;
        padding: 12px 35px;
    }
    
    .pretpot-falling-menu-item.pretpot-size-medium {
        font-size: 30px;
        padding: 15px 40px;
    }
    
    .pretpot-falling-menu-item.pretpot-size-large {
        font-size: 40px;
        padding: 20px 50px;
    }
    
    .pretpot-falling-menu-items {
        padding: 20px 15px;
    }
    
    .pretpot-close-hint {
        bottom: 20px;
        font-size: 0.8rem;
    }
}

/* Elementor Edit Mode Styles */
.elementor-editor-active .pretpot-falling-menu-overlay {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: 400px;
    opacity: 1;
    pointer-events: all;
    display: flex;
}

.elementor-editor-active .pretpot-falling-menu-item {
    opacity: 1;
    transform: translateY(0) rotate(var(--item-rotation, 0deg)) translateX(var(--item-offset, 0px));
}

/* Force body scroll lock when menu is open */
body.pretpot-falling-menu-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
}