/* Offer Chat Styles */

.offer-chat-container {
    position: fixed;
    top: 72px; /* Hauteur du header */
    right: 0;
    height: calc(100vh - 72px);
    z-index: 1000;
    display: flex;
    align-items: center;
    /* État fermé par défaut */
    transform: translateX(calc(100% - 60px));
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* État ouvert - quand le panel a la classe .open */
.offer-chat-container:has(.chat-panel.open) {
    transform: translateX(0);
}

/* Chat Toggle Button */
.chat-toggle-btn {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    background: #FCFCFC;
    color: #525252;
    border: none;
    cursor: pointer;
    border: 1px solid #E5E5E5;
    transition: all 0.3s ease;
    text-orientation: mixed;
    border-radius: 16px 0 0 16px;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 200px;
    z-index: 1001;
    width: 60px;
    display: flex;
    flex-direction: column;
}

.chat-toggle-text {
    writing-mode: sideways-lr;
    text-orientation: mixed;
    letter-spacing: 1px;
}

.chat-toggle-arrow {
    writing-mode: initial;
    font-size: 24px;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.unread-badge {
    background: #ef4444;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: initial;
    border: 2px solid white;
}

/* Chat Panel */
.chat-panel {
    width: 650px;
    height: 100%;
    background: white;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    margin-left: 60px; /* Espace pour le bouton à gauche */
}

/* Chat Tabs (multi-mode) */
.chat-tabs {
    display: flex;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    overflow-x: auto;
    flex-shrink: 0;
}

.chat-tabs::-webkit-scrollbar {
    height: 3px;
}

.chat-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.chat-tabs::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 2px;
}

.chat-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    white-space: nowrap;
    transition: all 0.2s ease;
}

.chat-tab:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.chat-tab.active {
    color: var(--green-600);
    border-bottom-color: var(--green-600);
    background: white;
}

.chat-tab-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-tab-badge {
    background: var(--red-500);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Chat Header */
.chat-header {
    padding: 16px;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.chat-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-logo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.chat-info h3 {
    margin: 0;
    color: var(--gray-900);
}

.chat-info p {
    margin: 4px 0 0 0;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-mark-read {
    background: var(--green-600);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-mark-read:hover {
    background: var(--green-700);
}

.chat-close-btn {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.chat-close-btn:hover {
    color: var(--gray-700);
    background: var(--gray-100);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--gray-25);
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 2px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Message Styles */
.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    align-self: flex-start;
}

.message-own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

/* Avatar column */
.message-avatar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-shrink: 0;
}

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

.message-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Message content column */
.message-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.message-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.message-sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
}

.message-time-header {
    font-size: 11px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.message-status {
    font-size: 11px;
    font-style: italic;
    color: var(--gray-500);
}

.message-content {
    background: #E5E5E5;
    padding: 12px 16px;
    border-radius: 8px;
    border-top-left-radius: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.message-own .message-content {
    background: var(--green-600);
    color: white;
    border-radius: 8px;
    border-top-right-radius: 0;
}

.message-text {
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

/* Message seen indicator */
.message-seen-indicator {
    font-size: 11px;
    color: var(--gray-500);
    text-align: right;
    padding: 4px 12px;
    font-style: italic;
    align-self: flex-end;
    margin-top: -8px;
    margin-bottom: 8px;
}

/* Empty State */
.chat-empty {
    text-align: center;
    padding: 40px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.chat-empty p {
    margin: 4px 0;
}

/* Chat Input */
.chat-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    border: 1px solid var(--gray-300);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    resize: none;
    outline: none;
    font-family: inherit;
    line-height: 1.5;
    max-height: 120px;
    height: 36px;
    overflow-y: auto;
    transition: height 0.1s ease;
    vertical-align: middle;
}

.chat-input:focus {
    border-color: var(--green-500);
    box-shadow: 0 0 0 1px var(--green-500);
}

.chat-send-btn {
    background: var(--green-600);
    color: white;
    border: none;
    border-radius: 12px;
    min-width: 36px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: var(--green-700);
}

.chat-send-btn .material-symbols-outlined {
    font-size: 20px;
}

.chat-send-btn:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}



/* Animation for chat panel - désactivée car gérée par le container */
/* .chat-panel {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
} */