/* ===== GUEST CHAT INTERFACE STYLES ===== */

/* Guest Chat Toggle */
.guest-chat-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.guest-chat-toggle:hover {
    transform: translateY(-5px);
}

/* Support Agent Container */
.support-agent {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 15px;
}

/* Agent Avatar */
.agent-avatar {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3px;
    box-shadow: 
        0 8px 30px rgba(102, 126, 234, 0.4),
        0 0 0 0 rgba(102, 126, 234, 0.4);
    animation: gentlePulse 3s infinite;
}

@keyframes gentlePulse {
    0%, 100% {
        box-shadow: 
            0 8px 30px rgba(102, 126, 234, 0.4),
            0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 
            0 8px 30px rgba(102, 126, 234, 0.6),
            0 0 0 15px rgba(102, 126, 234, 0);
    }
}

.agent-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: white;
}

.agent-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
}

.agent-status {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.agent-status.online {
    background: #10b981;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Chat Bubble */
.chat-bubble {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 12px 18px;
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    margin-bottom: 10px;
    transform: translateX(10px) scale(0.8);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 200px;
}

.chat-bubble.show {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.bubble-text {
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.bubble-tail {
    position: absolute;
    bottom: 15px;
    right: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid white;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
}

/* Pulse Rings */
.pulse-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70px;
    height: 70px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulseRing 3s infinite;
}

.pulse-ring:nth-child(2) {
    animation-delay: 1s;
}

.pulse-ring:nth-child(3) {
    animation-delay: 2s;
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Guest Chat Modal */
.guest-chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.guest-chat-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 450px;
    background: white;
    border-radius: 24px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.guest-chat-modal.active .modal-content {
    transform: translateY(0) scale(1);
}

/* Modal Header */
.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px;
    color: white;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    animation: patternMove 20s linear infinite;
}

@keyframes patternMove {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(60px) translateY(60px); }
}

.agent-info {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.agent-photo {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px;
}

.agent-photo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: white;
}

.status-indicator {
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white;
}

.status-indicator.online {
    background: #10b981;
}

.agent-details h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.agent-status {
    margin: 4px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 3;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Modal Body */
.modal-body {
    padding: 32px 24px;
    text-align: center;
}

.welcome-message {
    margin-bottom: 32px;
}

.message-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    font-size: 24px;
}

.welcome-message h4 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.welcome-message p {
    margin: 0;
    color: #6b7280;
    line-height: 1.6;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.feature-item i {
    width: 20px;
    color: #667eea;
    font-size: 16px;
}

.feature-item span {
    color: #374151;
    font-weight: 500;
}

/* Modal Footer */
.modal-footer {
    padding: 0 24px 24px;
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.alternative-contact {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.alternative-contact p {
    margin: 0 0 16px 0;
    color: #6b7280;
    font-size: 14px;
}

.contact-options {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.contact-option {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #667eea;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.contact-option:hover {
    color: #5a67d8;
    transform: translateY(-1px);
}

.contact-option i {
    font-size: 12px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .guest-chat-toggle {
        bottom: 20px;
        right: 20px;
    }
    
    .agent-avatar {
        width: 60px;
        height: 60px;
    }
    
    .chat-bubble {
        max-width: 150px;
        font-size: 13px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .contact-options {
        flex-direction: column;
        gap: 12px;
    }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .chat-bubble {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .bubble-tail {
        border-left-color: #1f2937;
    }
    
    .modal-content {
        background: #111827;
        color: #f9fafb;
    }
    
    .welcome-message h4 {
        color: #f9fafb;
    }
    
    .feature-item {
        background: #1f2937;
        border-color: #374151;
    }
    
    .feature-item span {
        color: #e5e7eb;
    }
    
    .alternative-contact {
        border-color: #374151;
    }
}