/* Bready Chat Widget Styles */

/* Chat Button */
.bready-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B4513, #A0522D);
    color: white;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(139, 69, 19, 0.3);
    z-index: 9999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce-in 0.5s ease-out;
}

.bready-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(139, 69, 19, 0.4);
}

.bready-chat-button:active {
    transform: scale(0.95);
}

.bready-chat-button.has-notification::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    background: #ff4444;
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes bounce-in {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Chat Window */
.bready-chat-window {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.bready-chat-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Chat Header */
.bready-chat-header {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px 16px 0 0;
}

.bready-chat-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.bready-avatar {
    font-size: 1.5rem;
    animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

.bready-status {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.bready-status.online::before {
    content: '●';
    color: #4CAF50;
    margin-right: 0.25rem;
}

.bready-status.offline::before {
    content: '●';
    color: #f44336;
    margin-right: 0.25rem;
}

.bready-minimize-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: transform 0.2s;
}

.bready-minimize-btn:hover {
    transform: scale(1.2);
}

/* Chat Messages */
.bready-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #FFF8DC;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bready-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.bready-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.bready-chat-messages::-webkit-scrollbar-thumb {
    background: #8B4513;
    border-radius: 3px;
}

.bready-message {
    display: flex;
    gap: 0.5rem;
    animation: slide-in 0.3s ease-out;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bready-message.user {
    flex-direction: row-reverse;
}

.bready-message-avatar {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.bready-message-content {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    max-width: 75%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bready-message.user .bready-message-content {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    color: white;
}

.bready-message-content p {
    margin: 0;
    line-height: 1.5;
}

.bready-message-content pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0.5rem 0;
}

.bready-message.user .bready-message-content pre {
    background: rgba(255, 255, 255, 0.2);
}

/* Typing Indicator */
.bready-typing {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 12px;
    width: fit-content;
}

.bready-typing-dots {
    display: flex;
    gap: 4px;
}

.bready-typing-dot {
    width: 8px;
    height: 8px;
    background: #8B4513;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.bready-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.bready-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat Input */
.bready-chat-input {
    padding: 1rem;
    background: white;
    border-top: 1px solid #E6D7C3;
    display: flex;
    gap: 0.5rem;
}

.bready-input-field {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #E6D7C3;
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
}

.bready-input-field:focus {
    border-color: #8B4513;
}

.bready-send-btn {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bready-send-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.bready-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Welcome Screen */
.bready-welcome {
    text-align: center;
    padding: 2rem 1rem;
}

.bready-welcome-avatar {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: wave 2s ease-in-out infinite;
}

.bready-welcome h3 {
    font-family: 'Playfair Display', serif;
    color: #8B4513;
    margin-bottom: 0.5rem;
}

.bready-welcome p {
    color: #6B4423;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.bready-suggestions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.bready-suggestion-btn {
    background: white;
    border: 2px solid #E6D7C3;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    color: #6B4423;
    font-size: 0.9rem;
}

.bready-suggestion-btn:hover {
    border-color: #8B4513;
    background: #FFF8DC;
    transform: translateX(5px);
}

/* Error Message */
.bready-error {
    background: #ffebee;
    color: #c62828;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    margin: 1rem;
    border-left: 4px solid #c62828;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .bready-chat-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .bready-chat-window.open {
        transform: translateY(0);
    }

    .bready-chat-button {
        bottom: 15px;
        right: 15px;
    }

    .bready-message-content {
        max-width: 85%;
    }
}

/* Loading State */
.bready-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #8B4513;
}

.bready-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #E6D7C3;
    border-top-color: #8B4513;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
