/* Chat Widget Styles */
:root {
    --chat-primary: #D4AF37;
    --chat-primary-hover: #B8941F;
    --chat-bg: #ffffff;
    --chat-text: #1a1a1a;
    --chat-border: #E5E5E5;
    --chat-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    --chat-secondary: #F8F9FA;
}

.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chat-primary);
    border: none;
    cursor: pointer;
    box-shadow: var(--chat-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.chat-button:hover {
    background: var(--chat-primary-hover);
    transform: scale(1.05);
}

.chat-button svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.chat-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.chat-bubble-notification {
    position: absolute;
    bottom: 75px;
    right: 0;
    background: white;
    border: 1px solid var(--chat-border);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    width: 260px;
    display: none;
    animation: slideInBounce 0.5s ease;
}

.chat-bubble-notification.active {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.chat-bubble-notification::after {
    content: '';
    position: absolute;
    bottom: -7px;
    right: 24px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid white;
}

.chat-bubble-notification::before {
    content: '';
    position: absolute;
    bottom: -9px;
    right: 23px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--chat-border);
}

.chat-bubble-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--chat-border);
    padding: 4px;
    flex-shrink: 0;
}

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

.chat-bubble-content {
    flex: 1;
    min-width: 0;
}

.chat-bubble-message {
    font-size: 14px;
    color: var(--chat-text);
    line-height: 1.5;
    word-wrap: break-word;
}

@keyframes slideInBounce {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    50% {
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: var(--chat-bg);
    border-radius: 16px;
    box-shadow: var(--chat-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-window.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

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

.chat-header {
    background: var(--chat-primary);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
}

.chat-message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
}

.chat-message.admin {
    flex-direction: row;
}

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

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: var(--chat-secondary);
    border: 2px solid var(--chat-border);
}

.chat-message.admin .chat-avatar {
    background: white;
    padding: 4px;
}

.chat-message.admin .chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.chat-message.user .chat-avatar {
    background: var(--chat-primary);
    color: white;
    font-weight: 600;
}

.chat-message-content {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

.chat-message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.admin .chat-message-bubble {
    background: white;
    color: var(--chat-text);
    border-bottom-left-radius: 4px;
}

.chat-message.user .chat-message-bubble {
    background: var(--chat-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    padding: 0 4px;
}

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

.chat-input-form {
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--chat-border);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

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

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

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

.chat-send-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

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

/* Mobile responsive */
@media (max-width: 480px) {
    .chat-widget {
        bottom: 16px;
        right: 16px;
    }
    
    .chat-window {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: calc(100vh - 60px);
        border-radius: 16px 16px 0 0;
        z-index: 10000;
    }
    
    .chat-button {
        width: 52px;
        height: 52px;
    }
    
    .chat-button svg {
        width: 24px;
        height: 24px;
    }
    
    .chat-bubble-notification {
        right: -8px;
        width: 240px;
    }
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
