:root {
    --primary-glow: #404f30;
    --primary-glow-rgb: 64, 79, 48;
    --secondary-glow: #5c7048;
    --dark-bg: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-glow: rgba(64, 79, 48, 0.12);
    --text-color: #2d3722;
    --text-muted: #607350;
    --input-bg: #fdfdfb;
    --input-border: #ccd1c3;
}

.luckywheel-wrapper {
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at 50% 50%, #f4f5f1 0%, var(--dark-bg) 100%);
    min-height: 100vh;
    padding: 60px 15px;
    position: relative;
    overflow: hidden;
    color: var(--text-color);
}

.luckywheel-container {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

/* Floating Light Orbs */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(150px);
    z-index: 1;
    opacity: 0.15;
}
.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-glow);
    top: -100px;
    left: -100px;
}
.orb-2 {
    width: 450px;
    height: 450px;
    background: var(--secondary-glow);
    bottom: -150px;
    right: -100px;
}

/* Glassmorphism Card */
.glass-card {
    background-color: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glow);
    border-radius: 24px;
    width: 460px;
    padding: 40px 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08), 
                inset 0 1px 1px rgba(255,255,255,0.6);
    position: relative;
    z-index: 5;
    overflow: hidden;
}

.program-title {
    font-family: 'Prata', serif;
    font-size: 25px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary-glow) 0%, var(--secondary-glow) 100%); 
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

.program-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Modern Input Fields */
.modern-input-group {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
}
.modern-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 16px 20px;
    color: var(--text-color);
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}
.modern-input:focus {
    border-color: var(--primary-glow);
    box-shadow: 0 0 15px rgba(64, 79, 48, 0.2);
}
.modern-label {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.3s ease;
    font-size: 15px;
}
.modern-input:focus ~ .modern-label,
.modern-input:not(:placeholder-shown) ~ .modern-label {
    top: 0;
    font-size: 12px;
    padding: 2px 8px;
    background: #ffffff;
    color: var(--primary-glow);
    border-radius: 4px;
}

/* Glow Button */
.btn-primary-glow {
    background: linear-gradient(135deg, var(--primary-glow) 0%, var(--secondary-glow) 100%);
    border: none;
    border-radius: 12px;
    padding: 16px 28px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(64, 79, 48, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-primary-glow:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(64, 79, 48, 0.5);
}
.btn-primary-glow:active {
    transform: translateY(0);
}
.btn-primary-glow:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}
.btn-loader {
    display: none;
}
.btn-primary-glow.loading .btn-text {
    display: none;
}
.btn-primary-glow.loading .btn-loader {
    display: inline-block;
}
.m-top {
    margin-top: 15px;
}
.btn-block {
    width: 100%;
}

.error-msg {
    min-height: 0;
    transition: all 0.3s ease;
}
.error-msg:not(:empty) {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    padding: 12px 16px;
    border-radius: 12px;
    color: #b91c1c;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.06), 
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
    animation: slideDown 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    margin-top: 15px;
    width: 100%;
}
.error-msg:not(:empty)::before {
    content: "\f071"; /* Warning icon */
    font-family: FontAwesome;
    margin-right: 8px;
    color: #ef4444;
    font-size: 14px;
}

/* User Welcome Panel */
.welcome-section {
    animation: fadeIn 0.5s ease forwards;
}
.user-profile {
    margin-bottom: 25px;
}
.avatar-glow {
    font-size: 60px;
    color: var(--primary-glow);
    text-shadow: 0 0 20px rgba(64, 79, 48, 0.3);
    margin-bottom: 10px;
}
.user-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
}
.turns-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.turns-badge {
    background: rgba(64, 79, 48, 0.08);
    border: 1px solid rgba(64, 79, 48, 0.25);
    padding: 8px 24px;
    border-radius: 50px;
    display: inline-block;
    box-shadow: 0 0 15px rgba(64, 79, 48, 0.05);
}
.turns-count {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-glow);
}
.rules-info {
    text-align: left;
    background: #f7f8f6;
    border: 1px solid #e1e4dc;
    border-radius: 12px;
    padding: 20px;
}
.rules-info h5 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-color);
}
.rules-info ul {
    padding-left: 15px;
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.8;
}

/* Lucky Wheel UI */
.wheel-box {
    position: relative;
    display: flex;
    width: calc(100% - 460px);
    justify-content: right;
}
.wheel-outer-ring {
    width: 580px;
    height: 580px;
    border-radius: 50%;
    background: #f7f8f6;
    border: 14px solid #e1e4dc;
    box-shadow: 0 15px 45px rgba(0,0,0,0.1),
                0 0 0 2px rgba(0,0,0,0.05),
                0 0 35px rgba(64, 79, 48, 0.15);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}
.canvas-wrapper {
    width: 550px;
    height: 550px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
}
#wheelCanvas {
    display: block;
    transform: rotate(0deg);
}

/* Pointer arrow */
.wheel-pointer {
    width: 44px;
    height: 52px;
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}
.wheel-pointer::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 22px solid transparent;
    border-right: 22px solid transparent;
    border-top: 36px solid var(--primary-glow);
}
.wheel-pointer::after {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.history-wrapper{
    margin-top: 40px;
}

.history-card .card-head{
    margin-bottom: 20px;
    justify-content: space-between;
}

.history-card h3{
    margin-bottom: 0;
    font-weight: 600;
    font-size: 24px;
    text-transform: uppercase;
}

.history-stats {
    display: flex;
    gap: 10px;
}

.stat-badge {
    background: #f7f8f6;
    border: 1px solid #e1e4dc;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-color);
}
.stat-badge.stat-prize {
    background: rgba(234, 179, 8, 0.1);
    border-color: rgba(234, 179, 8, 0.3);
    color: #b45309;
}
.stat-badge i {
    margin-right: 5px;
    opacity: 0.7;
}

.history-card thead{
    position: sticky;
    top: 0;
    background: rgb(64 79 47);
    color: #fff;
    z-index: 1;
}

.history-card thead th{
    border: none;
    padding: 12px;
    font-weight: 600;"
}

.history-card tbody tr{
    border-bottom: 1px solid rgb(233 233 233 / 71%)
}

.history-card tbody tr td{
    padding: 12px;
    border: none;
}

/* Spin Button Center */
.spin-btn-center {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, #f4f5f1 60%, #ccd1c3 100%);
    border: 5px solid #ccd1c3;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 110;
    cursor: pointer;
    font-family: inherit;
    font-weight: 800;
    font-size: 16px;
    color: var(--primary-glow);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15),
                inset 0 2px 2px #fff,
                0 0 0 6px rgba(64, 79, 48, 0.2);
    outline: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.spin-btn-center:hover:not(:disabled) {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2),
                inset 0 2px 2px #fff,
                0 0 20px rgba(64, 79, 48, 0.4);
}
.spin-btn-center:active:not(:disabled) {
    transform: translate(-50%, -50%) scale(0.95);
}
.spin-btn-center:disabled {
    background: radial-gradient(circle, #f4f5f1 0%, #dcded8 100%);
    color: #a1a1aa;
    border-color: #dcded8;
    box-shadow: none;
    cursor: not-allowed;
}

/* Modal Custom styling */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.modal-backdrop {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
}
.modal-content-wrapper {
    position: relative;
    z-index: 10010;
    width: 90%;
    max-width: 480px;
}
.modal-card {
    padding: 40px 30px;
    border: 1px solid var(--border-glow);
    box-shadow: 0 30px 60px rgba(0,0,0,0.15),
                0 0 50px rgba(64, 79, 48, 0.25);
}
.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}
.modal-close-btn:hover {
    color: var(--text-color);
}
.modal-icon {
    font-size: 55px;
    color: #eab308;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(234, 179, 8, 0.15);
}
.modal-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 15px;
}
.modal-body {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 25px;
}
.btn-sm {
    padding: 12px 35px;
    font-size: 14px;
}

.confetti-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.scale-in {
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responsive adjustments */
@media(max-width: 767px) {
    .luckywheel-wrapper {
        padding: 30px 10px;
    }
    .glow-orb{
        display: none;
    }
    .glass-card {
        width: 100%;
        padding: 25px 20px;
    }
    .wheel-box {
        padding: 10px;
        margin-top: 30px;
        width: 100%;
    }
    .wheel-outer-ring {
        width: 320px;
        height: 320px;
        border-width: 10px;
    }
    .canvas-wrapper,
    #wheelCanvas{
        width: 100% !important;
        height: 100% !important;
    }

    .wheel-pointer {
        width: 32px;
        height: 40px;
        top: -12px;
    }
    .wheel-pointer::before {
        border-left-width: 16px;
        border-right-width: 16px;
        border-top-width: 26px;
    }
    .spin-btn-center {
        width: 60px;
        height: 60px;
        font-size: 13px;
        border-width: 4px;
    }

    .table-responsive{
        border: none;
    }

    .table-responsive>.table>tbody>tr>td{
        white-space: wrap;
    }

    /* Mobile History Table */
    .history-card table, 
    .history-card thead, 
    .history-card tbody, 
    .history-card th, 
    .history-card td, 
    .history-card tr {
        display: block;
    }
    
    .history-card thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .history-card tr {
        border: 1px solid #e1e4dc !important;
        padding: 10px;
        margin-bottom: 15px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.7);
        box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    }
    
    .history-card td {
        border: none !important;
        position: relative;
        padding-left: 50% !important;
        text-align: right;
        font-size: 14px;
        padding-top: 5px !important;
        padding-bottom: 5px !important;
    }
    
    .history-card td:before {
        position: absolute;
        top: 8px;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
        color: var(--text-muted);
    }
    
    .history-card td:nth-of-type(1):before { content: "STT"; }
    .history-card td:nth-of-type(2):before { content: "Khách hàng"; }
    .history-card td:nth-of-type(3):before { content: "Số điện thoại"; }
    .history-card td:nth-of-type(4):before { content: "Thời gian quay"; }
    .history-card td:nth-of-type(5):before { content: "Kết quả"; }
}