/* ===================================
   CHAT WIDGET - Glacier Store
   Widget de chat moderne et responsive
   =================================== */

:root {
    --chat-primary: #25D366;
    --chat-primary-hover: #20BA5A;
    --chat-dark: #075E54;
    --chat-bg: #ECE5DD;
    --chat-white: #FFFFFF;
    --chat-text: #303030;
    --chat-text-light: #667781;
    --chat-bubble-user: #E7FFDB;
    --chat-bubble-agent: #FFFFFF;
    --chat-shadow: rgba(0, 0, 0, 0.15);
    --chat-shadow-lg: rgba(0, 0, 0, 0.25);
}

/* ===================================
   CHAT BUTTON (Floating)
   =================================== */

.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.chat-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--chat-shadow-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    animation: pulse-chat 2s infinite;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--chat-shadow-lg);
}

.chat-button i {
    font-size: 28px;
    color: var(--chat-white);
}

.chat-button.active i.fa-whatsapp {
    display: none;
}

.chat-button.active i.fa-times {
    display: block;
}

.chat-button i.fa-times {
    display: none;
}

/* Notification badge - Désactivé */
.chat-badge {
    display: none !important;
}

.chat-badge.show {
    display: none !important;
}

@keyframes pulse-chat {
    0%, 100% {
        box-shadow: 0 4px 12px var(--chat-shadow-lg);
    }
    50% {
        box-shadow: 0 4px 12px var(--chat-shadow-lg), 0 0 0 10px rgba(37, 211, 102, 0.1);
    }
}

@keyframes bounce-in {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* ===================================
   CHAT WINDOW
   =================================== */

.chat-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    height: 600px;
    background: var(--chat-white);
    border-radius: 16px;
    box-shadow: 0 12px 48px var(--chat-shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    animation: slide-up 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-window.show {
    display: flex;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   CHAT HEADER
   =================================== */

.chat-header {
    background: linear-gradient(135deg, var(--chat-dark) 0%, var(--chat-primary) 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--chat-white);
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--chat-white);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.chat-avatar i {
    font-size: 24px;
    color: var(--chat-primary);
}

.chat-header-info {
    flex: 1;
}

.chat-header-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.chat-header-status {
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: #4ADE80;
    border-radius: 50%;
    animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ===================================
   CHAT MESSAGES
   =================================== */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--chat-bg);
    background-image:
        linear-gradient(45deg, rgba(0, 0, 0, 0.02) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(0, 0, 0, 0.02) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.02) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.02) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Welcome message */
.chat-welcome {
    text-align: center;
    padding: 20px;
    margin-bottom: 20px;
}

.chat-welcome-icon {
    width: 80px;
    height: 80px;
    background: var(--chat-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 4px 12px var(--chat-shadow);
}

.chat-welcome-icon i {
    font-size: 36px;
    color: var(--chat-primary);
}

.chat-welcome h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--chat-text);
    margin: 0 0 8px 0;
}

.chat-welcome p {
    font-size: 14px;
    color: var(--chat-text-light);
    margin: 0;
    line-height: 1.5;
}

/* Message bubble */
.chat-message {
    display: flex;
    margin-bottom: 12px;
    animation: fade-in 0.3s ease;
}

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

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.agent {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.chat-message.user .message-bubble {
    background: var(--chat-bubble-user);
    color: var(--chat-text);
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-message.agent .message-bubble {
    background: var(--chat-bubble-agent);
    color: var(--chat-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-time {
    font-size: 11px;
    color: var(--chat-text-light);
    margin-top: 4px;
    display: block;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: var(--chat-bubble-agent);
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    max-width: 60px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--chat-text-light);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-10px);
    }
}

/* ===================================
   CHAT INPUT
   =================================== */

.chat-input-container {
    padding: 16px;
    background: var(--chat-white);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #E5E5E5;
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    min-height: 44px;
    line-height: 1.5;
    transition: border-color 0.2s;
}

.chat-input:focus {
    outline: none;
    border-color: var(--chat-primary);
}

.chat-input::placeholder {
    color: var(--chat-text-light);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    background: var(--chat-primary);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    background: var(--chat-primary-hover);
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    background: #CCC;
    cursor: not-allowed;
}

.chat-send-btn i {
    font-size: 18px;
    color: var(--chat-white);
}

/* ===================================
   QUICK REPLIES
   =================================== */

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.quick-reply-btn {
    padding: 8px 16px;
    background: var(--chat-white);
    border: 1px solid #E5E5E5;
    border-radius: 20px;
    font-size: 13px;
    color: var(--chat-text);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background: var(--chat-primary);
    color: var(--chat-white);
    border-color: var(--chat-primary);
    transform: translateY(-2px);
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 480px) {
    .chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-width: 100vw;
        max-height: 100vh;
    }

    .chat-widget {
        bottom: 16px;
        right: 16px;
    }

    .chat-button {
        width: 56px;
        height: 56px;
    }

    .chat-button i {
        font-size: 26px;
    }
}

/* ===================================
   UTILITY CLASSES
   =================================== */

.hidden {
    display: none !important;
}

.show {
    display: flex !important;
}
