/**
 * ChatConnect PRO - Widget Styles
 */

:root {
    --ccp-primary: #25D366;
    --ccp-secondary: #128C7E;
    --ccp-text: #ffffff;
    --ccp-bg: #ffffff;
    --ccp-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --ccp-radius: 16px;
    --ccp-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Widget Container */
#ccp-widget-container {
    position: fixed;
    z-index: 999999;
    font-family: var(--ccp-font);
}

#ccp-widget-container.ccp-widget-bottom-right {
    bottom: 20px;
    right: 20px;
}

#ccp-widget-container.ccp-widget-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Widget Button */
#ccp-widget-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ccp-primary);
    color: var(--ccp-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--ccp-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#ccp-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

#ccp-widget-button svg {
    width: 28px;
    height: 28px;
}

/* Pulse Animation */
#ccp-widget-button.ccp-pulse::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ccp-primary);
    animation: ccp-pulse 2s infinite;
    z-index: -1;
}

@keyframes ccp-pulse {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Widget Panel */
#ccp-widget-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 340px;
    max-height: 480px;
    background: var(--ccp-bg);
    border-radius: var(--ccp-radius);
    box-shadow: var(--ccp-shadow);
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#ccp-widget-panel.ccp-hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* Widget Header */
#ccp-widget-header {
    background: var(--ccp-primary);
    color: var(--ccp-text);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 16px;
}

#ccp-widget-close {
    background: none;
    border: none;
    color: var(--ccp-text);
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#ccp-widget-close:hover {
    opacity: 1;
}

/* Channel List */
#ccp-widget-channels {
    padding: 16px;
    max-height: 340px;
    overflow-y: auto;
}

.ccp-channel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    text-decoration: none;
    color: #333;
}

.ccp-channel-item:hover {
    background: #eef0f2;
    transform: translateX(4px);
}

.ccp-channel-item:last-child {
    margin-bottom: 0;
}

.ccp-channel-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.ccp-channel-icon.whatsapp { background: #25D366; }
.ccp-channel-icon.messenger { background: #0084FF; }
.ccp-channel-icon.telegram { background: #0088CC; }
.ccp-channel-icon.livechat { background: #7C3AED; }

.ccp-channel-info {
    flex: 1;
}

.ccp-channel-name {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.ccp-channel-message {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

/* Agent Avatar */
.ccp-agent-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.ccp-agent-status {
    width: 12px;
    height: 12px;
    background: #4CAF50;
    border-radius: 50%;
    border: 2px solid white;
    position: absolute;
    bottom: 0;
    right: 0;
}

/* Live Chat Area */
#ccp-widget-livechat-area {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#ccp-widget-livechat-area.ccp-hidden {
    display: none;
}

.ccp-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8f9fa;
}

.ccp-chat-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.ccp-chat-message.visitor {
    background: var(--ccp-primary);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.ccp-chat-message.agent,
.ccp-chat-message.ai {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
}

.ccp-chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    background: white;
}

.ccp-chat-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.ccp-chat-input:focus {
    border-color: var(--ccp-primary);
}

.ccp-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ccp-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ccp-chat-send:hover {
    background: var(--ccp-secondary);
}

/* Typing Indicator */
.ccp-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.ccp-typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: ccp-typing 1.4s infinite;
}

.ccp-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.ccp-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ccp-typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #ccp-widget-panel {
        width: calc(100vw - 40px);
        right: 0;
        left: 0;
        margin: 0 auto;
    }
}
