/* Fluent Community Live Chat Styles */

.chatflow-container {
    max-width: 80%;
    margin: 0 auto;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 800px;
    position: relative;
}

/* Header */
.chatflow-header {
    background: #2B2E33;
    color: #fff !important;
    padding: 20px;
    border-bottom: 1px solid ##585858;
}

.chatflow-title {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff !important;
}

.chatflow-icon {
    font-size: 24px;
}

.chatflow-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    opacity: 0.9;
    color: #fff !important;
}

.chatflow-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #000 !important;
    margin-right: 8px;
}

.chatflow-status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
}

.chatflow-form-container .chatflow-status {
    color: #000 !important;
}

.chatflow-header .chatflow-notice {
    opacity: 0.9;
}

.chatflow-form-container .chatflow-notice {
    text-align: center;
    font-size: 14px;
    color: #000;
    padding: 4px 0;
}

.chatflow-notice-asterisk {
    color: #dc2626;
    margin-right: 4px;
}

/* Messages Container */
.chatflow-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
    scroll-behavior: smooth;
}

.chatflow-messages::-webkit-scrollbar {
    width: 8px;
}

.chatflow-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.chatflow-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 0;
}

.chatflow-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Loading State */
.chatflow-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 12px;
    color: #64748b;
}

.chatflow-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: #334155;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.chatflow-empty {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.chatflow-empty p {
    font-size: 16px;
    margin: 0;
}

/* Error State */
.chatflow-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 12px;
    border-left: 3px solid #dc2626;
}

.chatflow-error p {
    margin: 0;
    font-size: 14px;
}

/* Message */
.chatflow-message {
    margin-bottom: 16px;
}

.chatflow-avatar {
    display: none;
}

.chatflow-message-content {
    width: 100%;
}

.chatflow-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.chatflow-username {
    font-weight: 600;
    color: #64748b;
    font-size: 12px;
}

.chatflow-time {
    font-size: 11px;
    color: #94a3b8;
}

.chatflow-message-text {
    background: #fff;
    padding: 12px 14px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
    word-wrap: break-word;
}

/* Current User Message */
.chatflow-message-current .chatflow-message-text {
    background: #334155;
    color: #fff;
    border-color: #334155;
}

.chatflow-message-current .chatflow-username {
    color: #334155;
}

/* Form Container */
.chatflow-form-container {
    padding: 16px 20px 12px 20px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

.chatflow-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chatflow-input-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chatflow-input-wrapper {
    flex: 1;
    position: relative;
}

.chatflow-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    transition: border-color 0.2s;
    height: 44px;
    max-height: 120px;
    overflow-y: auto;
    box-sizing: border-box;
}

.chatflow-input:focus {
    outline: none;
    border-color: #334155;
}

.chatflow-char-count {
    position: absolute;
    right: 0;
    bottom: 0;
    font-size: 11px;
    color: #94a3b8;
}

.chatflow-char-warning {
    color: #f59e0b;
    font-weight: 600;
}

.chatflow-send-btn {
    padding: 10px 24px;
    background: #1E293B;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    flex-shrink: 0;
    white-space: nowrap;
    box-sizing: border-box;
}

.chatflow-send-btn:hover:not(:disabled) {
    background: #475569;
}

.chatflow-send-btn:active:not(:disabled) {
    background: #0f172a;
}

.chatflow-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatflow-send-btn.chatflow-sending {
    pointer-events: none;
    opacity: 0.7;
}

.chatflow-send-icon {
    font-size: 16px;
}

/* New Message Indicator */
.chatflow-new-indicator {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: #334155;
    color: #fff;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    z-index: 10;
}

.chatflow-new-indicator:hover {
    background: #475569;
}

/* Login Required */
.chatflow-login-required {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px;
    text-align: center;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.chatflow-login-required p {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 20px;
}

.chatflow-login-required .button {
    display: inline-block;
    padding: 12px 32px;
    background: #1e293b;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.chatflow-login-required .button:hover {
    background: #334155;
}

/* Online Count */
.chatflow-online-count {
    font-size: 11px;
    opacity: 0.9;
    margin-right: 8px;
    color: #000 !important;
}

.chatflow-form-container .chatflow-online-count {
    color: #000 !important;
}

/* Typing Indicator */
.chatflow-typing-indicator {
    padding: 8px 12px;
    color: #64748b;
    font-size: 13px;
    font-style: italic;
}

/* Message Reactions */
.chatflow-reactions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.chatflow-reaction {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.chatflow-reaction:hover {
    background: #e2e8f0;
}

.chatflow-reaction.has-reacted {
    background: #334155;
    color: #fff;
    border-color: #334155;
}

/* Reaction Buttons */
.chatflow-reaction-buttons {
    display: none;
    gap: 4px;
    margin-top: 6px;
}

.chatflow-message:hover .chatflow-reaction-buttons {
    display: flex;
}

.chatflow-react-btn {
    padding: 4px 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.chatflow-react-btn:hover {
    background: #e2e8f0;
    transform: scale(1.2);
}

/* Admin Actions */
.chatflow-admin-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.chatflow-message:hover .chatflow-admin-actions {
    opacity: 1;
}

.chatflow-delete-btn {
    padding: 4px 8px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.chatflow-delete-btn:hover {
    background: #fecaca;
}

.chatflow-message {
    position: relative;
}

/* File Upload */
.chatflow-file-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s ease;
    border-radius: 4px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.chatflow-file-btn:hover {
    background: rgba(51, 65, 85, 0.1);
    border-color: #334155;
}

.chatflow-file-preview {
    position: relative;
    display: inline-block;
    border-radius: 4px;
    overflow: hidden;
    max-width: 200px;
    border: 2px solid #e2e8f0;
}

.chatflow-file-preview img {
    max-width: 200px;
    height: 150px;
    object-fit: cover;
    display: block;
    border-radius: 2px;
}

.chatflow-remove-file {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s ease;
}

.chatflow-remove-file:hover {
    background: rgba(220, 38, 38, 0.9);
}

.chatflow-attachment {
    margin-bottom: 8px;
    border-radius: 4px;
    overflow: hidden;
    max-width: 300px;
}

.chatflow-attachment img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.chatflow-attachment img:hover {
    transform: scale(1.02);
}

/* Responsive */
@media (max-width: 768px) {
    .chatflow-container {
        height: calc(100vh - 60px);
        border-radius: 0;
        max-width: 100%;
    }

    .chatflow-header {
        padding: 12px 16px;
    }

    .chatflow-title {
        font-size: 16px;
    }

    .chatflow-icon {
        font-size: 18px;
    }

    .chatflow-messages {
        padding: 12px;
    }

    .chatflow-message-text {
        font-size: 14px;
        padding: 10px 12px;
    }

    .chatflow-form-container {
        padding: 8px 12px;
    }

    .chatflow-input-row {
        gap: 8px;
    }

    .chatflow-input {
        font-size: 14px;
        padding: 10px 12px;
    }

    .chatflow-file-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .chatflow-send-text {
        display: none;
    }

    .chatflow-send-btn {
        padding: 0;
        width: 40px;
        height: 40px;
        justify-content: center;
    }

    .chatflow-send-icon {
        font-size: 18px;
    }

    .chatflow-info {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        font-size: 12px;
    }

    .chatflow-file-preview img {
        max-width: 150px;
        height: 120px;
    }

    .chatflow-attachment {
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .chatflow-container {
        height: 100vh;
        border: none;
    }

    .chatflow-messages {
        padding: 8px;
    }

    .chatflow-message {
        margin-bottom: 12px;
    }

    .chatflow-username {
        font-size: 11px;
    }

    .chatflow-time {
        font-size: 10px;
    }
}
