/**
 * Quick Contact Button and Modal Styles (using keyframe animations for the button)
 */

 :root {
    --nomon-quick-contact-button-bg: #0073aa;
    --nomon-quick-contact-button-text: #ffffff;
    --nomon-quick-contact-modal-bg: #ffffff;
    --nomon-quick-contact-modal-text: #333333;
    --nomon-quick-contact-close-button: #333333;
}

/* Quick Contact Button */
.nomon-quick-contact-button {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%) translateX(0);
    background-color: var(--nomon-quick-contact-button-bg);
    color: var(--nomon-quick-contact-button-text);
    padding: 15px 10px;
    cursor: pointer;
    z-index: 1000;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    height: 180px; /* Increased height as requested */
    width: 40px; /* Fixed width for better browser support */
    box-sizing: border-box; /* Ensure padding doesn't affect dimensions */
    display: flex; /* Use flexbox for centering */
    align-items: center; /* Center content vertically */
    justify-content: center; /* Center content horizontally */
    transition: padding 0.3s ease, width 0.3s ease; /* Add transition for hover effect including width */

    /* Remove transition on the button — we use keyframes instead */
    /* transition: all 0.3s ease; */
}

.nomon-quick-contact-button span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nomon-quick-contact-button:hover {
    padding-left: 15px;
    padding-right: 5px; /* Adjust right padding to maintain center alignment */
    width: 50px; /* Increase width on hover */
}

/* KEYFRAMES: slide the button out (0 → 400px) and in (400px → 0) */
@keyframes slide-out {
    0% {
        transform: translateY(-50%) translateX(0);
    }
    100% {
        transform: translateY(-50%) translateX(400px);
    }
}
@keyframes slide-in {
    0% {
        transform: translateY(-50%) translateX(400px);
    }
    100% {
        transform: translateY(-50%) translateX(0);
    }
}

/* Utility classes to trigger the animations */
.nomon-quick-contact-button.slide-out {
    animation: slide-out 0.3s forwards ease;
}
.nomon-quick-contact-button.slide-in {
    animation: slide-in 0.3s forwards ease;
}


/* Quick Contact Modal */
.nomon-quick-contact-modal {
    position: fixed;
    left: 0; /* Start at 0 instead of -100% */
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden; /* Hide it properly */
    transition: opacity 0.3s ease, visibility 0.3s ease; /* fade in/out for the modal */
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.nomon-quick-contact-modal.active {
    opacity: 1;
    visibility: visible;
}

.nomon-quick-contact-modal-content {
    background-color: var(--nomon-quick-contact-modal-bg);
    color: var(--nomon-quick-contact-modal-text);
    width: 400px;
    height: auto;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);

    /* If you want the modal content to slide in from the left, leave these in */
    transform: translateX(-100%);
    transition: transform 0.3s ease; /* Slides the content in 0.3s */
}

.nomon-quick-contact-modal.active .nomon-quick-contact-modal-content {
    transform: translateX(0);
}

/* Close button inside modal */
.nomon-quick-contact-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--nomon-quick-contact-close-button);
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
}

/* Basic heading / text styles */
.nomon-quick-contact-modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--nomon-quick-contact-modal-text);
    font-size: 30px;
}

.nomon-quick-contact-text {
    margin-bottom: 30px;
    font-size: 15px;
}

.nomon-quick-contact-form {
    margin-top: 20px;
}

/* Iframe container styles */
#nomon-quick-contact-iframe-container {
    width: 100%;
    height: 400px;
    overflow: hidden;
    margin-bottom: 20px;
}

#nomon-quick-contact-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    overflow: hidden;
}

/* KEYFRAMES: slide the button from bottom (0 → 400px) and back (for mobile) */
@keyframes slide-up {
    0% {
        transform: translateY(0) translateX(-50%);
    }
    100% {
        transform: translateY(-400px) translateX(-50%);
    }
}
@keyframes slide-down {
    0% {
        transform: translateY(-400px) translateX(-50%);
    }
    100% {
        transform: translateY(0) translateX(-50%);
    }
}

/* Utility classes to trigger the mobile animations */
.nomon-quick-contact-button.slide-up {
    animation: slide-up 0.3s forwards ease;
}
.nomon-quick-contact-button.slide-down {
    animation: slide-down 0.3s forwards ease;
}

/* Responsive Styles */
@media (max-width: 768px) {
    /* Modal content styles */
    .nomon-quick-contact-modal-content {
        width: 100%;
        max-width: 100%;
        padding: 20px;
        transform: translateY(100%); /* Start from bottom */
        transition: transform 0.3s ease; /* Slides the content up 0.3s */
    }
    
    .nomon-quick-contact-modal.active .nomon-quick-contact-modal-content {
        transform: translateY(0); /* Slide up to visible */
    }
    
    /* Button repositioning for mobile */
    .nomon-quick-contact-button {
        left: 50%;
        top: auto;
        bottom: 0;
        transform: translateX(-50%) translateY(0);
        height: 40px; /* Swap height/width for horizontal orientation */
        width: 180px;
        border-top-left-radius: 5px;
        border-top-right-radius: 5px;
        border-bottom-right-radius: 0;
        border-bottom-left-radius: 0;
    }
    
    /* Change text orientation to horizontal */
    .nomon-quick-contact-button span {
        writing-mode: horizontal-tb;
        transform: none;
    }
    
    /* Completely remove hover effect for mobile devices */
    .nomon-quick-contact-button:hover {
        padding: 15px 10px; /* Reset to default padding */
        width: 180px; /* Keep width the same */
        height: 40px; /* Keep height the same */
        /* Ensure no transitions or animations on hover */
        transition: none;
    }
    
    /* Override desktop animations for mobile */
    @keyframes slide-out {
        0% {
            transform: translateX(-50%) translateY(0);
        }
        100% {
            transform: translateX(-50%) translateY(-400px);
        }
    }
    @keyframes slide-in {
        0% {
            transform: translateX(-50%) translateY(-400px);
        }
        100% {
            transform: translateX(-50%) translateY(0);
        }
    }
    
    /* Hide button when near footer */
    .nomon-quick-contact-button.hide-at-bottom {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    /* Adjust modal position for bottom-to-top animation */
    .nomon-quick-contact-modal {
        justify-content: center;
        align-items: flex-end;
    }
}
