/* Agent Dashboard Styles */

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container-fluid {
    height: calc(100vh - 56px);
}

.row {
    height: 100%;
}

/* Chat Sidebar */
.chat-sidebar {
    border-right: 1px solid #dee2e6;
    background-color: white;
}

.chat-list {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.chat-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.3s;
    position: relative;
}

.chat-item:hover {
    background-color: #f8f9fa;
}

.chat-item.active {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.chat-item.unread {
    background-color: #fff3cd;
}

.chat-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #28a745;
}

.chat-visitor-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.chat-last-message {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #6c757d;
}

.chat-time {
    white-space: nowrap;
}

.unread-badge {
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    min-width: 18px;
    text-align: center;
}

/* Chat Window */
.chat-window {
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    background-color: #f8f9fa;
    padding: 1rem;
}

.message {
    margin-bottom: 15px;
    display: flex;
    animation: fadeIn 0.3s ease-in;
}

.message.visitor {
    justify-content: flex-start;
}

.message.agent {
    justify-content: flex-end;
}

.message.system {
    justify-content: center;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.message.visitor .message-bubble {
    background-color: #e9ecef;
    color: #333;
    border-bottom-left-radius: 5px;
}

.message.agent .message-bubble {
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 5px;
}

.message.system .message-bubble {
    background-color: #fff3cd;
    color: #856404;
    border-radius: 10px;
    font-style: italic;
    font-size: 0.875rem;
    max-width: 90%;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 5px;
}

.message.visitor .message-time {
    text-align: left;
}

.message.agent .message-time {
    text-align: right;
}

.message.system .message-time {
    text-align: center;
}

/* Typing Indicator */
.typing-indicator {
    padding: 5px 0;
    font-style: italic;
}

.typing-dots {
    display: inline-block;
    animation: blink 1.4s infinite both;
}

.typing-dots:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0%, 80%, 100% {
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
}

/* Quick Responses */
.quick-response-btn {
    text-align: left;
    word-wrap: break-word;
    white-space: normal;
    height: auto;
    padding: 8px 12px;
}

/* Status indicators */
.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.status-online {
    background-color: #28a745;
}

.status-away {
    background-color: #ffc107;
}

.status-busy {
    background-color: #dc3545;
}

.status-offline {
    background-color: #6c757d;
}

/* Visitor Info Panel */
.visitor-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #f0f0f0;
}

.visitor-detail:last-child {
    border-bottom: none;
}

.visitor-detail strong {
    color: #333;
}

/* Statistics */
.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-sidebar {
        display: none;
    }
    
    .container-fluid {
        height: auto;
    }
    
    .chat-messages {
        max-height: 60vh;
    }
}

/* Form Controls */
.form-select:focus,
.form-control:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 10px;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 12px 15px;
    font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chat Input Enhancement */
#messageInput {
    border-right: none;
    padding-right: 40px;
}

.input-group .btn {
    border-left: none;
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar,
.chat-list::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.chat-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb,
.chat-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.chat-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
