:root {
    --whatsapp-green: #128C7E;
    --whatsapp-light-green: #25D366;
    --whatsapp-blue: #34B7F1;
    --whatsapp-chat-bg: #E5DDD5;

        /* --whatsapp-sent-bg: #8BC34A;
        --whatsapp-received-bg: #D3D3D3; */

    --whatsapp-sent-bg: #CDE8B0;
    /* Vert clair adouci */
    --whatsapp-received-bg: #EAEAEA;
    /* Gris très doux */

}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    width: 100%;
    overflow-y: auto;
    /* overflow: hidden; */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
}

.app-container {
    /* position: fixed; */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    background-color: #0f172a !important;
}

/* Nouvelle barre latérale gauche */
.left-bar {
    width: 80px;
    background: #1e2a38;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    border-right: 1px solid #30445c;
}

.settings-container {
    position: absolute;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.left-bar-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2a3b4d;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #8b9aab;
    font-size: 15px;
}

.left-bar-item:hover {
    background: #3d536b;
    color: #fff;
}

.left-bar-item.active {
    background: #00a884;
    color: #fff;
}

.left-bar-item.logo {
    background: transparent;
    font-size: 28px;
    margin-bottom: 30px;
    color: #00a884;
}

/* Sidebar */
.sidebar {
    background-color: #0f172a;
    border-right: 1px solid #e0e0e0;
    /* width: 50%; */
    width: auto;
    min-width: 300px;
    max-width: 400px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    background-color: #090e1c;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.search-container {
    background-color: #fff;
    padding: 8px 15px;
}

.search-box {
    background-color: #f0f2f5;
    border-radius: 20px;
    padding: 5px 15px;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    padding: 5px;
}

.conversation-filters {
    display: flex;
    border-bottom: 1px solid #f0f2f5;
    padding: 0 15px;
}

.filter-tab {
    padding: 15px 0;
    margin: 0 15px;
    font-size: 15px;
    color: #666;
    cursor: pointer;
    position: relative;
}

.filter-tab.active {
    color: var(--whatsapp-green);
}

.filter-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--whatsapp-green);
}

.conversation-list {
    overflow-y: auto;
    flex-grow: 1;
}

.conversation {
    display: flex;
    padding: 10px 15px;
    cursor: pointer;
    /* border-bottom: 1px solid #f0f2f5; */
}

.conversation-top {
    display: flex;
    padding: 10px 15px;
    cursor: pointer;
}

.conversation:hover {
    background-color: #f5f5f5;
}

.conversation:hover .conversation-info .conversation-name {
    color: #0f172a;
}

.conversation.active {
    background-color: #ebebeb;
}

.conversation.active .conversation-info .conversation-name {
    color: #0f172a;
}

.conversation-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #888;
}

.conversation-avatar-top {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #888;
}

/* .conversation-info {
    flex-grow: 1;
    overflow: hidden;
} */
.conversation-info {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.conversation-name {
    font-weight: 500;
    margin-bottom: 3px;
    color: white;
}

.conversation-preview {
    color: #666;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 12px;
    color: #666;
}

.conversation-unread {
    background-color: var(--whatsapp-green);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-top: 5px;
}

/* Chat Area */
.chat-area {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background-color: var(--whatsapp-chat-bg);
    background-image:
        linear-gradient(rgba(229, 221, 213, 0.6), rgba(229, 221, 213, 0.6)),
        url("/images/OIP.jpg");
    background-repeat: repeat;
    /* ou no-repeat selon ton besoin */
    background-size: contain;
    /* ou cover pour remplir, or auto */
}

.chat-header {
    background-color: #ffffff;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    border-left: 1px solid #e0e0e0;
}

.chat-contact-info {
    flex-grow: 1;
}

.chat-contact-name {
    font-weight: 500;
    margin: 0;
}

.chat-status {
    font-size: 13px;
    color: #666;
}

.chat-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.message {
    max-width: 65%;
    padding: 8px 12px;
    margin-bottom: 10px;
    border-radius: 7.5px;
    position: relative;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.received {
    background-color: var(--whatsapp-received-bg);
    align-self: flex-start;
    border-top-left-radius: 0;
}

.sent {
    background-color: var(--whatsapp-sent-bg);
    align-self: flex-end;
    border-top-right-radius: 0;
}

.message-time {
    font-size: 11px;
    color: #999;
    text-align: right;
    margin-top: 2px;
}

.sent .message-time {
    color: #4a9c3f;
}

.message-status {
    margin-left: 5px;
    font-size: 12px;
}

.chat-footer {
    background-color: #f0f2f5;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-left: 1px solid #e0e0e0;
}

.emoji-btn,
.attach-btn {
    color: #666;
    font-size: 22px;
    margin: 0 5px;
    cursor: pointer;
}

.message-input {
    flex-grow: 1;
    background-color: white;
    border-radius: 20px;
    padding: 9px 15px;
    margin: 0 10px;
    border: none;
    outline: none;
}

.send-btn {
    background-color: var(--whatsapp-green);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Call section */
.call-section {
    background-color: #fff;
    border-left: 1px solid #e0e0e0;
    padding: 15px;
    width: 20%;
    min-width: 250px;
    display: none;
}

.call-section h6 {
    color: #666;
    font-weight: 500;
    margin-bottom: 15px;
}

.call-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
}

.call-info {
    margin-left: 15px;
    flex-grow: 1;
}

.call-time {
    font-size: 12px;
    color: #666;
}

.back-btn {
    display: none;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #0f172a;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.back-btn:hover {
    background-color: rgba(15, 23, 42, 0.08);
}

/* Responsive */
@media (max-width: 992px) {
    .left-bar {
        display: none;
    }

    .call-section {
        display: none !important;
    }

    .sidebar {
        width: 40%;
    }

    .chat-area {
        width: 60%;
    }
}

@media (max-width: 768px) {
    .message {
        max-width: 85%;
    }

    .message.pdf-template {
        max-width: unset !important;
    }

    .back-btn {
        display: inline-flex;
    }

    .sidebar {
        width: 100%;
        max-width: none;
        display: none;
    }

    .chat-area {
        width: 100%;
        display: none;
    }

    .sidebar.active {
        display: flex;
    }

    .chat-area.active {
        display: flex;
    }

    .mobile-header {
        display: flex;
    }
}

.mobile-header {
    display: none;
    background-color: var(--whatsapp-green);
    color: white;
    padding: 15px;
    justify-content: space-between;
    align-items: center;
}

.mobile-back-btn {
    color: white;
    font-size: 20px;
    margin-right: 15px;
    cursor: pointer;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.status-indicator {
    width: 10px;
    height: 10px;
    background-color: #4ad504;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.is-typing-spinner {
    width: .5rem !important;
    height: .5rem !important;
}

.cursor-pointer {
    cursor: pointer;
}
