/* Support Widget */
.support-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.support-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.4);
    transition: all 0.3s ease;
    position: relative;
    padding: 0;
    overflow: hidden;
}

.support-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(124, 58, 237, 0.6);
}

.support-button svg {
    width: 28px;
    height: 28px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    flex-shrink: 0;
}

.support-button .close-icon {
    display: none;
}

.support-button.active .chat-icon {
    display: none;
}

.support-button.active .close-icon {
    display: block;
}

.support-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid #07070a;
}

.support-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    height: 520px;
    background: #0c0c12;
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    z-index: 9998;
}

.support-window.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.support-header {
    padding: 20px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    display: flex;
    align-items: center;
    gap: 12px;
}

.support-header-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.support-header-icon svg {
    width: 24px;
    height: 24px;
}

.support-header-info {
    flex: 1;
}

.support-header-title {
    font-size: 16px;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
}

.support-header-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: rgba(16, 185, 129, 0.7);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.support-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.support-message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.support-message.user {
    align-self: flex-end;
}

.support-message.admin {
    align-self: flex-start;
}

.support-message-content {
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    margin-bottom: 4px;
}

.support-message.user .support-message-content {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
    border-bottom-right-radius: 4px;
}

.support-message.admin .support-message-content {
    background: #12121a;
    color: #f8fafc;
    border-bottom-left-radius: 4px;
}

.support-message-time {
    font-size: 11px;
    color: #64748b;
    padding: 0 8px;
}

.support-message.user .support-message-time {
    text-align: right;
}

.support-blocked-notice {
    padding: 16px;
    margin: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.support-blocked-icon {
    width: 40px;
    height: 40px;
    background: rgba(239, 68, 68, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.support-blocked-icon svg {
    width: 20px;
    height: 20px;
    stroke: #ef4444;
}

.support-blocked-text {
    font-size: 14px;
    color: #f8fafc;
    line-height: 1.5;
}

.support-welcome {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.support-welcome-icon {
    width: 64px;
    height: 64px;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.support-welcome-icon svg {
    width: 32px;
    height: 32px;
    color: #7c3aed;
}

.support-welcome h3 {
    font-size: 18px;
    color: #f8fafc;
    margin-bottom: 8px;
}

.support-welcome p {
    font-size: 14px;
    line-height: 1.6;
}

.support-input {
    padding: 16px;
    border-top: 1px solid rgba(124, 58, 237, 0.2);
    display: flex;
    gap: 12px;
    background: #07070a;
}

.support-input input {
    flex: 1;
    background: #12121a;
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 10px;
    padding: 12px 16px;
    color: #f8fafc;
    font-size: 14px;
    outline: none;
    font-family: 'Inter', sans-serif;
}

.support-input input::placeholder {
    color: #64748b;
}

.support-input input:focus {
    border-color: #7c3aed;
}

.support-send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.support-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
}

.support-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.support-send-btn svg {
    width: 20px;
    height: 20px;
}

/* Scrollbar */
.support-messages::-webkit-scrollbar {
    width: 6px;
}

.support-messages::-webkit-scrollbar-track {
    background: transparent;
}

.support-messages::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.3);
    border-radius: 3px;
}

.support-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 58, 237, 0.5);
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #12121a;
    border-radius: 12px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #64748b;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Admin Chat List */
.admin-chats-list {
    flex: 1;
    overflow-y: auto;
}

.admin-chat-item {
    padding: 16px;
    border-bottom: 1px solid rgba(124, 58, 237, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    gap: 12px;
    align-items: center;
}

.admin-chat-item:hover {
    background: rgba(124, 58, 237, 0.05);
}

.admin-chat-item.unread {
    background: rgba(124, 58, 237, 0.03);
}

.admin-chat-item.user-blocked {
    opacity: 0.85;
    border-left: 3px solid #ef4444;
}

.admin-chat-item.user-blocked .admin-chat-preview {
    color: #ef4444;
    font-weight: 600;
}

.admin-chat-item.chat-blocked {
    opacity: 0.85;
    border-left: 3px solid #f59e0b;
}

.admin-chat-item.chat-blocked .admin-chat-preview {
    color: #f59e0b;
    font-weight: 600;
}

.admin-chat-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.admin-chat-avatar.blocked {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.block-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
    stroke: #64748b;
}

.block-icon.user-block {
    stroke: #ef4444;
}

.block-icon-inline {
    width: 14px;
    height: 14px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
    stroke: currentColor;
}

.admin-chat-avatar-small {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: white;
}

.admin-chat-info {
    flex: 1;
    min-width: 0;
}

.admin-chat-name {
    font-weight: 600;
    font-size: 14px;
    color: #f8fafc;
    margin-bottom: 4px;
}

.admin-chat-preview {
    font-size: 13px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.admin-chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.admin-chat-time {
    font-size: 11px;
    color: #64748b;
}

.admin-chat-unread {
    background: #7c3aed;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.admin-back-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    margin-right: 8px;
}

.admin-back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.admin-back-btn svg {
    width: 20px;
    height: 20px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .support-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 120px);
        bottom: 80px;
        right: 16px;
    }
    
    .support-widget {
        bottom: 16px;
        right: 16px;
    }
}
