/**
 * SonnetVPN Chat Widget Styles - Space Theme (Black & White)
 */

/* Widget Container */
.sonnet-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Toggle Button */
.sonnet-chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.sonnet-chat-toggle:hover {
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 255, 255, 0.1);
}

.sonnet-chat-toggle svg {
    width: 26px;
    height: 26px;
}

.sonnet-chat-icon-close {
    display: none;
}

.sonnet-chat-widget.open .sonnet-chat-icon-open {
    display: none;
}

.sonnet-chat-widget.open .sonnet-chat-icon-close {
    display: block;
}

/* Chat Window */
.sonnet-chat-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 48px);
    height: 480px;
    max-height: calc(100vh - 150px);
    background: rgba(0, 0, 0, 0.92);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8), 0 0 60px rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
}

.sonnet-chat-widget.open .sonnet-chat-window {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.sonnet-chat-header {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sonnet-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sonnet-chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    background: #000;
}

.sonnet-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sonnet-chat-title {
    font-weight: 600;
    color: white;
    font-size: 15px;
    letter-spacing: 0.3px;
}

.sonnet-chat-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

.sonnet-chat-minimize {
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sonnet-chat-minimize:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.sonnet-chat-minimize svg {
    width: 14px;
    height: 14px;
}

/* Messages */
.sonnet-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sonnet-chat-message {
    display: flex;
}

.sonnet-chat-message-user {
    justify-content: flex-end;
}

.sonnet-chat-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.sonnet-chat-message-bot .sonnet-chat-bubble {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
}

.sonnet-chat-message-user .sonnet-chat-bubble {
    background: white;
    color: #000;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.sonnet-chat-typing {
    display: flex;
    gap: 5px;
    padding: 14px 18px;
}

.sonnet-chat-typing span {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.sonnet-chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.sonnet-chat-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(1);
        opacity: 0.4;
    }

    40% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* Form */
.sonnet-chat-form {
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.sonnet-chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.sonnet-chat-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.sonnet-chat-input:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.sonnet-chat-input:disabled {
    opacity: 0.5;
}

.sonnet-chat-send {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: white;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sonnet-chat-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.sonnet-chat-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.sonnet-chat-send svg {
    width: 18px;
    height: 18px;
}

/* Scrollbar */
.sonnet-chat-messages::-webkit-scrollbar {
    width: 5px;
}

.sonnet-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.sonnet-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.sonnet-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Mobile */
@media (max-width: 480px) {
    .sonnet-chat-widget {
        bottom: 16px;
        right: 16px;
    }

    .sonnet-chat-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        bottom: 65px;
        right: 0;
    }

    .sonnet-chat-toggle {
        width: 50px;
        height: 50px;
    }
}