/*
* Chat Page - Style épuré et moderne
* Design intégré à la page
*/

.chat-page-section {
    font-family: 'Public Sans', sans-serif;
    padding: 30px 0;
}

/* Tabs de chat */
.chat-tabs {
    display: flex;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.03);
}

.chat-tab {
    flex: 1;
    text-align: center;
    padding: 12px 10px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.chat-tab svg {
    width: 18px;
    height: 18px;
    stroke-width: 2px;
}

.chat-tab.active {
    background-color: #f9f5e1;
    color: #014d2b;
    font-weight: 600;
}

.chat-tab:not(.active):hover {
    background-color: rgba(249, 245, 225, 0.3);
    color: #333;
}

/* Conteneur de type de chat */
.chat-type-container {
    display: none;
}

.chat-type-container.active {
    display: block;
}

/* Notification dans le chat */
.chat-notification {
    text-align: center;
    padding: 10px 15px;
    margin: 15px 0;
    background-color: rgba(1, 77, 43, 0.05);
    border-radius: 8px;
    font-size: 13px;
    color: #666;
}

/* Styles spécifiques pour le chat vendeur */
.vendor-header {
    border-bottom-color: rgba(1, 77, 43, 0.15);
}

.vendor-avatar {
    background: #016d3e;
    border-color: #016d3e;
}

/* Styles spécifiques pour le chat bot */
.bot-header {
    border-bottom-color: rgba(1, 77, 43, 0.1);
}

.bot-status {
    background-color: #03A9F4;
}

.bot-avatar {
    background: #03A9F4;
    border-color: #03A9F4;
}

/* Sidebar */
.chat-sidebar {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    padding: 25px 20px;
    margin-bottom: 25px;
    height: calc(100% - 25px);
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #014d2b;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(1, 77, 43, 0.1);
}

.info-block {
    margin-bottom: 25px;
}

.info-block h4 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.info-block p {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.contact-icon, .status-icon {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    color: #014d2b;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-indicator.online {
    background-color: #4CAF50;
}

/* Main chat container */
.chat-page-container {
    display: flex;
    flex-direction: column;
    height: 180vh;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    position: relative;
}

/* Chat Header - Plus discret et intégré */
.chat-page-header {
    color: #014d2b;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(1, 77, 43, 0.1);
    position: relative;
    z-index: 10;
}

.chat-user-info {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 25px;
}

.chat-user-status {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background-color: #4CAF50;
    border-radius: 50%;
}

.chat-user-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #014d2b;
    letter-spacing: 0.3px;
}

.chat-user-info p {
    margin: 0;
    font-size: 13px;
    color: #666;
    margin-top: 3px;
}

.chat-header-actions {
    display: flex;
    gap: 15px;
}

.btn-action {
    background: none;
    border: none;
    color: #014d2b;
    padding: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-action:hover {
    background-color: rgba(1, 77, 43, 0.05);
}

.btn-action svg {
    width: 18px;
    height: 18px;
}

/* Chat Body */
.chat-page-body {
    flex: 1;
    background-color: #f9f5e1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(1, 77, 43, 0.05);
    border-right: 1px solid rgba(1, 77, 43, 0.05);
}

/* Scrollbar */
.chat-page-body::-webkit-scrollbar {
    width: 8px;
    opacity: 0;
    transition: all 0.3s ease;
}
.chat-page-body::-webkit-scrollbar-track {
    background: #f9f5e1;
}

/* Scrollbar thumb */
.chat-page-body::-webkit-scrollbar-thumb {
    background: #014d2b;
    border-radius: 4px;
}

/* Scrollbar invisible et visible selement lors du survol */
.chat-page-body:hover::-webkit-scrollbar {
    width: 8px;
}
.chat-page-body::-webkit-scrollbar-thumb:hover {
    background: #016d3e;
    width: 8px;
}




/* Chat date separator */
.chat-date-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 20px;
    position: relative;
    text-align: center;
}

.chat-date-separator span {
    background-color: #f9f5e1;
    padding: 0 15px;
    font-size: 13px;
    color: #888;
    position: relative;
    z-index: 1;
}

.chat-date-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: rgba(1, 77, 43, 0.1);
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

/* Message Styles */
.message {
    display: flex;
    max-width: 80%;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.message.agent {
    align-self: flex-start;
}

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

.avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: #014d2b;
    color: #f9f5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    border: 1px solid #014d2b;
    flex-shrink: 0;
}

.message.user .avatar {
    margin-right: 0;
    margin-left: 12px;
    background: #f9f5e1;
    border: 1px solid #014d2b;
    color: #014d2b;
}

.avatar svg {
    width: 18px;
    height: 18px;
}

.message-content {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    border: none;
    position: relative;
    max-width: 100%;
}

.message.agent .message-content {
    border-top-left-radius: 2px;
}

.message.user .message-content {
    background: #014d2b;
    color: #f9f5e1;
    border-top-right-radius: 2px;
    text-align: right;
}

.message-content p {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-content .time {
    font-size: 11px;
    color: #888;
    display: block;
    text-align: right;
    font-style: italic;
    margin-top: 5px;
}

.message.user .message-content .time {
    color: rgba(249, 245, 225, 0.8);
}

/* Product Recommendations in Chat */
.product-recommendations {
    width: 100%;
    margin: 15px 0;
    transition: all 0.4s ease;
}

.product-carousel {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: #014d2b #f9f5e1;
}

.product-carousel::-webkit-scrollbar {
    height: 4px;
}

.product-carousel::-webkit-scrollbar-track {
    background: rgba(1, 77, 43, 0.05);
    border-radius: 10px;
}

.product-carousel::-webkit-scrollbar-thumb {
    background-color: rgba(1, 77, 43, 0.3);
    border-radius: 10px;
}

.product-card {
    flex: 0 0 auto;
    width: 180px;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    border: 1px solid rgba(1, 77, 43, 0.1);
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.07);
}

.product-image {
    height: 100px;
    background: rgba(249, 245, 225, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(1, 77, 43, 0.05);
}

.product-image img {
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
}

.product-info {
    padding: 12px;
    flex: 1;
}

.product-info h5 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.product-price {
    font-weight: 600;
    color: #014d2b;
    font-size: 15px;
}

/* Suggestions in Chat */
.chat-suggestions {
    margin-top: auto;
    padding: 15px 0 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.suggestions-title {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    font-weight: 500;
}

.suggestion-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.suggestion-item {
    display: inline-block;
    background-color: #fff;
    color: #014d2b;
    padding: 8px 14px;
    border-radius: 30px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid rgba(1, 77, 43, 0.1);
    white-space: nowrap;
    user-select: none;
}

.suggestion-item:hover {
    background-color: rgba(1, 77, 43, 0.05);
    border-color: rgba(1, 77, 43, 0.3);
    transform: translateY(-1px);
}

/* Chat Footer */
.chat-page-footer {
    padding: 20px 30px;
    background-color: #fff;
    border-top: 1px solid rgba(1, 77, 43, 0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-input-container {
    display: flex;
    align-items: center;
    gap: 50px;
    transition: all 0.4s ease;
}

.chat-input-container:has(.chat-input:focus){
    gap: 15px;
}

.chat-input {
    flex: 1;
    border: 1px solid rgba(1, 77, 43, 0.2);
    border-radius: 30px;
    padding: 13px 18px;
    outline: none;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #f9f5e1;
    color: #333;
}

.chat-input:focus, .chat-input:hover {
    border-color: rgba(1, 77, 43, 0.4);
}

.send-btn {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 50%;
    background: #014d2b;
    color: #f9f5e1;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.send-btn:hover {
    background-color: #016d3e;
}

.send-btn svg {
    width: 18px;
    height: 18px;
}

.chat-actions-footer {
    display: flex;
    justify-content: flex-start;
    gap: 15px;
    padding-left: 10px;
}

.btn-attach, .btn-emoji {
    background: none;
    border: none;
    color: #014d2b;
    padding: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.btn-attach:hover, .btn-emoji:hover {
    opacity: 1;
}

.btn-attach svg, .btn-emoji svg {
    width: 18px;
    height: 18px;
}

/* Responsive styles */
@media (max-width: 991px) {
    .chat-page-container {
        height: 70vh;
    }

    .message {
        max-width: 85%;
    }

    .chat-input {
        padding: 12px 18px;
    }
}

@media (max-width: 767px) {
    .chat-page-section {
        padding: 15px 0;
    }

    .chat-page-container {
        height: 75vh;
        border-radius: 6px;
    }

    .chat-page-header, .chat-page-footer {
        padding: 15px 20px;
    }

    .chat-page-body {
        padding: 20px;
    }

    .message {
        max-width: 90%;
    }

    .avatar {
        width: 34px;
        height: 34px;
        min-width: 34px;
        margin-right: 10px;
    }

    .message.user .avatar {
        margin-left: 10px;
    }

    .message-content {
        padding: 12px 15px;
    }

    .send-btn {
        width: 42px;
        height: 42px;
        min-width: 42px;
    }

    .suggestion-item {
        padding: 7px 12px;
        font-size: 13px;
    }

    .chat-tab {
        padding: 10px 5px;
        font-size: 14px;
    }

    .chat-tab svg {
        width: 16px;
        height: 16px;
    }
}
