/* ========================================
   社保カツ事業相談所 - Chat Style (Cyan Theme)
   ======================================== */

#red-sales-chat-container {
    display: flex;
    height: 85vh;
    max-height: 800px;
    border: 1px solid #b2ebf2;
    border-radius: 12px;
    overflow: hidden;
    font-family: 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', sans-serif;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 188, 212, 0.10);
}

/* ---- Sidebar ---- */
#red-conversation-sidebar {
    width: 280px;
    background: #e0f7fa;
    border-right: 1px solid #b2ebf2;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#red-conversation-header {
    padding: 16px;
    border-bottom: 1px solid #b2ebf2;
}

.red-new-conversation-btn {
    width: 100%;
    padding: 10px 16px;
    background: #00acc1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.red-new-conversation-btn:hover {
    background: #00838f;
}

#red-conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.red-conversation-item {
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.red-conversation-item:hover {
    background: #b2ebf2;
}

.red-conversation-item.active {
    background: #b2ebf2;
    border-color: #00acc1;
}

.red-conversation-item .conv-title {
    font-size: 13px;
    font-weight: 600;
    color: #263238;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.red-conversation-item .conv-time {
    font-size: 11px;
    color: #78909c;
    margin-top: 2px;
}

.no-conversations {
    text-align: center;
    color: #90a4ae;
    font-size: 13px;
    padding: 24px 16px;
}

/* ---- Chat Area ---- */
#red-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#red-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #00acc1 0%, #26c6da 50%, #4dd0e1 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.red-header-icon {
    font-size: 22px;
}

/* ---- Messages ---- */
#red-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
}

.red-message {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

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

.red-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.red-message-role {
    font-size: 13px;
    font-weight: 700;
    color: #00838f;
}

.red-message.user .red-message-role {
    color: #546e7a;
}

.red-message-text {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.8;
    max-width: 100%;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.red-message.assistant .red-message-text {
    background: #fff;
    border: 1px solid #b2ebf2;
    border-left: 4px solid #00acc1;
    color: #37474f;
}

.red-message.user .red-message-text {
    background: #e0f7fa;
    border: 1px solid #b2ebf2;
    border-left: 4px solid #4dd0e1;
    color: #263238;
}

/* ---- Loading ---- */
.red-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: #e0f7fa;
    border-radius: 12px;
    font-size: 13px;
    color: #00838f;
    border: 1px solid #b2ebf2;
}

.red-loading-dots {
    display: flex;
    gap: 4px;
}

.red-loading-dots span {
    width: 6px;
    height: 6px;
    background: #00acc1;
    border-radius: 50%;
    animation: red-bounce 1.4s infinite ease-in-out;
}

.red-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.red-loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.red-loading-dots span:nth-child(3) { animation-delay: 0; }

@keyframes red-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ---- Input Area ---- */
#red-chat-input-area {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #b2ebf2;
    background: #fff;
}

#red-user-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #b2ebf2;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    height: 48px;
    max-height: 120px;
    outline: none;
    transition: border-color 0.2s;
}

#red-user-input:focus {
    border-color: #00acc1;
    box-shadow: 0 0 0 2px rgba(0, 172, 193, 0.15);
}

#red-send-button {
    padding: 12px 24px;
    background: #00acc1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

#red-send-button:hover {
    background: #00838f;
}

#red-send-button:disabled {
    background: #b2ebf2;
    cursor: not-allowed;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    #red-sales-chat-container {
        flex-direction: column;
        height: 90vh;
    }
    #red-conversation-sidebar {
        width: 100%;
        max-height: 150px;
        border-right: none;
        border-bottom: 1px solid #b2ebf2;
    }
}
