/* Y Chat History Plugin Styles */

/* Role Selector */
.ych-role-selector {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ych-role-selector h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.ych-role-options {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.ych-role-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    transition: all 0.3s ease;
    flex: 1;
}

.ych-role-option:hover {
    border-color: #007cba;
    background: #f8f9fa;
}

.ych-role-option input[type="radio"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.ych-role-option input[type="radio"]:checked + .ych-role-label {
    color: #007cba;
    font-weight: 600;
}

.ych-role-option:has(input[type="radio"]:checked) {
    border-color: #007cba;
    background: #f0f7ff;
}

.ych-role-label {
    font-size: 14px;
    color: #555;
    transition: color 0.3s ease;
}

.ych-role-save-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.ych-role-save-btn:hover {
    background: #005a87;
}

/* Chat Container */
.ych-chat-container {
    display: flex;
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: 600px;
    overflow: hidden;
}

/* Chat Header */
.ych-chat-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: #007cba;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.ych-chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.ych-chat-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ych-online-indicator {
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.ych-status-text {
    font-size: 12px;
    opacity: 0.9;
}

/* Conversations List */
.ych-conversations-list {
    width: 300px;
    border-right: 1px solid #e1e5e9;
    background: #f8f9fa;
    position: relative;
    padding-top: 60px;
}

.ych-conversations-list h4 {
    margin: 0;
    padding: 15px 20px;
    background: #f1f3f4;
    border-bottom: 1px solid #e1e5e9;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.ych-conversations-container {
    height: calc(100% - 60px);
    overflow-y: auto;
}

.ych-conversation-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e1e5e9;
    cursor: pointer;
    transition: background 0.3s ease;
    position: relative;
}

.ych-conversation-item:hover {
    background: #f0f7ff;
}

.ych-conversation-item.active {
    background: #e3f2fd;
    border-left: 3px solid #007cba;
}

.ych-conversation-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #007cba;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.ych-avatar-text {
    font-weight: 600;
    font-size: 16px;
}

.ych-conversation-details {
    flex: 1;
    min-width: 0;
}

.ych-conversation-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ych-conversation-last-message {
    color: #666;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.ych-conversation-time {
    color: #999;
    font-size: 11px;
}

.ych-unread-badge {
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    position: absolute;
    top: 10px;
    right: 10px;
}

.ych-no-conversations {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
}

/* Chat Messages */
.ych-chat-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-top: 60px;
}

.ych-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ych-message {
    display: flex;
    margin-bottom: 25px;
    align-items: flex-start;
    gap: 15px;
}

.ych-message-own {
    justify-content: flex-end;
}

.ych-message-other {
    justify-content: flex-start;
}

.ych-message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ych-avatar-text {
    font-weight: 500;
    font-size: 16px;
}

.ych-message-bubble-container {
    max-width: 75%;
    display: flex;
    flex-direction: column;
}

.ych-message-own .ych-message-bubble-container {
    align-items: flex-end;
}

.ych-message-other .ych-message-bubble-container {
    align-items: flex-start;
}

.ych-message-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #868e96;
    font-size: 12px;
}

.ych-message-own .ych-message-info {
    flex-direction: row-reverse;
}

.ych-message-time::before {
    content: '●';
    padding-right: 8px;
    font-size: 8px;
    color: #ced4da;
    vertical-align: middle;
}

.ych-sender-name {
    font-weight: 600;
    color: #495057;
}

.ych-message-status-icon {
    color: #20c997;
    font-size: 16px;
    font-weight: bold;
}

.ych-message-bubble {
    background: #f1f3f5;
    color: #212529;
    padding: 14px 20px;
    border-radius: 20px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.ych-message-own .ych-message-bubble {
    border-top-right-radius: 5px;
}

.ych-message-other .ych-message-bubble {
    border-top-left-radius: 5px;
}

.ych-no-messages {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
}

/* Message Input */
.ych-message-input {
    padding: 20px;
    background: white;
    border-top: 1px solid #e1e5e9;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#ych-message-text {
    flex: 1;
    border: 1px solid #e1e5e9;
    border-radius: 20px;
    padding: 12px 16px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    max-height: 100px;
    min-height: 44px;
}

#ych-message-text:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

#ych-send-message {
    background: #007cba;
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

#ych-send-message:hover {
    background: #005a87;
}

#ych-send-message::before {
    content: "→";
    font-size: 18px;
    font-weight: bold;
}

/* Notifications */
.ych-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
}

.ych-notification-success {
    background: #4caf50;
}

.ych-notification-error {
    background: #ff4757;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .ych-chat-container {
        flex-direction: column;
        height: 500px;
    }
    
    .ych-conversations-list {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid #e1e5e9;
    }
    
    .ych-conversations-container {
        height: calc(100% - 60px);
    }
    
    .ych-chat-messages {
        height: 300px;
    }
    
    .ych-role-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .ych-message-content {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .ych-chat-container {
        height: 400px;
    }
    
    .ych-conversations-list {
        height: 150px;
    }
    
    .ych-chat-messages {
        height: 250px;
    }
    
    .ych-message-input {
        padding: 15px;
    }
    
    .ych-messages-container {
        padding: 15px;
    }
}

/* Scrollbar Styling */
.ych-conversations-container::-webkit-scrollbar,
.ych-messages-container::-webkit-scrollbar {
    width: 6px;
}

.ych-conversations-container::-webkit-scrollbar-track,
.ych-messages-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ych-conversations-container::-webkit-scrollbar-thumb,
.ych-messages-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.ych-conversations-container::-webkit-scrollbar-thumb:hover,
.ych-messages-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
} 