/* ========================================
   Chat Widget Styles - Orange Theme
   Standalone component for Contact Us page
   ======================================== */

/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.chat-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #de5e09, #E67E22);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(222, 94, 9, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(222, 94, 9, 0.5);
}

.chat-icon {
    width: 28px;
    height: 28px;
    color: #ffffff;
}

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

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

.chat-box {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    height: 600px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 24px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25), 0 10px 40px rgba(222, 94, 9, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideInUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(222, 94, 9, 0.1);
}

.chat-box.active {
    display: flex;
}

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

.chat-header {
    background: linear-gradient(135deg, #de5e09 0%, #E67E22 100%);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    position: relative;
    box-shadow: 0 4px 20px rgba(222, 94, 9, 0.2);
}

.chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    padding: 5px;
    object-fit: contain;
}

.chat-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.chat-status {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.chat-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #ffffff;
    transition: all 0.3s ease;
}

.chat-close:hover {
    transform: rotate(90deg);
}

.chat-close svg {
    width: 20px;
    height: 20px;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    margin: 10px 0;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #de5e09, #E67E22);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #E67E22, #8B4513);
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease-out;
}

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

.message-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #de5e09, #E67E22);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(222, 94, 9, 0.3);
    border: 2px solid white;
}

.message-avatar svg {
    width: 22px;
    height: 22px;
    color: #ffffff;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.message-content {
    flex: 1;
    max-width: 75%;
}

.message-content p {
    background: #ffffff;
    padding: 1rem 1.25rem;
    border-radius: 20px 20px 20px 4px;
    margin: 0;
    line-height: 1.6;
    color: #1f2937;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    font-size: 0.95rem;
    position: relative;
}

.message-content p::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 12px 12px;
    border-color: transparent transparent #ffffff transparent;
}

.user-message .message-content p {
    background: linear-gradient(135deg, #de5e09, #E67E22);
    color: #ffffff;
    border-radius: 20px 20px 4px 20px;
    box-shadow: 0 3px 15px rgba(222, 94, 9, 0.25);
}

.user-message .message-content p::before {
    left: auto;
    right: -8px;
    border-width: 0 12px 12px 0;
    border-color: transparent #de5e09 transparent transparent;
}

.message-time {
    font-size: 0.7rem;
    color: #718096;
    margin-top: 0.25rem;
    display: block;
}

.chat-input-container {
    padding: 1.25rem;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 0.75rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.chat-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e8e8e8;
    border-radius: 25px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
    background: #f8f9fa;
}

.chat-input:focus {
    border-color: #de5e09;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(222, 94, 9, 0.1);
}

.chat-input::placeholder {
    color: #999;
}

.chat-send {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #de5e09, #E67E22);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(222, 94, 9, 0.3);
}

.chat-send:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(222, 94, 9, 0.5);
}

.chat-send:active {
    transform: scale(0.95);
}

.chat-send svg {
    width: 22px;
    height: 22px;
    color: #ffffff;
}

/* Quick Replies */
.quick-replies {
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e2e8f0;
}

.quick-reply-btn {
    padding: 0.6rem 1rem;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.quick-reply-btn:hover {
    background: linear-gradient(135deg, #de5e09, #E67E22);
    color: #ffffff;
    border-color: #de5e09;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(222, 94, 9, 0.3);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    margin: 0.5rem;
    border-radius: 15px;
    width: fit-content;
    animation: fadeIn 0.3s ease-out;
}

.typing-indicator .message-avatar {
    width: 35px;
    height: 35px;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #de5e09;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

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

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

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

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

/* Mobile responsive */
@media (max-width: 768px) {
    .chat-box {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 70px;
        right: 50%;
        transform: translateX(50%);
    }

    .chat-box.active {
        transform: translateX(50%);
    }
}
