/* NSIYO Chat Styles */
.nsiyo-chat-container {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    height: 600px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.nsiyo-chat-login-required {
    padding: 40px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Conversations List */
.nsiyo-chat-conversations-list {
    width: 300px;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.nsiyo-chat-conversations-list h3 {
    padding: 15px;
    margin: 0;
    border-bottom: 1px solid #e0e0e0;
    background: #f5f5f5;
    font-size: 16px;
    font-weight: 600;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.conversation-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
}

.conversation-item:hover {
    background: #f9f9f9;
}

.conversation-item.active {
    background: #e8f4f8;
}

.conv-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
}

.conv-info {
    flex: 1;
    min-width: 0;
}

.conv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.conv-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.conv-time {
    font-size: 11px;
    color: #999;
}

.conv-preview {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    padding-right: 25px;
}

.you-label {
    color: #999;
    font-style: italic;
}

.unread-badge {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #ff4444;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

/* Chat Window */
.nsiyo-chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    background: #f9f9f9;
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-user-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.user-online-indicator {
    width: 10px;
    height: 10px;
    background: #4caf50;
    border-radius: 50%;
    display: inline-block;
    margin-left: 5px;
}

/* Messages Container */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
}

.chat-message {
    display: flex;
    margin-bottom: 15px;
    gap: 10px;
}

.message-sent {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.message-content {
    max-width: 70%;
    position: relative;
}

.message-sent .message-content {
    align-items: flex-end;
}

.message-sender {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

.message-text {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message-sent .message-text {
    background: #007bff;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-received .message-text {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.message-time {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    text-align: right;
}

.message-sent .message-time {
    text-align: left;
}

/* Chat Input */
.chat-input-container {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    background: white;
}

.chat-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
}

.chat-input:focus {
    outline: none;
    border-color: #007bff;
}

.chat-send-btn {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-send-btn:hover:not(:disabled) {
    background: #0056b3;
}

.chat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Select User State */
.nsiyo-chat-select-user {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 16px;
}

/* Loading & Error States */
.loading, .error {
    padding: 40px;
    text-align: center;
    color: #999;
}

.error {
    color: #ff4444;
}

.no-conversations {
    padding: 40px;
    text-align: center;
    color: #999;
}

/* Responsive */
@media (max-width: 768px) {
    .nsiyo-chat-container {
        flex-direction: column;
        height: auto;
        max-height: 600px;
    }
    
    .nsiyo-chat-conversations-list {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        max-height: 200px;
    }
    
    .message-content {
        max-width: 85%;
    }
}


