/* =============================================================================
   Modern Floating Comparison Widget Styles
   Professional, Animated, User-Friendly Design
   ============================================================================= */

/* Widget Container */
.spc-floating-widget-modern {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Main Trigger Button */
.spc-widget-trigger {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4),
                0 8px 24px rgba(102, 126, 234, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spc-widget-trigger:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5),
                0 12px 32px rgba(102, 126, 234, 0.4);
}

.spc-widget-trigger:active {
    transform: scale(0.98);
}

/* Icon */
.spc-widget-icon {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.spc-widget-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

/* Counter Badge */
.spc-widget-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    z-index: 3;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #ef4444;
    border: 2px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: spc-badge-pop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.spc-widget-count {
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

@keyframes spc-badge-pop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Progress Ring */
.spc-widget-progress {
    position: absolute;
    top: -1px;
    left: -1px;
    width: 58px;
    height: 58px;
    pointer-events: none;
    transform: rotate(-90deg);
}

.spc-progress-circle {
    transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Panel */
.spc-widget-panel {
    position: absolute;
    bottom: 72px;
    left: 0;
    width: 360px;
    max-height: 500px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15),
                0 8px 24px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.spc-floating-widget-modern.is-open .spc-widget-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Panel Header */
.spc-widget-panel-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
}

.spc-widget-panel-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spc-widget-panel-count {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
}

.spc-widget-panel-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s ease;
}

.spc-widget-panel-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Products List */
.spc-widget-products {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    max-height: 320px;
}

.spc-widget-products::-webkit-scrollbar {
    width: 6px;
}

.spc-widget-products::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.spc-widget-products::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.spc-widget-products::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Product Item */
.spc-widget-product-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    animation: spc-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.spc-widget-product-item:hover {
    background: #ffffff;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.spc-widget-product-item:last-child {
    margin-bottom: 0;
}

@keyframes spc-slide-in {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Product Thumbnail */
.spc-widget-product-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.spc-widget-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spc-widget-product-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #9ca3af;
}

/* Product Info */
.spc-widget-product-info {
    flex: 1;
    min-width: 0;
}

.spc-widget-product-title {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Remove Button */
.spc-widget-product-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.spc-widget-product-remove:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Empty State */
.spc-widget-empty {
    padding: 40px 20px;
    text-align: center;
    color: #9ca3af;
}

.spc-widget-empty svg {
    margin: 0 auto 12px;
    opacity: 0.3;
}

.spc-widget-empty p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

/* Panel Footer */
.spc-widget-panel-footer {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    background: #f9fafb;
}

/* Buttons */
.spc-widget-btn {
    flex: 1;
    height: 44px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.spc-widget-btn-primary {
    background: #ffffff;
    color: #6b7280;
    border: 1.5px solid #e5e7eb;
}

.spc-widget-btn-primary:hover,
a.spc-widget-btn-primary:hover {
    background: #1f2937;
    border-color: #1f2937;
    color: #ffffff;
    text-decoration: none;
}

.spc-widget-btn-secondary {
    background: #ffffff;
    color: #6b7280;
    border: 1.5px solid #e5e7eb;
}

.spc-widget-btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

/* Backdrop */
.spc-widget-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: -1;
    backdrop-filter: blur(2px);
}

.spc-floating-widget-modern.is-open .spc-widget-backdrop {
    opacity: 1;
    visibility: visible;
}

/* Responsive Design */
@media (max-width: 480px) {
    .spc-floating-widget-modern {
        bottom: 16px;
        right: 16px;
    }
    
    .spc-widget-panel {
        width: calc(100vw - 32px);
        max-width: 360px;
        right: -8px;
    }
}

/* Animations */
@keyframes spc-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Loading State */
.spc-widget-loading .spc-widget-products {
    position: relative;
    min-height: 100px;
}

.spc-widget-loading .spc-widget-products::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Success Animation */
@keyframes spc-success {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.spc-widget-success {
    animation: spc-success 0.4s ease;
}
