/* SMC Lucky Wheel Frontend Styles - Version 1.58.0 */

/* Áp dụng font sans-serif cho toàn bộ plugin */
.smc-lucky-wheel-container,
.smc-lucky-wheel-container * {
    font-family: sans-serif !important;
}

/* Ngăn chặn thay đổi scroll bar khi vòng quay quay */
html, body {
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

/* Ẩn thanh scroll dọc */
html, body {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

/* Ẩn thanh scroll cho Webkit browsers (Chrome, Safari, Edge) */
html::-webkit-scrollbar, 
body::-webkit-scrollbar {
    display: none;
}

/* Cố định layout cho toàn bộ container */
.smc-lucky-wheel-container * {
    box-sizing: border-box;
}
.smc-lucky-wheel-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    font-family: Arial, sans-serif;
    /* Sử dụng flexbox để order hoạt động */
    display: flex;
    flex-direction: column;
    /* Cố định layout để tránh thay đổi kích thước */
    box-sizing: border-box;
}

.wheel-header h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 24px;
    font-weight: bold;
}

.wheel-description {
    color: #666;
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.5;
}

    .winners-list-section {
        min-width: 200px;
        max-width: 250px;
    }

.wheel-game {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 100px;
    justify-content: center;
    /* Cố định layout để tránh thay đổi kích thước */
    box-sizing: border-box;
    /* Ngăn chặn thay đổi layout nhưng không cắt vòng quay */
    contain: layout style;
    /* Đảm bảo layout 2 cột: vòng quay bên trái, danh sách bên phải */
    flex-wrap: nowrap;
}

.wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.winners-list-section {
    flex: 1;
    max-width: 350px;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-left: 20px;
    /* max-height: 600px; */
    overflow-y: auto;
}

.winners-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.winners-list-title {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: bold;
}

.reset-wheel-button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.reset-wheel-button:hover {
    background: #c82333;
}

.reset-wheel-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.winners-stats {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px 0;
}

.stats-item:last-child {
    margin-bottom: 0;
    border-top: 1px solid #dee2e6;
    padding-top: 10px;
    margin-top: 10px;
}

.stats-label {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.stats-value {
    font-weight: bold;
    color: #0064c8;
    font-size: 16px;
}

.reset-section {
    margin-top: 15px;
    text-align: center;
    padding: 10px;
    border-top: 1px solid #dee2e6;
    padding-top: 15px;
}

.winners-list {
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #dee2e6;
}

.winner-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: #fff;
    border-radius: 6px;
    border-left: 4px solid #ff6b35;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.winner-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.winner-info {
    text-align: left;
    flex: 1;
}

.winner-name {
    font-weight: bold;
    color: #333;
    font-size: 14px;
    text-align: left;
}

.winner-value {
    color: #666;
    font-size: 12px;
    font-style: italic;
    text-align: left;
}

.winner-time {
    color: #999;
    font-size: 11px;
    margin-top: 4px;
    text-align: left;
}

.no-winners {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
    font-size: 14px;
}

.wheel-wrapper {
    position: relative;
    display: inline-block;
    /* Đặt kích thước cố định 700px x 700px */
    width: 700px;
    height: 700px;
    max-width: 700px;
    max-height: 700px;
    /* Đảm bảo hình tròn */
    aspect-ratio: 1;
    /* Cố định layout để tránh thay đổi kích thước */
    box-sizing: border-box;
    /* Ngăn chặn thay đổi layout nhưng không cắt vòng quay */
    contain: layout style;
}

#wheelCanvas-1, #wheelCanvas-2, #wheelCanvas-3, #wheelCanvas-4, #wheelCanvas-5,
[id^="wheelCanvas-"] {
    border: 5px solid #333;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    transform-origin: center center;
    /* Loại bỏ transition mặc định để tránh rung lắc */
    transition: none;
    /* Đặt kích thước cố định 700px x 700px */
    width: 100% !important;
    height: 100% !important;
    max-width: 700px;
    max-height: 700px;
    object-fit: contain;
    /* Cố định layout để tránh thay đổi kích thước */
    box-sizing: border-box;
    /* Ngăn chặn thay đổi layout nhưng không cắt vòng quay */
    contain: layout style;
    /* Cố định kích thước */
    flex-shrink: 0;
    flex-grow: 0;
}

.wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid #ff6b35;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Nút quay ở giữa vòng quay */
.wheel-center-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    color: white;
    border: 4px solid #fff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.wheel-center-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.6);
    background: linear-gradient(45deg, #f7931e, #ff6b35);
}

.wheel-center-button:active {
    transform: translate(-50%, -50%) scale(0.95);
    box-shadow: 0 2px 10px rgba(255, 107, 53, 0.4);
}

.wheel-center-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: translate(-50%, -50%);
    box-shadow: none;
}

.wheel-center-button:disabled:hover {
    transform: translate(-50%, -50%);
    box-shadow: none;
}

/* Ẩn nút quay cũ */
.wheel-controls {
    display: none;
}

.spin-button {
    display: none;
}

.spinning-text {
    display: none;
}

.wheel-center-button:disabled .spin-text {
    display: none;
}

.wheel-center-button:disabled .spinning-text {
    display: inline;
}

.wheel-result {
    margin-top: 0;
    margin-bottom: 30px;
    padding: 20px;
    animation: slideInUp 0.5s ease-out;
    /* Cố định phần kết quả ở trên cùng */
    order: -1;
}

.wheel-result h4 {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-content {
    font-size: 18px;
    font-weight: 500;
    height: 100px;
}

.result-name {
    color: #0064c8;
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
}

.result-value {
    font-size: 16px;
    opacity: 0.9;
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .smc-lucky-wheel-container {
        margin: 10px;
        padding: 15px;
        /* Cố định layout để tránh thay đổi kích thước */
        box-sizing: border-box;
    }
    
    .wheel-header h3 {
        font-size: 20px;
    }
    
    .wheel-description {
        font-size: 14px;
    }
    
    .wheel-wrapper {
        width: 500px;
        height: 500px;
        aspect-ratio: 1;
    }
    
    [id^="wheelCanvas-"] {
        max-width: 500px;
        max-height: 500px;
        aspect-ratio: 1;
    }
    
    .wheel-center-button {
        width: 70px;
        height: 70px;
        font-size: 12px;
    }
    
    .wheel-result {
        margin-top: 20px;
        padding: 15px;
    }
    
    .result-name {
        font-size: 18px;
    }
    
    .result-value {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .smc-lucky-wheel-container {
        margin: 5px;
        padding: 10px;
        /* Cố định layout để tránh thay đổi kích thước */
        box-sizing: border-box;
    }
    
    .wheel-header h3 {
        font-size: 18px;
    }
    
    .wheel-wrapper {
        width: 350px;
        height: 350px;
        aspect-ratio: 1;
    }
    
    [id^="wheelCanvas-"] {
        max-width: 350px;
        max-height: 350px;
        aspect-ratio: 1;
    }
    
    .wheel-center-button {
        width: 60px;
        height: 60px;
        font-size: 11px;
    }
}

/* Loading effect */
.wheel-loading {
    position: relative;
}

.wheel-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Hiệu ứng pháo hoa */
.fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.firework {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: firework-explode 2s ease-out forwards;
    box-shadow: 0 0 10px currentColor;
}

@keyframes firework-explode {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

.firework-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: firework-particle 1.5s ease-out forwards;
    box-shadow: 0 0 8px currentColor;
}

@keyframes firework-particle {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(0);
        opacity: 0;
    }
}
