/* ShopAssistAI Widget Styles */
.shopassistai-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.shopassistai-widget-bottom-right {
    bottom: 20px;
    right: 20px;
}

.shopassistai-widget-bottom-left {
    bottom: 20px;
    left: 20px;
}

.shopassistai-widget-top-right {
    top: 20px;
    right: 20px;
}

.shopassistai-widget-top-left {
    top: 20px;
    left: 20px;
}

.shopassistai-widget-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

.shopassistai-widget-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.shopassistai-widget-toggle svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.shopassistai-widget.open .shopassistai-widget-toggle svg {
    transform: rotate(180deg);
}

.shopassistai-widget-content {
    position: absolute;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.shopassistai-widget-bottom-right .shopassistai-widget-content,
.shopassistai-widget-top-right .shopassistai-widget-content {
    right: 0;
}

.shopassistai-widget-bottom-left .shopassistai-widget-content,
.shopassistai-widget-top-left .shopassistai-widget-content {
    left: 0;
}

.shopassistai-widget-bottom-right .shopassistai-widget-content,
.shopassistai-widget-bottom-left .shopassistai-widget-content {
    bottom: 70px;
}

.shopassistai-widget-top-right .shopassistai-widget-content,
.shopassistai-widget-top-left .shopassistai-widget-content {
    top: 70px;
}

.shopassistai-widget.open .shopassistai-widget-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.shopassistai-widget-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.shopassistai-widget-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.shopassistai-widget-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.shopassistai-widget-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.shopassistai-widget-iframe-container {
    position: relative;
    height: calc(100% - 68px);
    overflow: hidden;
}

.shopassistai-widget-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Shortcode Styles */
.shopassistai-shortcode-container {
    margin: 20px 0;
}

.shopassistai-shortcode-iframe {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    display: block;
}

.shopassistai-embedded {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shopassistai-shortcode-notice {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px 16px;
    color: #6c757d;
    font-size: 14px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .shopassistai-widget-content {
        width: calc(100vw - 40px);
        max-width: 350px;
        height: 60vh;
        max-height: 500px;
    }
    
    .shopassistai-widget-bottom-right,
    .shopassistai-widget-bottom-left {
        bottom: 10px;
    }
    
    .shopassistai-widget-bottom-right {
        right: 10px;
    }
    
    .shopassistai-widget-bottom-left {
        left: 10px;
    }
    
    .shopassistai-widget-top-right,
    .shopassistai-widget-top-left {
        top: 10px;
    }
    
    .shopassistai-widget-top-right {
        right: 10px;
    }
    
    .shopassistai-widget-top-left {
        left: 10px;
    }
}

@media (max-width: 480px) {
    .shopassistai-widget-toggle {
        width: 50px;
        height: 50px;
    }
    
    .shopassistai-widget-toggle svg {
        width: 20px;
        height: 20px;
    }
    
    .shopassistai-widget-content {
        width: calc(100vw - 20px);
        height: 70vh;
    }
    
    .shopassistai-widget-bottom-right .shopassistai-widget-content,
    .shopassistai-widget-bottom-left .shopassistai-widget-content {
        bottom: 60px;
    }
    
    .shopassistai-widget-top-right .shopassistai-widget-content,
    .shopassistai-widget-top-left .shopassistai-widget-content {
        top: 60px;
    }
}

/* Animation for loading */
.shopassistai-widget-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    color: #6c757d;
}

.shopassistai-widget-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Theme integration */
.shopassistai-widget * {
    box-sizing: border-box;
}

/* Accessibility */
.shopassistai-widget-toggle:focus,
.shopassistai-widget-close:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .shopassistai-widget {
        display: none !important;
    }
}