/* Customer Service Component Styles */

/* Custom scrollbar for chat messages */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* Typing indicator animation */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

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

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

@keyframes typing {
    0%,
    80%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Chat message styles */
.chat-message {
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.chat-message.user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 18px 18px 4px 18px;
    margin-left: auto;
}

.chat-message.agent {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #334155;
    border-radius: 18px 18px 18px 4px;
    border: 1px solid #e2e8f0;
}

/* Floating button animation */
.customer-service-btn {
    animation: gentle-float 3s ease-in-out infinite;
}

@keyframes gentle-float {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Quick response button styles */
.quick-response-btn {
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 11px;
}

.quick-response-btn:hover {
    transform: translateY(-1px);
}

.quick-response-btn:active {
    transform: translateY(0px);
}

/* Message slide-in animation */
@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-in {
    animation: slide-in 0.3s ease-out;
}

/* Scroll progress bar */
.scroll-progress {
    background: linear-gradient(to right, #f1f5f9, #e2e8f0);
    border-radius: 2px;
}

.scroll-progress-bar {
    border-radius: 2px;
    transition: width 0.1s ease;
}

/* Responsive adjustments for very small screens */
@media (max-width: 375px) {
    .customer-service-modal {
        width: calc(100vw - 1rem) !important;
        height: calc(100vh - 8rem) !important;
        right: 0.5rem !important;
        top: 4rem !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .customer-service-modal {
        background: #1f2937;
        border-color: #374151;
    }

    .chat-message.agent {
        background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
        color: #f9fafb;
        border-color: #6b7280;
    }

    .quick-response-btn {
        background: #4b5563 !important;
        color: #f9fafb !important;
    }
}

/* Scroll to Bottom Button */
.scroll-to-bottom-btn {
    backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-to-bottom-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
}

.scroll-to-bottom-btn:active {
    transform: scale(0.95);
}

.scroll-to-bottom-btn i {
    transition: transform 0.2s ease;
}

.scroll-to-bottom-btn:hover i {
    transform: translateY(-1px);
}

/* Focus states for accessibility */
.customer-service-btn:focus,
.quick-response-btn:focus,
.scroll-to-bottom-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Loading states */
.customer-service-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .customer-service-modal {
        border: 2px solid #000;
    }

    .chat-message.user {
        background: #000;
        color: #fff;
    }

    .chat-message.agent {
        background: #fff;
        color: #000;
        border: 2px solid #000;
    }
}
