/* Custom Popup Styles */
.custom-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity var(--animation-speed, 0.4s) ease-in-out;
}

.custom-popup-overlay.active {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    opacity: 1;
    padding-top: 20px;
}

#menu-popup-button.menu-hidden {
    display: none !important;
}

/* Menu button transformation when popup is active */
body.popup-active #menu-popup-button {
    transition: all var(--animation-speed, 0.4s) ease !important;
    z-index: 10003 !important; /* Higher than popup overlay (10000) and close button (10002) */
}

/* Close Button Styles */
.popup-close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white !important;
    border: none;
    color: #231F20 !important;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all var(--animation-speed, 0.4s) ease;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.popup-close-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.popup-close-button svg {
    width: 20px;
    height: 20px;
}

.custom-popup-overlay.active .custom-popup-content {
    margin-top: 0;
    margin-right: 15px;
}

.custom-popup-content {
    background-color: var(--popup-bg-color, #231F20);
    color: var(--popup-text-color, #ffffff);
    border-radius: 24px 24px 0 24px;
    padding: 40px;
    width: var(--popup-width, 44px);
    height: var(--popup-height, 44px);
    text-align: var(--content-alignment, center);
    position: relative;
    transition: all var(--animation-speed, 0.4s) ease-in-out;
    margin: 0 0 0 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: var(--content-alignment, center);
    transform-origin: top right;
    overflow: hidden;
}

.custom-popup-logo {
    padding: var(--logo-padding, 0px);
    margin-bottom: var(--logo-margin-bottom, 40px);
}

.custom-popup-logo img {
    max-width: 200px;
    height: auto;
    filter: brightness(0) invert(1); /* Makes the logo white */
}

.custom-popup-navigation {
    padding: var(--navigation-padding, 0px);
    margin-bottom: var(--navigation-margin-bottom, 40px);
}

.custom-popup-navigation a {
    display: block;
    color: var(--popup-text-color, #ffffff);
    text-decoration: none;
    font-size: 24px;
    font-weight: 600;
    margin: 15px 0;
    padding: 10px 0;
    transition: color var(--animation-speed, 0.4s) ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.custom-popup-navigation a:hover {
    color: #cccccc;
}

.custom-popup-social {
    display: flex;
    justify-content: center;
    gap: var(--social-gap, 20px);
    margin-top: var(--social-margin-top, 30px);
    padding: var(--social-padding, 0px);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--popup-text-color, #ffffff);
    text-decoration: none;
    font-size: 18px;
    transition: all var(--animation-speed, 0.4s) ease;
    position: relative;
}

.social-link svg {
    width: 26px !important;
    height: 26px !important;
    fill: white;
}

.elementor-screen-only {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.social-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.social-link.facebook:hover {
    background-color: #1877f2;
}

.social-link.instagram:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.social-link.twitter:hover {
    background-color: #1da1f2;
}

.social-link.linkedin:hover {
    background-color: #0077b5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-popup-content {
        padding: 30px 20px;
        width: 100% !important;
        height: 88vh;
        margin: 0 0 0 15px;
    }
    
    .custom-popup-logo img {
        max-width: 240px;
    }
    
    .custom-popup-navigation a {
        font-size: 22px;
        margin: 12px 0;
    }
    
    .social-link {
        width: 54px;
        height: 54px;
        font-size: 16px;
    }
    
    .social-link svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .custom-popup-content {
        padding: 25px 15px;
        height: 88vh;
        width: 100% !important;
        margin: 0 0 0 15px;
    }
    
    .custom-popup-logo img {
        max-width: 240px;
    }
    
    .custom-popup-navigation a {
        font-size: 22px;
        margin: 10px 0;
    }
    
    .social-link {
        width: 54px;
        height: 54px;
        font-size: 14px;
        gap: 15px;
    }
    
    .social-link svg {
        width: 16px;
        height: 16px;
    }
}

/* Animation for grow from square button to popup */
@keyframes growFromButton {
    0% {
        width: 46px;
        height: 46px;
        border-radius: 24px;
        margin-top: 0;
        margin-right: 15px;
        transform: scale(1);
    }
    30% {
        width: 200px;
        height: 46px;
        border-radius: 24px;
        margin-top: 0;
        margin-right: 15px;
        transform: scale(1);
    }
    60% {
        width: calc(100% - 30px);
        height: 46px;
        border-radius: 24px;
        margin-top: 0;
        margin-right: 15px;
        transform: scale(1);
    }
    100% {
        width: calc(100% - 30px);
        height: 88vh;
        border-radius: 24px;
        margin-top: 0;
        margin-right: 15px;
        transform: scale(1);
    }
}

/* Animation for shrink back to square button */
@keyframes shrinkToButton {
    0% {
        width: calc(100% - 30px);
        height: 88vh;
        border-radius: 24px;
        margin-top: 0;
        margin-right: 15px;
        transform: scale(1);
    }
    40% {
        width: calc(100% - 30px);
        height: 46px;
        border-radius: 24px;
        margin-top: 0;
        margin-right: 15px;
        transform: scale(1);
    }
    70% {
        width: 200px;
        height: 46px;
        border-radius: 24px;
        margin-top: 0;
        margin-right: 15px;
        transform: scale(1);
    }
    100% {
        width: 46px;
        height: 46px;
        border-radius: 24px;
        margin-top: 0;
        margin-right: 15px;
        transform: scale(1);
    }
}

/* Content fade out animation */
@keyframes fadeOutContent {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.custom-popup-overlay.active .custom-popup-content {
    animation: growFromButton var(--animation-speed, 0.4s) cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.custom-popup-overlay.closing .custom-popup-content {
    animation: shrinkToButton var(--animation-speed, 0.4s) cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.custom-popup-overlay.closing .custom-popup-logo,
.custom-popup-overlay.closing .custom-popup-navigation,
.custom-popup-overlay.closing .custom-popup-social,
.custom-popup-overlay.closing .popup-close-button {
    animation: fadeOutContent 0.2s ease-out forwards;
}

/* Hide content initially and show after container grows */
.custom-popup-logo,
.custom-popup-navigation,
.custom-popup-social,
.popup-close-button {
    opacity: 0;
    transition: opacity var(--animation-speed, 0.4s) ease-in-out;
}

.custom-popup-overlay.content-ready .custom-popup-logo,
.custom-popup-overlay.content-ready .custom-popup-navigation,
.custom-popup-overlay.content-ready .custom-popup-social,
.custom-popup-overlay.content-ready .popup-close-button {
    opacity: 1;
}

/* Prevent any flash after animation completes */
.custom-popup-overlay:not(.active):not(.closing) {
    display: none !important;
}

/* Body scroll lock when popup is active */
body.popup-active {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* Additional scroll lock for Elementor compatibility */
body.popup-active .elementor {
    overflow: hidden !important;
}

body.popup-active .elementor-page {
    overflow: hidden !important;
}

body.popup-active .elementor-location-header {
    overflow: hidden !important;
}

body.popup-active .elementor-location-footer {
    overflow: hidden !important;
}

/* Prevent scrolling on html element as well */
html.popup-active {
    overflow: hidden !important;
} 