/**
 * MyPodOps Studio - Real-Time Chat Panel Styles
 */

.chat-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-header h6 {
    font-weight: 600;
    margin: 0;
}

.chat-header button {
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    background: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.own-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    margin-left: 20%;
}

.chat-message.own-message .message-header strong,
.chat-message.own-message .message-header small {
    color: rgba(255, 255, 255, 0.9);
}

.chat-message.system-message {
    background: transparent;
    box-shadow: none;
    padding: 4px 0;
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.message-header strong {
    font-size: 13px;
    color: #333;
}

.message-header small {
    font-size: 11px;
    color: #999;
}

.message-text {
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    color: #333;
}

.chat-message.own-message .message-text {
    color: #fff;
}

.chat-input {
    display: flex;
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #e9ecef;
}

.chat-input input {
    flex: 1;
    border-radius: 20px;
    padding: 8px 16px;
    border: 1px solid #dee2e6;
}

.chat-input input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.chat-input button {
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.chat-input button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chat-footer {
    padding: 8px 16px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.chat-footer small {
    font-size: 11px;
}

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

.typing-indicator::after {
    content: '...';
    animation: ellipsis 1.5s infinite;
}

@keyframes ellipsis {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Unread messages badge */
.chat-unread-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.4);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-panel {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        height: 50vh;
        z-index: 1000;
        border-radius: 12px 12px 0 0;
    }

    .chat-body {
        padding: 12px;
    }

    .chat-message {
        font-size: 13px;
    }

    .chat-message.own-message {
        margin-left: 10%;
    }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .chat-panel {
        background: #1a1a2e;
    }

    .chat-body {
        background: #16213e;
    }

    .chat-message {
        background: #0f3460;
        color: #fff;
    }

    .message-header strong {
        color: #fff;
    }

    .message-header small {
        color: rgba(255, 255, 255, 0.6);
    }

    .message-text {
        color: rgba(255, 255, 255, 0.9);
    }

    .chat-input {
        background: #1a1a2e;
        border-top-color: #0f3460;
    }

    .chat-input input {
        background: #16213e;
        color: #fff;
        border-color: #0f3460;
    }

    .chat-footer {
        background: #1a1a2e;
        border-top-color: #0f3460;
    }
}

/* Scrollbar Styling */
.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}
