.contact-box {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    gap: 15px;
}

    .contact-box .message-bubble {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
        padding: 15px 25px;
        border-radius: 20px 20px 0 20px;
        color: var(--text-light);
        font-size: 0.95rem;
        font-weight: 500;
        box-shadow: 0 10px 25px rgba(var(--primary-color-rgb), 0.2);
        transform: translateX(30px);
        opacity: 0;
        transition: all 0.4s ease;
        position: relative;
    }

[data-is-scrolled="true"] .contact-box.show .message-bubble {
    transform: translateX(0);
    opacity: 1;
}

.contact-box .message-bubble::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: -10px;
    width: 20px;
    height: 20px;
    background: var(--primary-color-dark);
    clip-path: polygon(0 0, 0% 100%, 100% 100%);
}

.contact-box .toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(var(--primary-color-rgb), 0.2);
    transition: all 0.3s ease;
    position: relative;
}

    .contact-box .toggle-btn:hover {
        transform: translateY(-5px);
    }

    .contact-box .toggle-btn i {
        font-size: 1.5rem;
        color: var(--text-light);
    }

.contact-popup {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 320px;
    background: var(--card-bg);
    border-radius: 25px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1), 0 0 0 1px rgba(var(--primary-color-rgb), 0.05);
    padding: 25px;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 9998;
}

    .contact-popup.active {
        transform: translateY(0) scale(1);
        opacity: 1;
        visibility: visible;
    }

    .contact-popup .popup-header {
        text-align: center;
        margin-bottom: 20px;
        position: relative;
        padding-bottom: 15px;
    }

        .contact-popup .popup-header::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 60px;
            height: 3px;
            background: linear-gradient(90deg, var(--primary-color), var(--primary-color-dark));
            border-radius: 2px;
        }

        .contact-popup .popup-header h4 {
            font-size: 1.4rem;
            color: var(--text-dark);
            margin-bottom: 5px;
        }

        .contact-popup .popup-header p {
            font-size: 0.9rem;
            color: var(--text-dark-low);
        }

    .contact-popup .contact-options {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .contact-popup .contact-option {
        padding: 15px;
        border-radius: 15px;
        background: var(--bg-color);
        display: flex;
        align-items: center;
        gap: 15px;
        transition: all 0.3s ease;
        cursor: pointer;
    }

        .contact-popup .contact-option:hover {
            background: var(--primary-color);
            transform: translateX(5px);
        }

        .contact-popup .contact-option i {
            font-size: 1.3rem;
            color: var(--primary-color);
            transition: all 0.3s ease;
        }

        .contact-popup .contact-option:hover i {
            color: var(--text-light);
        }

        .contact-popup .contact-option .option-content h5 {
            font-size: 1rem;
            color: var(--text-dark);
            margin-bottom: 3px;
            transition: all 0.3s ease;
        }

        .contact-popup .contact-option:hover .option-content h5 {
            color: var(--text-light);
        }

        .contact-popup .contact-option .option-content p {
            font-size: 0.85rem;
            color: var(--text-dark-low);
            transition: all 0.3s ease;
        }

        .contact-popup .contact-option:hover .option-content p {
            color: var(--text-light-low);
        }

        .contact-popup .contact-option.urgent {
            background: linear-gradient(135deg, #cf2626, var(--secondary-color-dark) );
            border: 1px solid rgba(255,255,255,0.1);
            position: relative;
            overflow: hidden;
        }

            .contact-popup .contact-option.urgent::before {
                content: '';
                position: absolute;
                inset: 0;
                background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent );
                animation: urgentGlow 2s linear infinite;
            }

@keyframes urgentGlow {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.contact-popup .contact-option.urgent i,
.contact-popup .contact-option.urgent .option-content h5,
.contact-popup .contact-option.urgent .option-content p {
    color: var(--text-light);
}

.contact-popup .contact-option.urgent:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #d63a3a, var(--secondary-color-dark) );
    box-shadow: 0 10px 20px rgba(var(--secondary-color-rgb), 0.2);
}

@media (max-width: 576px) {
    .contact-box {
        bottom: 20px;
        right: 20px;
    }

    .contact-popup {
        width: calc(100% - 40px);
        bottom: 90px;
        right: 20px;
    }
}


@media screen and (max-width: 1400px) {
    .contact-box {
        bottom: 25px;
        right: 25px;
    }

        .contact-box .toggle-btn {
            width: 55px;
            height: 55px;
        }

            .contact-box .toggle-btn i {
                font-size: 1.3rem;
            }

    .contact-popup {
        width: 300px;
        bottom: 90px;
        right: 25px;
        padding: 20px;
    }

        .contact-popup .contact-option {
            padding: 12px;
        }
}

@media screen and (max-width: 991px) {
    .contact-box {
        bottom: 25px;
        right: 25px;
    }

        .contact-box .toggle-btn {
            width: 65px;
            height: 65px;
        }

            .contact-box .toggle-btn i {
                font-size: 1.6rem;
            }

        .contact-box .message-bubble {
            display: none;
        }

    .contact-popup {
        width: 280px;
        bottom: 85px;
        right: 20px;
    }

        .contact-popup .popup-header h4 {
            font-size: 1.2rem;
        }

        .contact-popup .popup-header p {
            font-size: 0.85rem;
        }

        .contact-popup .contact-option i {
            font-size: 1.2rem;
        }

        .contact-popup .contact-option .option-content h5 {
            font-size: 0.95rem;
        }

        .contact-popup .contact-option .option-content p {
            font-size: 0.8rem;
        }
}

@media screen and (max-width: 768px) {
    .contact-box .toggle-btn {
        width: 60px;
        height: 60px;
    }

        .contact-box .toggle-btn i {
            font-size: 1.5rem;
        }

    .contact-popup {
        width: calc(100% - 40px);
        max-width: 320px;
        padding: 20px;
    }

        .contact-popup .contact-option {
            padding: 12px;
            gap: 12px;
        }
}

@media screen and (max-width: 576px) {
    .contact-box {
        bottom: 20px;
        right: 20px;
    }

        .contact-box .toggle-btn {
            width: 55px;
            height: 55px;
            box-shadow: 0 8px 20px rgba(var(--primary-color-rgb), 0.2);
        }

            .contact-box .toggle-btn i {
                font-size: 1.4rem;
            }

    .contact-popup {
        bottom: 85px;
        width: calc(100% - 40px);
        bottom: 90px;
        right: 20px;
    }

        .contact-popup .popup-header {
            margin-bottom: 15px;
            padding-bottom: 12px;
        }

            .contact-popup .popup-header h4 {
                font-size: 1.1rem;
            }

        .contact-popup .contact-options {
            gap: 8px;
        }

        .contact-popup .contact-option {
            padding: 10px;
            border-radius: 12px;
        }
}

@media screen and (max-width: 400px) {
    .contact-box {
        bottom: 15px;
        right: 15px;
    }

        .contact-box .toggle-btn {
            width: 48px;
            height: 48px;
            box-shadow: 0 5px 15px rgba(var(--primary-color-rgb), 0.15);
        }

            .contact-box .toggle-btn i {
                font-size: 1.2rem;
            }

    .contact-popup {
        width: calc(90% - 30px);
        bottom: 75px;
        right: 15px;
        padding: 15px;
        border-radius: 15px;
    }

        .contact-popup .popup-header {
            margin-bottom: 12px;
            padding-bottom: 10px;
        }

            .contact-popup .popup-header h4 {
                font-size: 1rem;
            }

            .contact-popup .popup-header p {
                font-size: 0.75rem;
            }

        .contact-popup .contact-options {
            gap: 6px;
        }

        .contact-popup .contact-option {
            padding: 8px 10px;
            border-radius: 10px;
            gap: 8px;
        }

            .contact-popup .contact-option i {
                font-size: 1rem;
            }

            .contact-popup .contact-option .option-content h5 {
                font-size: 0.85rem;
                margin-bottom: 1px;
            }

            .contact-popup .contact-option .option-content p {
                font-size: 0.7rem;
            }
}

@media screen and (max-width: 360px) {
    .contact-box .toggle-btn {
        width: 52px;
        height: 52px;
    }

        .contact-box .toggle-btn i {
            font-size: 1.3rem;
        }
}


@media screen and (max-height: 700px) {
    .contact-popup {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }

        .contact-popup::-webkit-scrollbar {
            width: 5px;
        }

        .contact-popup::-webkit-scrollbar-thumb {
            background: var(--primary-color);
            border-radius: 5px;
        }
}


@media (hover: none) {
    .contact-box .toggle-btn:hover {
        transform: none;
    }

    .contact-popup .contact-option:hover {
        transform: none;
    }
}


@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .contact-box {
        padding-bottom: env(safe-area-inset-bottom);
    }
}
