/* ============================================================
   CHAT CONNECT PRO - CHAT WIDGET CSS
   ============================================================ */

/* Chat Container */
.ccp-chat-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

.ccp-bottom-right { bottom: 24px; right: 24px; }
.ccp-bottom-left { bottom: 24px; left: 24px; }

/* Toggle Button */
.ccp-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ccp-color, #4A90D9);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    position: relative;
}

.ccp-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.ccp-toggle-btn .ccp-online-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #27ae60;
    border: 2px solid #fff;
    border-radius: 50%;
}

/* Notification Badge */
.ccp-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #fff;
    animation: ccp-pulse 2s infinite;
}

@keyframes ccp-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Chat Window */
.ccp-chat-window {
    width: 380px;
    height: 520px;
    max-height: 80vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 72px;
    animation: ccp-slide-up 0.3s ease;
}

.ccp-bottom-left .ccp-chat-window {
    left: 0;
}

.ccp-bottom-right .ccp-chat-window {
    right: 0;
}

@keyframes ccp-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Chat Header */
.ccp-chat-header {
    background: var(--ccp-color, #4A90D9);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.ccp-chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ccp-agent-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

.ccp-agent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.ccp-agent-status {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    border: 2px solid var(--ccp-color, #4A90D9);
    border-radius: 50%;
}

.ccp-agent-status.ccp-online { background: #2ecc71; }
.ccp-agent-status.ccp-offline { background: #e74c3c; }

.ccp-chat-header-info h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.ccp-chat-subtitle {
    font-size: 11px;
    opacity: 0.85;
}

.ccp-chat-minimize {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.ccp-chat-minimize:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Auth Section */
.ccp-auth-section,
.ccp-guest-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
}

.ccp-auth-form {
    display: flex;
    flex-direction: column;
}

.ccp-auth-header,
.ccp-guest-header {
    text-align: center;
    padding: 20px 10px;
}

.ccp-auth-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ccp-color, #4A90D9);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 15px;
}

.ccp-auth-header h3,
.ccp-guest-header h3 {
    margin: 0 0 5px;
    font-size: 18px;
    color: #333;
}

.ccp-auth-header p,
.ccp-guest-header p {
    margin: 0;
    font-size: 13px;
    color: #888;
}

.ccp-auth-body,
.ccp-guest-body {
    padding: 0 10px;
}

.ccp-input-group {
    position: relative;
    margin-bottom: 12px;
}

.ccp-input-group > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 14px;
}

.ccp-input-group input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.ccp-input-group input:focus {
    border-color: var(--ccp-color, #4A90D9);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.ccp-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    padding: 4px;
}

.ccp-toggle-password:hover { color: #666; }

.ccp-auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 12px;
}

.ccp-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    cursor: pointer;
}

.ccp-checkbox input { cursor: pointer; }

.ccp-link {
    color: var(--ccp-color, #4A90D9);
    text-decoration: none;
    font-size: 12px;
}

.ccp-link:hover { text-decoration: underline; }

.ccp-auth-divider {
    text-align: center;
    margin: 16px 0;
    position: relative;
}

.ccp-auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.ccp-auth-divider span {
    background: #fff;
    padding: 0 12px;
    position: relative;
    color: #aaa;
    font-size: 12px;
}

.ccp-auth-error {
    background: #fde8e8;
    color: #e74c3c;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 12px;
    text-align: center;
}

.ccp-auth-success {
    background: #e8f8f0;
    color: #27ae60;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 12px;
    text-align: center;
}

/* Buttons */
.ccp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}

.ccp-btn-primary {
    background: var(--ccp-color, #4A90D9);
    color: #fff;
}

.ccp-btn-primary:hover {
    background: var(--ccp-color, #4A90D9);
    opacity: 0.9;
    transform: translateY(-1px);
}

.ccp-btn-outline {
    background: transparent;
    color: var(--ccp-color, #4A90D9);
    border: 1px solid var(--ccp-color, #4A90D9);
}

.ccp-btn-outline:hover {
    background: var(--ccp-color, #4A90D9);
    color: #fff;
}

.ccp-btn-full {
    width: 100%;
}

.ccp-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

.ccp-btn-lg {
    padding: 12px 28px;
    font-size: 16px;
}

.ccp-btn-danger {
    background: #e74c3c;
    color: #fff;
}

.ccp-btn-danger:hover { opacity: 0.9; }

/* Messages Area */
.ccp-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f5f7fa;
}

.ccp-messages-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ccp-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: ccp-msg-in 0.3s ease;
}

@keyframes ccp-msg-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ccp-message-visitor {
    background: var(--ccp-color, #4A90D9);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ccp-message-admin {
    background: #fff;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ccp-message-bot {
    background: #e8f4fd;
    color: #2c3e50;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border-left: 3px solid var(--ccp-color, #4A90D9);
}

.ccp-message-time {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
    display: block;
}

.ccp-message-visitor .ccp-message-time {
    color: rgba(255, 255, 255, 0.7);
    text-align: right;
}

/* Typing Indicator */
.ccp-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    align-self: flex-start;
}

.ccp-typing-dots {
    display: flex;
    gap: 4px;
}

.ccp-typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #bbb;
    animation: ccp-typing-bounce 1.4s infinite;
}

.ccp-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.ccp-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ccp-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

.ccp-typing small {
    font-size: 11px;
    color: #999;
}

/* Chat Input Area */
.ccp-chat-input-area {
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.ccp-input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.ccp-btn-icon {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: color 0.2s;
}

.ccp-btn-icon:hover { color: var(--ccp-color, #4A90D9); }

.ccp-file-name {
    font-size: 11px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ccp-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ccp-message-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.ccp-message-input:focus {
    border-color: var(--ccp-color, #4A90D9);
}

.ccp-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ccp-color, #4A90D9);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ccp-send-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* User Bar */
.ccp-user-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
}

.ccp-user-bar span {
    color: #666;
}

.ccp-btn-logout {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.ccp-btn-logout:hover {
    background: #fde8e8;
}

/* Scrollbar */
.ccp-messages-area::-webkit-scrollbar {
    width: 5px;
}

.ccp-messages-area::-webkit-scrollbar-track {
    background: transparent;
}

.ccp-messages-area::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 480px) {
    .ccp-chat-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 120px);
        bottom: 72px;
        right: -12px;
    }

    .ccp-bottom-left .ccp-chat-window {
        left: -12px;
    }
}
