/* Feature Badge Widget Styles - Optimized for SEO and Performance */

/* CSS Variables for consistent theming */
:root {
    --apc-badge-bg-color: #007cba;
    --apc-badge-text-color: #ffffff;
    --apc-badge-border-color: transparent;
    --apc-badge-spacing: 8px;
    --apc-badge-padding: 6px 12px;
    --apc-badge-border-radius: 4px;
    --apc-badge-font-size: 12px;
    --apc-badge-transition: all 0.3s ease;
}

/* Base Container Styles */
.elementor-widget-apc-feature-badge .apc-feature-badges-container {
    display: flex;
    align-items: center;
    gap: var(--apc-badge-spacing);
    flex-wrap: wrap;
    contain: layout style;
    will-change: auto;
}

/* Layout Styles */
.elementor-widget-apc-feature-badge .apc-layout-inline {
    flex-direction: row;
    align-items: center;
}

.elementor-widget-apc-feature-badge .apc-layout-stacked {
    flex-direction: column;
    align-items: flex-start;
}

/* Badge Styles */
.elementor-widget-apc-feature-badge .apc-feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: var(--apc-badge-padding);
    background-color: var(--apc-badge-bg-color);
    color: var(--apc-badge-text-color);
    border: 1px solid var(--apc-badge-border-color);
    border-radius: var(--apc-badge-border-radius);
    font-size: var(--apc-badge-font-size);
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    transition: var(--apc-badge-transition);
    white-space: nowrap;
    user-select: none;
    cursor: default;
}

/* Link style inherits badge look */
.elementor-widget-apc-feature-badge .apc-feature-badge--link {
    text-decoration: none;
    cursor: pointer;
}

.elementor-widget-apc-feature-badge .apc-feature-badge--link:visited {
    color: var(--apc-badge-text-color);
}

.elementor-widget-apc-feature-badge .apc-feature-badge--link:hover,
.elementor-widget-apc-feature-badge .apc-feature-badge--link:focus {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Badge Icons */
.elementor-widget-apc-feature-badge .apc-feature-badge i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-style: normal;
    line-height: 1;
}

/* Badge Separator */
.elementor-widget-apc-feature-badge .apc-badge-separator {
    display: inline-flex;
    align-items: center;
    color: var(--apc-badge-text-color);
    opacity: 0.7;
    font-weight: 300;
}

/* Inline Attributes Display */
.elementor-widget-apc-feature-badge .apc-attributes-inline {
    display: inline-block;
    font-family: inherit;
    line-height: 1.4;
}

.elementor-widget-apc-feature-badge .apc-attribute-inline {
    display: inline;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    line-height: inherit;
}

/* Mixed Mode Display */
.elementor-widget-apc-feature-badge .apc-mixed-container {
    display: flex;
    align-items: center;
    gap: 0.5em;
    flex-wrap: wrap;
}

.elementor-widget-apc-feature-badge .apc-mixed-badges {
    display: flex;
    align-items: center;
    gap: 0.25em;
    flex-wrap: wrap;
}

.elementor-widget-apc-feature-badge .apc-mixed-inline {
    display: inline-block;
    font-family: inherit;
    line-height: 1.4;
}

/* Individual Badge Display */
.elementor-widget-apc-feature-badge .apc-individual-badges {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.elementor-widget-apc-feature-badge .apc-individual-badge-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
}

.elementor-widget-apc-feature-badge .apc-individual-badge-wrapper .apc-feature-badge {
    margin: 0;
}

/* Wrap Behavior Controls */
.elementor-widget-apc-feature-badge .apc-nowrap {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.elementor-widget-apc-feature-badge .apc-nowrap::-webkit-scrollbar {
    height: 4px;
}

.elementor-widget-apc-feature-badge .apc-nowrap::-webkit-scrollbar-track {
    background: transparent;
}

.elementor-widget-apc-feature-badge .apc-nowrap::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.elementor-widget-apc-feature-badge .apc-individual-lines {
    display: flex;
    flex-direction: column;
    gap: 0.25em;
}

.elementor-widget-apc-feature-badge .apc-individual-lines .apc-feature-badge {
    display: inline-block;
    width: fit-content;
}

/* Professional Enhancements */
.elementor-widget-apc-feature-badge .apc-feature-badge {
    position: relative;
    overflow: hidden;
}

.elementor-widget-apc-feature-badge .apc-feature-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.elementor-widget-apc-feature-badge .apc-feature-badge:hover::before {
    left: 100%;
}

/* Enhanced Badge Styles */
.elementor-widget-apc-feature-badge .apc-feature-badge {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.elementor-widget-apc-feature-badge .apc-feature-badge:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Professional Typography */
.elementor-widget-apc-feature-badge .apc-feature-badge {
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.75em;
}

/* Overflow Badge Styles */
.elementor-widget-apc-feature-badge .apc-overflow-badge {
    background-color: #6c757d !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-style: italic;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.elementor-widget-apc-feature-badge .apc-overflow-badge:hover {
    opacity: 1;
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.elementor-widget-apc-feature-badge .apc-overflow-badge::before {
    content: '+';
    font-weight: bold;
    margin-right: 2px;
}

/* Individual Badge Spacing */
.elementor-widget-apc-feature-badge .apc-feature-badge {
    margin-left: 8px;
    margin-bottom: 4px;
    display: inline-block;
    vertical-align: top;
}

.elementor-widget-apc-feature-badge .apc-feature-badge:last-child {
    margin-left: 0;
}

/* RTL Support for Badge Spacing */
[dir="rtl"] .elementor-widget-apc-feature-badge .apc-feature-badge {
    margin-left: 8px;
    margin-right: 0;
}

[dir="rtl"] .elementor-widget-apc-feature-badge .apc-feature-badge:last-child {
    margin-left: 0;
}

/* Overflow Badge Positioning */
.elementor-widget-apc-feature-badge .apc-overflow-badge {
    display: inline-block !important;
    vertical-align: top;
    margin-right: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Ensure all badges stay inline */
.elementor-widget-apc-feature-badge .apc-feature-badges-container {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5em;
}

.elementor-widget-apc-feature-badge .apc-feature-badge {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Responsive Mixed Mode */
@media (max-width: 768px) {
    .elementor-widget-apc-feature-badge .apc-mixed-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75em;
    }
    
    .elementor-widget-apc-feature-badge .apc-mixed-badges {
        width: 100%;
        justify-content: flex-start;
    }
    
    .elementor-widget-apc-feature-badge .apc-individual-badges {
        gap: 0.75em;
    }
    
    .elementor-widget-apc-feature-badge .apc-nowrap {
        overflow-x: auto;
        padding-bottom: 8px;
    }
}

/* Hover Effects */
.elementor-widget-apc-feature-badge .apc-feature-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Animation Classes */
.elementor-widget-apc-feature-badge .apc-feature-badge {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.elementor-widget-apc-feature-badge[data-animation="fade_in"] .apc-feature-badge {
    animation: fadeIn 0.6s ease forwards;
}

.elementor-widget-apc-feature-badge[data-animation="slide_up"] .apc-feature-badge {
    animation: slideUp 0.6s ease forwards;
}

.elementor-widget-apc-feature-badge[data-animation="bounce"] .apc-feature-badge {
    animation: bounce 0.8s ease forwards;
}

.elementor-widget-apc-feature-badge[data-animation="pulse"] .apc-feature-badge {
    animation: pulse 1s ease forwards;
}

/* Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Staggered Animation for Multiple Badges */
.elementor-widget-apc-feature-badge .apc-feature-badge:nth-child(1) {
    animation-delay: 0.1s;
}

.elementor-widget-apc-feature-badge .apc-feature-badge:nth-child(2) {
    animation-delay: 0.2s;
}

.elementor-widget-apc-feature-badge .apc-feature-badge:nth-child(3) {
    animation-delay: 0.3s;
}

.elementor-widget-apc-feature-badge .apc-feature-badge:nth-child(4) {
    animation-delay: 0.4s;
}

.elementor-widget-apc-feature-badge .apc-feature-badge:nth-child(5) {
    animation-delay: 0.5s;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .elementor-widget-apc-feature-badge .apc-feature-badge {
        font-size: calc(var(--apc-badge-font-size) * 0.95);
        padding: calc(var(--apc-badge-padding) * 0.9);
    }
    
    .elementor-widget-apc-feature-badges-container {
        gap: calc(var(--apc-badge-spacing) * 0.9);
    }
}

@media (max-width: 768px) {
    .elementor-widget-apc-feature-badge .apc-layout-inline {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .elementor-widget-apc-feature-badge .apc-feature-badge {
        font-size: calc(var(--apc-badge-font-size) * 0.9);
        padding: calc(var(--apc-badge-padding) * 0.8);
        margin-left: 6px;
        margin-bottom: 3px;
    }
    
    .elementor-widget-apc-feature-badges-container {
        gap: calc(var(--apc-badge-spacing) * 0.8);
    }
}

@media (max-width: 480px) {
    .elementor-widget-apc-feature-badge .apc-feature-badges-container {
        gap: calc(var(--apc-badge-spacing) * 0.7);
    }
    
    .elementor-widget-apc-feature-badge .apc-feature-badge {
        font-size: calc(var(--apc-badge-font-size) * 0.8);
        padding: calc(var(--apc-badge-padding) * 0.7);
        margin-left: 4px;
        margin-bottom: 2px;
    }
    
    .elementor-widget-apc-feature-badge .apc-feature-badge i {
        font-size: calc(var(--apc-badge-font-size) * 0.8);
    }
}

/* Accessibility Improvements */
.elementor-widget-apc-feature-badge .apc-feature-badge:focus {
    outline: 2px solid var(--apc-badge-bg-color);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .elementor-widget-apc-feature-badge .apc-feature-badge {
        background-color: ButtonText !important;
        color: ButtonFace !important;
        border: 2px solid ButtonText !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .elementor-widget-apc-feature-badge .apc-feature-badge {
        animation: none !important;
        transition: none !important;
    }
    
    .elementor-widget-apc-feature-badge .apc-feature-badge:hover {
        transform: none !important;
    }
}

/* Print Styles */
@media print {
    .elementor-widget-apc-feature-badge .apc-feature-badge {
        background: none !important;
        color: black !important;
        border: 1px solid black !important;
        box-shadow: none !important;
    }
}

/* Performance Optimizations */
.elementor-widget-apc-feature-badge .apc-feature-badge {
    contain: layout style;
    will-change: transform, opacity;
}

/* Focus States for Better Accessibility */
.elementor-widget-apc-feature-badge .apc-feature-badges-container:focus-within {
    outline: 2px solid var(--apc-badge-bg-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Badge States */
.elementor-widget-apc-feature-badge .apc-feature-badge[data-attribute="pa_color"] {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
}

.elementor-widget-apc-feature-badge .apc-feature-badge[data-attribute="pa_size"] {
    background: linear-gradient(45deg, #667eea, #764ba2);
}

.elementor-widget-apc-feature-badge .apc-feature-badge[data-attribute="pa_material"] {
    background: linear-gradient(45deg, #f093fb, #f5576c);
}

.elementor-widget-apc-feature-badge .apc-feature-badge[data-attribute="pa_brand"] {
    background: linear-gradient(45deg, #4facfe, #00f2fe);
}

/* Custom Badge Styles for Different Attributes */
.elementor-widget-apc-feature-badge .apc-feature-badge[data-attribute*="color"] {
    border-left: 3px solid var(--apc-badge-bg-color);
}

.elementor-widget-apc-feature-badge .apc-feature-badge[data-attribute*="size"] {
    border-left: 3px solid #28a745;
}

.elementor-widget-apc-feature-badge .apc-feature-badge[data-attribute*="material"] {
    border-left: 3px solid #ffc107;
}

.elementor-widget-apc-feature-badge .apc-feature-badge[data-attribute*="brand"] {
    border-left: 3px solid #dc3545;
}
