/* Chat Takeover Panel Styles - Right Slide Out */

.chat-takeover-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.chat-takeover-modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 500px;
    max-width: 90vw;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease-out;
    overflow: hidden;
}

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

/* Header */
.chat-takeover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.chat-header-left {
  display: flex;
    align-items: center;
    gap: 1rem;
}

.chat-agent-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    padding: 3px;
  overflow: hidden;
}

.chat-agent-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.agent-avatar-placeholder {
    width: 44px;
  height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.chat-header-info h3 {
    margin: 0;
    font-size: 1.2rem;
font-weight: 600;
}

.chat-subtitle {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.chat-header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-icon {
display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
 color: white;
    border-radius: 6px;
cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-icon:hover {
background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-close {
    padding: 0.5rem;
}

/* System Message */
.chat-system-message {
    padding: 0.75rem 1.5rem;
    background: #fff3cd;
    border-bottom: 1px solid #ffc107;
    color: #856404;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Chat Body */
.chat-takeover-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f8f9fa;
    display: flex;
 flex-direction: column;
    gap: 1rem;
}

.chat-takeover-body::-webkit-scrollbar {
    width: 8px;
}

.chat-takeover-body::-webkit-scrollbar-track {
    background: #e9ecef;
}

.chat-takeover-body::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.chat-loading,
.chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6c757d;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
 margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-small {
    border: 2px solid #f3f3f3;
    border-top: 2px solid white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

.chat-empty-state .e-icons {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* Messages */
.chat-message {
    display: flex;
 gap: 0.75rem;
    align-items: flex-start;
    animation: slideInMessage 0.3s ease-out;
}

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

.chat-message.agent-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
}

.message-avatar img {
  width: 100%;
  height: 100%;
    object-fit: cover;
}

.agent-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.message-content {
    max-width: 75%;
    display: flex;
    flex-direction: column;
gap: 0.25rem;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-sender {
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
}

.message-time {
    font-size: 0.7rem;
    color: #6c757d;
}

.message-text {
    padding: 0.75rem 1rem;
    border-radius: 12px;
  font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.customer-message .message-text {
    background: white;
    border: 1px solid #dee2e6;
    color: #212529;
}

.agent-message .message-text {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    color: white;
}

.message-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: #ffc107;
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 3px;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

/* Footer */
.chat-takeover-footer {
    padding: 1rem 1.5rem;
    background: white;
    border-top: 1px solid #dee2e6;
    display: flex;
flex-direction: column;
 gap: 0.75rem;
    flex-shrink: 0;
}

.chat-mode-notice {
  padding: 0.75rem 1rem;
    background: #e7f3ff;
  border: 1px solid #b3d9ff;
    border-radius: 6px;
    color: #0066cc;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-input-disabled {
    display: flex;
    gap: 0.75rem;
    opacity: 0.6;
}

.chat-input-disabled input,
.chat-input-disabled button {
    cursor: not-allowed !important;
}

.chat-input-container {
    display: flex;
    gap: 0.75rem;
  align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: none;
    min-height: 60px;
    max-height: 120px;
  transition: all 0.2s;
}

.chat-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-send {
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    height: 60px;
}

.btn-send:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-send:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-takeover-unlock {
  padding: 0.75rem 1.5rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-takeover-unlock:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .chat-takeover-modal {
        width: 100vw;
  max-width: 100vw;
    }

    .chat-takeover-header {
        padding: 1rem;
    }

  .chat-header-info h3 {
        font-size: 1.1rem;
  }

    .chat-takeover-body {
        padding: 1rem;
    }

    .chat-takeover-footer {
        padding: 0.75rem 1rem;
    }

    .message-content {
        max-width: 85%;
    }
}
