/* ===== Support Widget - Compact Design ===== */
.support-widget {
    position: fixed;
    bottom: 80px;
    right: 25px;
    z-index: 9999;
    font-family: inherit;
}

/* Main Toggle Button */
.support-widget__toggle {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.support-widget__toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.support-widget__toggle i {
    font-size: 22px;
    color: #fff;
    transition: transform 0.3s ease;
}

.support-widget.active .support-widget__toggle i {
    transform: rotate(45deg);
}

/* Pulse Animation */
.support-widget__toggle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: pulse-ring 1.5s ease-out infinite;
    z-index: -1;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.support-widget.active .support-widget__toggle::before {
    animation: none;
}

/* Contact Menu - Compact Horizontal */
.support-widget__menu {
    position: absolute;
    bottom: 65px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(15px) scale(0.9);
    transition: all 0.25s ease;
}

.support-widget.active .support-widget__menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.support-widget__item {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    text-decoration: none;
    animation: fadeInUp 0.2s ease forwards;
    opacity: 0;
}

.support-widget.active .support-widget__item:nth-child(1) {
    animation-delay: 0.05s;
}

.support-widget.active .support-widget__item:nth-child(2) {
    animation-delay: 0.1s;
}

.support-widget.active .support-widget__item:nth-child(3) {
    animation-delay: 0.15s;
}

.support-widget.active .support-widget__item:nth-child(4) {
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Compact Icons */
.support-widget__icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.support-widget__icon:hover {
    transform: scale(1.12);
}

.support-widget__icon--phone {
    background: linear-gradient(135deg, #00c853, #00e676);
}

.support-widget__icon--facebook {
    background: linear-gradient(135deg, #1877f2, #42a5f5);
}

.support-widget__icon--zalo {
    background: linear-gradient(135deg, #0068ff, #00a3ff);
}

.support-widget__icon--chat {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* Tooltip Labels */
.support-widget__label {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(8px);
    transition: all 0.2s ease;
    pointer-events: none;
}

.support-widget__item:hover .support-widget__label {
    opacity: 1;
    transform: translateX(0);
}

/* Chat Box - Compact */
.support-widget__chatbox {
    position: fixed;
    bottom: 150px;
    right: 25px;
    width: 340px;
    max-height: 450px;
    background: rgba(25, 25, 40, 0.97);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
    animation: slideInUp 0.25s ease;
}

.support-widget__chatbox.active {
    display: flex;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header - Compact */
.chatbox__header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbox__header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbox__avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
}

.chatbox__name {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.chatbox__status {
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chatbox__status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #00e676;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink {

    0%,
    50%,
    100% {
        opacity: 1;
    }

    25%,
    75% {
        opacity: 0.4;
    }
}

.chatbox__close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s ease;
    padding: 5px;
}

.chatbox__close:hover {
    opacity: 1;
}

/* Chat Messages */
.chatbox__messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
    max-height: 250px;
}

.chatbox__messages::-webkit-scrollbar {
    width: 4px;
}

.chatbox__messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

.chatbox__messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.chat-message {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chat-message--user {
    align-self: flex-end;
}

.chat-message--ai {
    align-self: flex-start;
}

.chat-message__content {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.45;
    word-wrap: break-word;
}

.chat-message--user .chat-message__content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-message--ai .chat-message__content {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-bottom-left-radius: 4px;
}

.chat-message__time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
    padding: 0 4px;
}

.chat-message--user .chat-message__time {
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    width: fit-content;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-4px);
    }
}

/* Chat Input */
.chatbox__input-area {
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 8px;
    align-items: center;
}

.chatbox__input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 10px 16px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
}

.chatbox__input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.chatbox__input:focus {
    border-color: rgba(102, 126, 234, 0.4);
    background: rgba(255, 255, 255, 0.1);
}

.chatbox__send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chatbox__send:hover {
    transform: scale(1.08);
}

.chatbox__send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Responsive */
@media (max-width: 480px) {
    .support-widget {
        bottom: 85px;
        /* Increased to avoid bottom nav overlap */
        right: 15px;
    }

    .support-widget__chatbox {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: 155px;
        /* Adjusted for new widget position */
        max-height: 60vh;
        /* Reduced from 65vh for better fit */
    }

    .support-widget__toggle {
        width: 50px;
        height: 50px;
    }

    .support-widget__icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .support-widget__label {
        display: none;
    }

    /* Make sure menu doesn't overflow */
    .support-widget__menu {
        bottom: 60px;
    }
}