/* Zuri Assistant - Facebook Marketplace Style */
/* Blue color scheme (#1877f2) - No Purple */

.zuri-anchor {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.zuri-anchor.drag-active .zuri-avatar {
    transform: scale(1.15);
    box-shadow: 0 14px 40px rgba(24,119,242,0.5);
}

.zuri-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 0 4px rgba(24,119,242,0.2), 0 12px 40px rgba(24,119,242,0.4);
    cursor: pointer;
    animation: floatZuri 2.8s cubic-bezier(0.43, 0.13, 0.23, 0.96) infinite, pulseZuri 2.5s ease-in-out infinite, glowZuri 3s ease-in-out infinite;
    border: 3px solid white;
    background: linear-gradient(135deg, #1877f2 0%, #0a66c2 100%);
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
    position: relative;
    flex-shrink: 0;
}

.zuri-avatar::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(24,119,242,0.3), transparent);
    animation: expandPulse 2s ease-out infinite;
    z-index: -1;
}

.zuri-avatar::after {
    content: '';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(239,68,68,0.4);
    animation: pulseBadge 1.5s ease-in-out infinite;
}

.zuri-avatar:hover {
    filter: brightness(1.15);
    box-shadow: 0 0 0 4px rgba(24,119,242,0.4), 0 16px 50px rgba(24,119,242,0.6);
    transform: scale(1.05);
}

.zuri-avatar:active {
    transform: scale(0.95);
}

@keyframes expandPulse {
    0% { 
        transform: scale(1);
        opacity: 0.8;
    }
    100% { 
        transform: scale(1.3);
        opacity: 0;
    }
}

@keyframes pulseBadge {
    0%, 100% { 
        box-shadow: 0 2px 8px rgba(239,68,68,0.4), 0 0 0 0 rgba(239,68,68,0.7);
    }
    50% { 
        box-shadow: 0 2px 8px rgba(239,68,68,0.4), 0 0 0 8px rgba(239,68,68,0);
    }
}

@keyframes glowZuri {
    0%, 100% { 
        filter: drop-shadow(0 0 8px rgba(24,119,242,0.3));
    }
    50% { 
        filter: drop-shadow(0 0 16px rgba(24,119,242,0.6));
    }
}

@keyframes pulseZuri {
    0%, 100% { box-shadow: 0 0 0 4px rgba(24,119,242,0.2), 0 12px 40px rgba(24,119,242,0.4); }
    50% { box-shadow: 0 0 0 4px rgba(24,119,242,0.4), 0 12px 50px rgba(24,119,242,0.6); }
}

.zuri-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#zuriDefault {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#zuriDefault svg {
    width: 100%;
    height: 100%;
}

@keyframes floatZuri {
    0%, 100% { 
        transform: translateY(0) rotateZ(-2deg);
    }
    25% {
        transform: translateY(-12px) rotateZ(1deg);
    }
    50% { 
        transform: translateY(-16px) rotateZ(-1deg);
    }
    75% {
        transform: translateY(-10px) rotateZ(2deg);
    }
}

.zuri-speech {
    background: linear-gradient(135deg, #1877f2 95%, #0a66c2);
    color: white;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(24,119,242,0.5);
    transform-origin: right bottom;
    opacity: 0;
    animation: slideInSpeech 0.5s ease forwards, fadeOutSpeech 0.5s ease 3.5s forwards;
    max-width: 200px;
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
    position: relative;
}

.zuri-speech::before {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 16px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #0a66c2, #1877f2);
    clip-path: polygon(100% 0, 0 100%, 0 0);
}

.zuri-speech.visible { 
    opacity: 1; 
    display: block;
}

.zuri-speech.hidden { 
    opacity: 0; 
    display: none;
}

@keyframes slideInSpeech {
    from {
        opacity: 0;
        transform: translateY(10px) translateX(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateX(0) scale(1);
    }
}

@keyframes fadeOutSpeech {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUpModal 0.3s ease;
}

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

.zuri-modal .modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
    background: linear-gradient(135deg, #1877f2 0%, #0a66c2 100%);
    color: white;
}

.modal-zuri {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: contain;
    background: white;
    padding: 4px;
    flex-shrink: 0;
}

.zuri-fallback-svg {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    flex-shrink: 0;
}

.zuri-modal .modal-header h2 {
    flex: 1;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 0.8;
}

.modal-body {
    padding: 24px;
}

.zuri-message {
    font-size: 1rem;
    color: #050505;
    margin-bottom: 16px;
    font-weight: 500;
    line-height: 1.5;
}

.zuri-inspection {
    background: #f0f9ff;
    border-left: 4px solid #1877f2;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.inspection-text {
    margin: 0;
    color: #65676b;
    font-size: 0.95rem;
    line-height: 1.5;
}

.inspection-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f0f2f5;
    border-radius: 6px;
    border: 1px solid #e5e5e5;
}

.detail-row .label {
    font-weight: 600;
    color: #65676b;
    font-size: 0.9rem;
}

.detail-row .value {
    color: #1877f2;
    font-weight: 600;
    text-align: right;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e5e5;
    justify-content: flex-end;
    background: #f7f7f7;
}

.modal-footer .btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-secondary {
    background: white;
    color: #050505;
    border: 1px solid #ccc;
}

.btn-secondary:hover {
    background: #f0f2f5;
    border-color: #bcc0c4;
}

.btn-primary {
    background: #1877f2;
    color: white;
}

.btn-primary:hover {
    background: #165ce7;
}

.product-card-marketplace.dragging {
    cursor: grabbing;
    opacity: 0.8;
    transform: scale(0.95);
}

.zuri-mini {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.zuri-mini:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.zuri-mini svg {
    width: 100%;
    height: 100%;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(24,119,242,0.2);
    border-top-color: #1877f2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { 
        transform: rotate(360deg);
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .zuri-anchor {
        right: 16px;
        bottom: 90px;
    }

    .zuri-avatar {
        width: 80px;
        height: 80px;
    }

    .zuri-speech {
        font-size: 0.85rem;
        max-width: 160px;
    }

    .modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .zuri-modal .modal-header {
        padding: 16px;
    }

    .zuri-modal .modal-header h2 {
        font-size: 1rem;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
        flex-direction: column;
        gap: 8px;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .detail-row {
        padding: 8px;
        font-size: 0.85rem;
    }

    .detail-row .label,
    .detail-row .value {
        font-size: 0.85rem;
    }
}

/* Dark Mode Support */
[data-theme="dark"] .modal-content {
    background: #1a1a1a;
    color: #ffffff;
}

[data-theme="dark"] .zuri-modal .modal-header {
    background: linear-gradient(135deg, #1877f2 0%, #0a66c2 100%);
    color: #ffffff;
}

[data-theme="dark"] .modal-body {
    background: #1a1a1a;
    color: #ffffff;
}

[data-theme="dark"] .zuri-message {
    color: #ffffff;
}

[data-theme="dark"] .zuri-inspection {
    background: rgba(24, 119, 242, 0.15);
    border-left-color: #1877f2;
    color: #ffffff;
}

[data-theme="dark"] .inspection-text {
    color: #e0e0e0;
}

[data-theme="dark"] .detail-row {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #ffffff;
}

[data-theme="dark"] .detail-row .label {
    color: #e0e0e0;
    font-weight: 600;
}

[data-theme="dark"] .detail-row .value {
    color: #1877f2;
}

[data-theme="dark"] .modal-footer {
    background: #1e1e1e;
    border-top-color: #3a3a3a;
}

[data-theme="dark"] .btn-secondary {
    background: #2a2a2a;
    color: #ffffff;
    border-color: #3a3a3a;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #3a3a3a;
    border-color: #4a4a4a;
}

[data-theme="dark"] .modal-close {
    color: #ffffff;
}
