/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chat-bubble {
    width: 60px;
    height: 60px;
    background: #2a3240; /* Your brand color */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(42, 50, 64, 0.3);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

/* Dark mode - white background */
.dark-mode .chat-bubble,
body.dark .chat-bubble {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Light mode - brand color background */
.light-mode .chat-bubble,
body:not(.dark) .chat-bubble {
    background: #2a3240;
    box-shadow: 0 4px 20px rgba(42, 50, 64, 0.3);
}

.chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.chat-bubble svg {
    width: 24px;
    height: 24px;
    fill: white;
    transition: all 0.3s ease;
}

.chat-logo {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* Dark mode chat logo - white background, dark icon */
.dark-mode .chat-logo #chatGradient stop:first-child,
body.dark .chat-logo #chatGradient stop:first-child {
    stop-color: #2a3240 !important;
}

.dark-mode .chat-logo #chatGradient stop:last-child,
body.dark .chat-logo #chatGradient stop:last-child {
    stop-color: #303a4d !important;
}

.dark-mode .chat-logo circle,
body.dark .chat-logo circle {
    fill: #ff6b6b;
}

/* Light mode chat logo - dark background, white icon */
.light-mode .chat-logo #chatGradient stop:first-child,
body:not(.dark) .chat-logo #chatGradient stop:first-child {
    stop-color: #ffffff !important;
}

.light-mode .chat-logo #chatGradient stop:last-child,
body:not(.dark) .chat-logo #chatGradient stop:last-child {
    stop-color: #f8f9fa !important;
}

.light-mode .chat-logo circle,
body:not(.dark) .chat-logo circle {
    fill: #ff6b6b;
}

/* Message lines color */
.dark-mode .chat-logo path[fill="#2a3240"],
body.dark .chat-logo path[fill="#2a3240"] {
    fill: white !important;
}

.light-mode .chat-logo path[fill="#2a3240"],
body:not(.dark) .chat-logo path[fill="#2a3240"] {
    fill: #2a3240 !important;
}

.chat-box {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    max-width: calc(100vw - 40px);
    background: var(--bg-color, #ffffff);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color, #e2e8f0);
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-box.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.chat-header {
    background: linear-gradient(135deg, #2a3240 0%, #303a4d 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-close svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.chat-body {
    padding: 20px;
    color: var(--text-color, #2d3748);
    line-height: 1.6;
}

.chat-message {
    margin-bottom: 16px;
}


.chat-message a {
    color: var(--accent-color, #667eea);
    text-decoration: none;
    font-weight: 500;
}

.chat-message a:hover {
    text-decoration: underline;
}

.chat-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.chat-button {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    display: inline-block;
}

.chat-button-primary {
    background: var(--bg-secondary, #f7fafc);
    color: var(--text-color, #2d3748);
    border: 1px solid var(--border-color, #e2e8f0);
}

.chat-button-primary:hover {
    background: var(--bg-tertiary, #edf2f7);
    transform: translateY(-1px);
}

.chat-button-secondary {
    background: var(--bg-secondary, #f7fafc);
    color: var(--text-color, #2d3748);
    border: 1px solid var(--border-color, #e2e8f0);
}

.chat-button-secondary:hover {
    background: var(--bg-tertiary, #edf2f7);
}

/* Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), 0 0 0 10px rgba(102, 126, 234, 0.1);
    }
    100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(20px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(20px) scale(0.9);
        opacity: 0;
    }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .chat-widget {
        bottom: 15px;
        right: 15px;
    }

    .chat-bubble {
        width: 50px;
        height: 50px;
    }

    .chat-bubble svg {
        width: 20px;
        height: 20px;
    }

    .chat-box {
        width: calc(100vw - 30px);
        right: -15px;
    }

    .chat-actions {
        flex-direction: column;
    }
}

/* Dark mode support */
.dark-mode .chat-box {
    background: var(--bg-color, #2d3748);
    border-color: var(--border-color, #4a5568);
}

.dark-mode .chat-body {
    color: var(--text-color, #e2e8f0);
}

.dark-mode .chat-button-secondary {
    background: var(--bg-secondary, #4a5568);
    color: var(--text-color, #e2e8f0);
    border-color: var(--border-color, #4a5568);
}

.dark-mode .chat-button-secondary:hover {
    background: var(--bg-tertiary, #2d3748);
}
