/**
 * Alyx Carousel Style
 * Dark theme with colored tier borders at top and bottom
 * Similar to Jemlit/BigLoot style
 */

/* Alyx Carousel Container */
.mgb-alyx-carousel-wrapper {
    position: relative;
    background: #1a1a1a;
    border-radius: 8px;
    border: 1px solid #cccccc;
    overflow: hidden;
    padding: 0;
    margin: 20px 0;
}

/* Top and bottom borders - simple gray border */
.mgb-alyx-carousel-wrapper::before,
.mgb-alyx-carousel-wrapper::after {
    display: none;
}

/* Center pointer/indicator */
.mgb-alyx-pointer {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    background: #fff;
    z-index: 20;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

/* Strip container */
.mgb-alyx-strip-container {
    position: relative;
    overflow: hidden;
    padding: 20px 0;
}

/* Items strip */
.mgb-alyx-strip {
    display: flex;
    gap: 12px;
    padding: 15px 20px;
    transition: transform 5s cubic-bezier(0.05, 0.87, 0.1, 1);
    will-change: transform;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000px;
    perspective: 1000px;
}

/* Individual item card */
.mgb-alyx-item {
    flex: 0 0 180px;
    min-width: 180px;
    max-width: 180px;
    background: #252525;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

/* Tier color bar at top of each item */
.mgb-alyx-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--tier-color, #666);
}

/* Tier color bar at bottom of each item */
.mgb-alyx-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--tier-color, #666);
}

/* Tier colors */
.mgb-alyx-item[data-tier="trash"] {
    --tier-color: #ccff00; /* Lime/Yellow-green */
}

.mgb-alyx-item[data-tier="mid"] {
    --tier-color: #00bcd4; /* Cyan */
}

.mgb-alyx-item[data-tier="high"] {
    --tier-color: #9c27b0; /* Purple */
}

.mgb-alyx-item[data-tier="top"] {
    --tier-color: #ff9800; /* Orange/Gold */
}

/* Item image */
.mgb-alyx-item-image {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: #1e1e1e;
}

.mgb-alyx-item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

/* Item name */
.mgb-alyx-item-name {
    padding: 12px 10px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #252525;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Winner highlight */
.mgb-alyx-item.mgb-alyx-winner {
    box-shadow: 0 0 30px var(--tier-color, #ccff00);
    transform: scale(1.05);
    z-index: 5;
}

.mgb-alyx-item.mgb-alyx-winner::before,
.mgb-alyx-item.mgb-alyx-winner::after {
    height: 6px;
}

/* Spinning state */
.mgb-alyx-carousel-wrapper.mgb-spinning .mgb-alyx-strip {
    transition: transform 5s cubic-bezier(0.05, 0.87, 0.1, 1);
}

/* Gradient edges for seamless look */
.mgb-alyx-strip-container::before,
.mgb-alyx-strip-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    z-index: 5;
    pointer-events: none;
}

.mgb-alyx-strip-container::before {
    left: 0;
    background: linear-gradient(to right, #1a1a1a 0%, transparent 100%);
}

.mgb-alyx-strip-container::after {
    right: 0;
    background: linear-gradient(to left, #1a1a1a 0%, transparent 100%);
}

/* Win popup for Alyx style */
.mgb-alyx-win-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mgb-alyx-win-popup.active {
    opacity: 1;
    visibility: visible;
}

.mgb-alyx-win-content {
    text-align: center;
    padding: 40px;
    max-width: 500px;
}

.mgb-alyx-win-content img {
    max-width: 200px;
    max-height: 200px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 30px var(--tier-color, #ccff00));
}

.mgb-alyx-win-content h2 {
    color: #fff;
    font-size: 28px;
    margin-bottom: 10px;
}

.mgb-alyx-win-content .mgb-alyx-win-value {
    color: var(--tier-color, #ccff00);
    font-size: 24px;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 768px) {
    .mgb-alyx-item {
        flex: 0 0 140px;
        min-width: 140px;
        max-width: 140px;
    }
    
    .mgb-alyx-item-image {
        height: 100px;
        padding: 10px;
    }
    
    .mgb-alyx-item-name {
        font-size: 12px;
        padding: 8px;
    }
    
    .mgb-alyx-strip {
        gap: 8px;
        padding: 10px 15px;
    }
}

/* Animation for tier colors flowing across top/bottom */
@keyframes mgb-alyx-color-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* Spinning state - keep borders hidden for alyx */
.mgb-alyx-carousel-wrapper.mgb-spinning::before,
.mgb-alyx-carousel-wrapper.mgb-spinning::after {
    display: none;
}

/* But show them for BigLoot */
.mgb-alyx-carousel-wrapper.mgb-bigloot-carousel.mgb-spinning::before,
.mgb-alyx-carousel-wrapper.mgb-bigloot-carousel.mgb-spinning::after {
    display: block;
}

/* ============================== */
/* BIGLOOT CAROUSEL SPIN STYLES   */
/* ============================== */

/* BigLoot carousel wrapper - inherits from alyx but overrides */
.mgb-alyx-carousel-wrapper.mgb-bigloot-carousel {
    background: #1a1a1a;
    border: none;
    border-radius: 0;
    overflow: hidden;
}

/* Top/bottom colored bars for BigLoot */
.mgb-alyx-carousel-wrapper.mgb-bigloot-carousel::before,
.mgb-alyx-carousel-wrapper.mgb-bigloot-carousel::after {
    content: '';
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 10;
    background: var(--bigloot-bar-color, #ccff00);
}

.mgb-alyx-carousel-wrapper.mgb-bigloot-carousel::before {
    top: 0;
}

.mgb-alyx-carousel-wrapper.mgb-bigloot-carousel::after {
    bottom: 0;
}

/* BigLoot center pointer */
.mgb-bigloot-carousel .mgb-bigloot-pointer {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    width: 3px;
    background: #fff;
    z-index: 20;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

/* BigLoot items during spin - completely separate from mgb-alyx-item */
/* Full cross-browser support including Opera, Safari, Mac */
.mgb-bigloot-spin-item {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 220px;
    -ms-flex: 0 0 220px;
    flex: 0 0 220px;
    min-width: 220px;
    max-width: 220px;
    background: #252525;
    -webkit-border-radius: 8px;
    border-radius: 8px;
    border: 1px solid #444;
    overflow: hidden;
    position: relative;
    padding: 15px;
    text-align: center;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* BigLoot item image */
.mgb-bigloot-spin-image {
    background: transparent;
    padding: 10px;
    height: 100px;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.mgb-bigloot-spin-image img {
    max-height: 90px;
    max-width: 90px;
    width: auto;
    height: auto;
    -o-object-fit: contain;
    object-fit: contain;
}

/* BigLoot item name */
.mgb-bigloot-spin-name {
    padding: 10px 5px 0;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    -o-text-overflow: ellipsis;
    text-overflow: ellipsis;
    background: transparent;
}

/* BigLoot strip */
.mgb-bigloot-carousel .mgb-alyx-strip {
    gap: 10px;
    padding: 15px 20px;
}

/* Responsive BigLoot */
@media (max-width: 768px) {
    .mgb-bigloot-spin-item {
        -webkit-box-flex: 0;
        -ms-flex: 0 0 160px;
        flex: 0 0 160px;
        min-width: 160px;
        max-width: 160px;
        padding: 10px;
    }
    
    .mgb-bigloot-spin-item .mgb-alyx-item-image {
        height: 70px;
    }
    
    .mgb-bigloot-spin-item .mgb-alyx-item-image img {
        max-height: 60px;
        max-width: 60px;
    }
    
    .mgb-bigloot-spin-item .mgb-alyx-item-name {
        font-size: 11px;
    }
}
