/* WorldPressIT Chat - Frontend Styles */

#wpit-chat-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    z-index: 999999;
}

/* Chat Bubble */
.wpit-chat-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    color: white;
    z-index: 999999;
}

.wpit-chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.wpit-chat-bubble svg {
    width: 28px;
    height: 28px;
}

.wpit-chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
}

/* Welcome Card & Register Card */
.wpit-chat-card {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    z-index: 999998;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wpit-chat-card-header {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 0;
}

.wpit-chat-card-header h3 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
    text-align: left;
    flex: 1;
}

.wpit-chat-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #95a5a6;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    flex-shrink: 0;
}

.wpit-chat-close:hover {
    color: #2c3e50;
}

.wpit-chat-card-body {
    padding: 20px;
}

.wpit-chat-agent-info {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.wpit-chat-agent-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}

.wpit-chat-agent-details h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #2c3e50;
}

.wpit-chat-agent-status {
    color: #7f8c8d;
    font-size: 13px;
    margin: 0;
}

.wpit-chat-welcome-message {
    margin-bottom: 20px;
}

.wpit-chat-message-bubble {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: #2c3e50;
}

.wpit-chat-message-bubble p {
    margin: 0 0 10px 0;
}

.wpit-chat-message-bubble p:last-child {
    margin-bottom: 0;
}

.wpit-chat-start-btn {
    width: 100%;
    padding: 14px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.wpit-chat-start-btn:hover {
    background: #0056b3;
}

/* Registration Form */
.wpit-chat-register-intro {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 20px;
}

.wpit-chat-form-group {
    margin-bottom: 15px;
}

.wpit-chat-form-group label {
    display: block;
    margin-bottom: 5px;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
}

.wpit-chat-form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.wpit-chat-form-group input:focus {
    outline: none;
    border-color: #007bff;
}

.wpit-chat-submit-btn {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.wpit-chat-submit-btn:hover {
    background: #0056b3;
}

/* Chat Window */
.wpit-chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    z-index: 999998;
    animation: slideUp 0.3s ease;
}

.wpit-chat-window-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wpit-chat-agent-info-small {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wpit-chat-agent-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
}

.wpit-chat-agent-info-small h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.wpit-chat-status-indicator {
    font-size: 12px;
    opacity: 0.9;
}

.wpit-chat-window-actions {
    display: flex;
    gap: 10px;
}

.wpit-chat-minimize,
.wpit-chat-window .wpit-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 32px;
    text-align: center;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wpit-chat-minimize:hover,
.wpit-chat-window .wpit-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.wpit-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.wpit-chat-message {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

.wpit-chat-message.wpit-chat-message-user {
    flex-direction: row-reverse;
}

.wpit-chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.wpit-chat-message-content {
    max-width: 70%;
}

.wpit-chat-message-bubble-text {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.wpit-chat-message-agent .wpit-chat-message-bubble-text {
    background: white;
    color: #2c3e50;
    border-bottom-left-radius: 4px;
}

.wpit-chat-message-user .wpit-chat-message-bubble-text {
    background: #007bff;
    color: white;
    border-bottom-right-radius: 4px;
}

.wpit-chat-message-time {
    font-size: 11px;
    color: #95a5a6;
    margin-top: 4px;
    padding: 0 4px;
}

.wpit-chat-message-attachment {
    margin-top: 8px;
}

.wpit-chat-message-attachment a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    font-size: 13px;
    transition: background 0.2s;
}

.wpit-chat-message-attachment a:hover {
    background: rgba(0, 0, 0, 0.1);
}

.wpit-chat-input-area {
    border-top: 1px solid #e9ecef;
    background: white;
    border-radius: 0 0 12px 12px;
}

.wpit-chat-attachment-preview {
    padding: 10px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wpit-chat-attachment-name {
    font-size: 13px;
    color: #2c3e50;
}

.wpit-chat-remove-attachment {
    background: none;
    border: none;
    color: #95a5a6;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    line-height: 1;
}

.wpit-chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    padding: 12px 15px;
    gap: 8px;
}

.wpit-chat-attach-btn {
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.wpit-chat-attach-btn:hover {
    color: #2c3e50;
}

#wpit-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    font-family: inherit;
}

#wpit-chat-input:focus {
    outline: none;
    border-color: #007bff;
}

.wpit-chat-send-btn {
    background: #007bff;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.wpit-chat-send-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}

.wpit-chat-send-btn:hover {
    background: #0056b3;
}

.wpit-chat-send-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

/* Typing Indicator */
.wpit-chat-typing {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 14px;
    background: white;
    border-radius: 12px;
    width: fit-content;
}

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

.wpit-chat-typing-dot {
    width: 8px;
    height: 8px;
    background: #95a5a6;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.wpit-chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.wpit-chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

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

/* Title Animation */
@keyframes titleBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.wpit-chat-title-alert {
    animation: titleBlink 1s infinite;
}

/* Responsive */
@media (max-width: 480px) {
    .wpit-chat-card,
    .wpit-chat-window {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
    }
    
    .wpit-chat-window {
        height: calc(100vh - 40px);
        bottom: 20px;
    }
}
