/* PNG Metadata Viewer - Conversation Manager Styles */

/* Main container for chat with conversation sidebar */
.chat-container {
    display: flex;
    height: 100%;
    min-height: 500px;
    overflow: hidden;
    background-color: #222;
    color: #e0e0e0;
}

/* Left sidebar */
.chat-sidebar {
    width: 250px;
    border-right: 1px solid #444;
    display: flex;
    flex-direction: column;
    background-color: #1a1a1a;
}

/* Main chat area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Button container at top of sidebar */
.conversation-controls {
    padding: 10px;
    border-bottom: 1px solid #444;
    display: flex;
    gap: 5px;
}

/* New chat and save buttons */
.conversation-btn {
    flex: 1;
    padding: 8px;
    background: #333;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s;
}

.conversation-btn:hover {
    background: #444;
}

.conversation-btn:active {
    background: #555;
}

/* Container for conversations list */
.conversations-panel {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.conversations-panel h3 {
    margin-top: 0;
    font-size: 16px;
    color: #e0e0e0;
    margin-bottom: 10px;
    font-weight: normal;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

/* List of conversations */
.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Individual conversation item */
.conversation-item {
    padding: 8px;
    background: #333;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    border-left: 3px solid transparent;
    transition: background 0.2s, border-left-color 0.2s;
}

.conversation-item:hover {
    background: #444;
}

.conversation-item.active {
    border-left-color: #0073aa;
    background: #3a3a3a;
}

/* Title and date of conversation */
.conversation-title {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 3px;
    word-break: break-word;
    color: #e0e0e0;
}

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

/* Layout for conversation info */
.conversation-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* Action buttons container */
.conversation-actions {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Individual action buttons */
.conversation-actions button {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 2px;
    font-size: 14px;
    transition: color 0.2s;
}

.conversation-actions button:hover {
    color: #e0e0e0;
}

/* Status messages */
.loading-conversations, 
.no-conversations,
.conversation-error {
    padding: 15px 10px;
    text-align: center;
    color: #999;
    font-style: italic;
    background: #2a2a2a;
    border-radius: 3px;
    margin-top: 10px;
}

.loading-conversation {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
    background: #2a2a2a;
    border-radius: 3px;
    margin: 15px;
}

/* Chat message area */
#chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #222;
}

.chat-message {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
    word-wrap: break-word;
}

.chat-message.user {
    background-color: #164260;
    color: white;
    align-self: flex-end;
}

.chat-message.bot {
    background-color: #333;
    color: #e0e0e0;
    align-self: flex-start;
}

.chat-message.error {
    background-color: #5a2626;
    color: #ffcccc;
    border-left: 3px solid #a94442;
}

/* Chat input area */
#chat-input-row {
    padding: 10px;
    display: flex;
    gap: 10px;
    background-color: #1a1a1a;
    border-top: 1px solid #444;
}

#chat-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #444;
    border-radius: 3px;
    background-color: #333;
    color: #e0e0e0;
    resize: none;
    font-size: 14px;
    min-height: 40px;
    max-height: 150px;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: #0073aa;
    outline: none;
}

.chat-send-button {
    align-self: center;
    padding: 8px 15px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-send-button:hover {
    background-color: #0088cc;
}

.chat-send-button:disabled {
    background-color: #666;
    cursor: not-allowed;
}

/* Chat header */
#chat-header {
    padding: 10px 15px;
    background-color: #1a1a1a;
    border-bottom: 1px solid #444;
}

.chat-modal-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #e0e0e0;
}

.chat-description {
    font-size: 14px;
    color: #aaa;
}

/* Typing indicator */
.typing-indicator {
    color: #999;
    font-style: italic;
    padding: 5px 10px;
    margin: 10px 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }
    
    .chat-sidebar {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid #444;
    }
    
    .conversation-actions {
        flex-direction: row;
    }
}

/* Enhanced modal styling */
.png-modal-content.chat-mode {
    max-width: 900px;
    width: 90%;
    height: 80vh;
    max-height: 700px;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#png-modal {
    z-index: 9999;
}

/* Dashicons (for action buttons) */
.dashicons {
    font-family: dashicons;
    display: inline-block;
    line-height: 1;
    font-weight: 400;
    font-style: normal;
    speak: never;
    text-decoration: inherit;
    text-transform: none;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 20px;
    height: 20px;
    font-size: 20px;
    vertical-align: top;
    text-align: center;
    transition: color .1s ease-in;
}

.dashicons-visibility:before {
    content: "\f177";
}

.dashicons-trash:before {
    content: "\f182";
}
