/* MacDesk AI Support Widget Styling */
:root {
    --chat-primary: #0a84ff;
    --chat-primary-hover: #0071e3;
    --chat-bg: rgba(28, 28, 30, 0.95);
    --chat-card-bg: rgba(44, 44, 46, 0.85);
    --chat-text: #ffffff;
    --chat-subtext: #8e8e93;
    --chat-border: rgba(255, 255, 255, 0.12);
}

.macdesk-chat-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #0a84ff 0%, #0056b3 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(10, 132, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.macdesk-chat-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 30px rgba(10, 132, 255, 0.55);
}

.macdesk-chat-btn .icon {
    font-size: 18px;
}

.macdesk-chat-modal {
    position: fixed;
    bottom: 84px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 120px);
    background: var(--chat-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--chat-border);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.macdesk-chat-modal.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(44, 44, 46, 0.6);
    border-bottom: 1px solid var(--chat-border);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-avatar {
    width: 34px;
    height: 34px;
    background: #0a84ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.chat-title-group h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #30d158;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #30d158;
    border-radius: 50%;
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.chat-close-btn {
    background: none;
    border: none;
    color: var(--chat-subtext);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}

.chat-close-btn:hover {
    color: #ffffff;
}

.chat-chips {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    overflow-x: auto;
    scrollbar-width: none;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--chat-border);
}

.chat-chips::-webkit-scrollbar {
    display: none;
}

.chat-chip {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 5px 10px;
    font-size: 11px;
    color: #e5e5ea;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-chip:hover {
    background: rgba(10, 132, 255, 0.25);
    border-color: #0a84ff;
    color: #ffffff;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
}

.chat-bubble.assistant {
    align-self: flex-start;
    background: var(--chat-card-bg);
    color: #ffffff;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-bubble.user {
    align-self: flex-end;
    background: var(--chat-primary);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.chat-bubble code {
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: ui-monospace, Menlo, Monaco, monospace;
    font-size: 11px;
}

.chat-bubble pre {
    background: rgba(0, 0, 0, 0.5);
    padding: 8px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 6px 0;
}

.chat-bubble pre code {
    background: none;
    padding: 0;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: var(--chat-card-bg);
    border-radius: 14px;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #8e8e93;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.chat-input-area {
    padding: 12px 14px;
    background: rgba(44, 44, 46, 0.6);
    border-top: 1px solid var(--chat-border);
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 8px 14px;
    color: #ffffff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--chat-primary);
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    background: var(--chat-primary);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-send-btn:hover {
    background: var(--chat-primary-hover);
    transform: scale(1.05);
}
