/* ============================================
   ELEMENTOR MARQUEE ICON BOX WIDGET v2.0.1
   ============================================ */

/* RESET AND BASE STYLES */
.emib-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    min-height: 200px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: pan-y;
    isolation: isolate;
}

/* TRACK CONTAINER - FIXED: Ensure track can expand */
.emib-track {
    display: flex;
    width: max-content !important; /* Force maximum width */
    min-width: 100%; /* Ensure minimum width */
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
    gap: 30px;
    padding: 10px 0;
    transition: transform 0.1s linear;
    cursor: grab;
}

/* FIXED: Remove width restrictions and ensure all items display */
.emib-box {
    flex: 0 0 auto !important; /* Don't grow, don't shrink, auto basis */
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    scroll-snap-align: start;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    display: block !important; /* Ensure block display */
    visibility: visible !important; /* Force visibility */
    opacity: 1 !important; /* Force opacity */
}

/* FIXED: Remove all width calculations - items should size naturally */
.emib-box {
    /* Remove any max-width or min-width restrictions */
    max-width: none !important;
    min-width: none !important;
}

/* FIXED: Ensure content inside boxes is fully visible */
.emib-box > * {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* FIXED: Prevent any content clipping */
.emib-box {
    overflow: visible !important;
    clip: unset !important;
    clip-path: none !important;
}

/* INTERACTION STATES */
.emib-track.dragging {
    cursor: grabbing !important;
    transition: none !important;
}

.emib-track.animating {
    transition: transform linear;
}

.emib-box:hover {
    transform: translateY(-5px) translateZ(0);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.emib-box a {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

/* CONTENT STYLES */
.emib-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.emib-title {
    margin: 0 0 10px 0;
    transition: all 0.3s ease;
}

.emib-description {
    line-height: 1.6;
    transition: all 0.3s ease;
}

/* DRAG HINT */
.emib-drag-hint {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 12px;
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.emib-drag-icon {
    font-size: 14px;
    animation: emib-hint-pulse 2s infinite;
}

.emib-container:hover .emib-drag-hint {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

@keyframes emib-hint-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* REMOVED: Navigation arrows - they have been removed as requested */
.emib-accessibility-nav {
    display: none !important; /* Completely hide the navigation arrows */
}

/* EMPTY STATE */
.emib-empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.emib-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.emib-empty-title {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 18px;
}

.emib-empty-description {
    color: #6c757d;
    margin: 0;
    font-size: 14px;
}

/* FIXED: Responsive behavior - items should wrap properly */
@media (max-width: 1024px) { /* TABLET */
    .emib-drag-hint {
        font-size: 11px;
        padding: 5px 10px;
    }
}

@media (max-width: 767px) { /* MOBILE */
    .emib-drag-hint {
        display: none; /* Hide on mobile for cleaner UI */
    }
    
    .emib-track {
        gap: 20px;
    }
}

/* RTL SUPPORT */
[dir="rtl"] .emib-track {
    flex-direction: row-reverse;
}

[dir="rtl"] .emib-drag-icon {
    transform: scaleX(-1);
}

/* REDUCED MOTION PREFERENCE */
@media (prefers-reduced-motion: reduce) {
    .emib-track,
    .emib-box,
    .emib-drag-hint {
        transition: none !important;
        animation: none !important;
    }
    
    .emib-track.animating {
        animation: none !important;
    }
}

/* FOCUS STATES FOR ACCESSIBILITY */
.emib-box:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* PERFORMANCE OPTIMIZATIONS */
.emib-track {
    contain: layout style paint;
}

.emib-box {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* LOADING STATE */
.emib-container.loading .emib-track {
    opacity: 0.5;
}

.emib-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: emib-spin 1s linear infinite;
}

@keyframes emib-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* CUSTOM SCROLLBAR HIDE */
.emib-track::-webkit-scrollbar {
    display: none;
}

.emib-track {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* PRINT STYLES */
@media print {
    .emib-track {
        transform: none !important;
        animation: none !important;
        gap: 20px;
    }
    
    .emib-drag-hint {
        display: none;
    }
}