﻿/* Modal Header */
.lixi-modal-header {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    border-bottom: 3px solid #ffd700;
    padding: 20px 30px;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

    .lixi-modal-header .modal-title {
        color: #ffd700;
        font-weight: 900;
        font-size: 28px;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
        animation: glow 2s ease-in-out infinite alternate;
    }

@keyframes glow {
    from {
        text-shadow: 0 0 5px #ffd700, 0 0 10px #ffd700;
    }

    to {
        text-shadow: 0 0 10px #ffd700, 0 0 20px #ff8800, 0 0 30px #ff8800;
    }
}

/* Modal Body */
.lixi-modal-body {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe6e6 100%);
    padding: 40px 30px;
    position: relative;
    overflow: hidden;
    min-height: auto;
}

/* Background Decoration */
.lixi-bg-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.floating-coin {
    position: absolute;
    font-size: 35px;
    opacity: 0.2;
    animation: floatCoin 10s infinite ease-in-out;
}

    .floating-coin:nth-child(1) {
        top: 10%;
        left: 10%;
        animation-delay: 0s;
    }

    .floating-coin:nth-child(2) {
        top: 20%;
        right: 15%;
        animation-delay: 2s;
    }

    .floating-coin:nth-child(3) {
        bottom: 20%;
        left: 20%;
        animation-delay: 4s;
    }

    .floating-coin:nth-child(4) {
        bottom: 10%;
        right: 10%;
        animation-delay: 1s;
    }

    .floating-coin:nth-child(5) {
        top: 50%;
        left: 50%;
        animation-delay: 3s;
    }

@keyframes floatCoin {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.2;
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.4;
    }
}

/* Subtitle */
.lixi-subtitle {
    font-size: 20px;
    color: #cc0000;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* Stats Cards */
.lixi-stat-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    border: 2px solid transparent;
}

    .lixi-stat-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(255, 0, 0, 0.2);
        border-color: #ffd700;
    }

.lixi-stat-icon {
    font-size: 42px;
    margin-bottom: 10px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.lixi-stat-value {
    font-size: 28px;
    font-weight: 900;
    color: #cc0000;
    margin-bottom: 5px;
}

.lixi-stat-label {
    font-size: 15px;
    color: #666;
    font-weight: 600;
}

/* Envelope Wrapper */
.lixi-envelope-wrapper {
    perspective: 1000px;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.lixi-envelope {
    position: relative;
    width: 100%;
    height: 180px;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.lixi-envelope-wrapper:hover .lixi-envelope {
    transform: translateY(-10px) scale(1.05);
}

.lixi-envelope.flipped {
    transform: rotateY(180deg);
}

.lixi-envelope-wrapper.disabled {
    pointer-events: none;
    opacity: 0.4;
    filter: grayscale(80%);
}

/* Envelope Faces */
.lixi-envelope-front,
.lixi-envelope-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.lixi-envelope-front {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    border: 3px solid #ffd700;
}

.envelope-icon {
    font-size: 80px;
    animation: envelopeBounce 2s infinite;
}

@keyframes envelopeBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-10px) scale(1.1);
    }
}

.lixi-envelope-back {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    transform: rotateY(180deg);
    border: 3px solid #ff0000;
}

.envelope-amount {
    font-size: 48px;
    font-weight: 900;
    color: #cc0000;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.envelope-label {
    font-size: 16px;
    color: #ff0000;
    font-weight: 600;
    margin-top: 10px;
}

/* Result Section - THU NHỎ LẠI */
.lixi-result-section {
    display: none;
    text-align: center;
    padding: 30px 25px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: resultAppear 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    z-index: 1;
    margin: 15px 0;
}

@keyframes resultAppear {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.lixi-result-section::before,
.lixi-result-section::after {
    content: '✨';
    position: absolute;
    font-size: 50px;
    opacity: 0.3;
    animation: sparkle 2.5s infinite;
}

.lixi-result-section::before {
    top: -5px;
    left: -5px;
}

.lixi-result-section::after {
    bottom: -5px;
    right: -5px;
    animation-delay: 1.25s;
}

@keyframes sparkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.15) rotate(180deg);
        opacity: 0.6;
    }
}

.result-icon {
    font-size: 55px;
}

.result-title {
    font-size: 28px;
    font-weight: 900;
    color: #cc0000;
    margin: 12px 0 8px;
}

.result-amount {
    font-size: 42px;
    font-weight: 900;
    color: #ff0000;
    margin: 15px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.result-message {
    font-size: 14px;
    color: #990000;
    font-weight: 600;
    margin: 8px 0;
}

/* Buttons */
.btn-lixi-primary {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    border: none;
    color: white !important;
    padding: 10px 25px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

    .btn-lixi-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 0, 0, 0.5);
        color: white !important;
    }

.btn-lixi-secondary {
    background: white;
    border: 2px solid #cc0000;
    color: #cc0000 !important;
    padding: 10px 25px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

    .btn-lixi-secondary:hover {
        background: linear-gradient(135deg, #cc0000 0%, #990000 100%);
        color: white !important;
        transform: translateY(-2px);
        border-color: #cc0000;
    }

/* Modal Customization */
#lixiModal .modal-content {
    border: none;
    overflow: hidden;
}

#lixiModal .modal-xl {
    max-width: 1000px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .lixi-modal-header .modal-title {
        font-size: 24px;
    }

    .lixi-envelope {
        height: 160px;
    }

    .envelope-icon {
        font-size: 60px;
    }

    .envelope-amount {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .lixi-modal-header .modal-title {
        font-size: 20px;
    }

    .lixi-modal-body {
        padding: 30px 20px;
    }

    .lixi-subtitle {
        font-size: 16px;
    }

    .lixi-stat-card {
        padding: 20px 15px;
    }

    .lixi-stat-icon {
        font-size: 36px;
    }

    .lixi-stat-value {
        font-size: 24px;
    }

    .lixi-stat-label {
        font-size: 13px;
    }

    .lixi-envelope {
        height: 140px;
    }

    .envelope-icon {
        font-size: 50px;
    }

    .envelope-amount {
        font-size: 32px;
    }

    .envelope-label {
        font-size: 14px;
    }

    .result-title {
        font-size: 24px;
    }

    .result-amount {
        font-size: 36px;
    }

    .result-message {
        font-size: 13px;
    }

    .btn-lixi-primary,
    .btn-lixi-secondary {
        padding: 10px 25px;
        font-size: 14px;
    }

    .lixi-result-section {
        padding: 25px 20px;
    }

    .result-icon {
        font-size: 48px;
    }

    .lixi-result-section::before,
    .lixi-result-section::after {
        font-size: 40px;
    }
}

@media (max-width: 576px) {
    .lixi-modal-header {
        padding: 15px 20px;
    }

        .lixi-modal-header .modal-title {
            font-size: 18px;
        }

    .lixi-modal-body {
        padding: 25px 15px;
        min-height: 400px;
    }

    .floating-coin {
        font-size: 25px;
    }

    .lixi-envelope {
        height: 120px;
    }

    .envelope-icon {
        font-size: 40px;
    }

    .envelope-amount {
        font-size: 28px;
    }

    .result-icon {
        font-size: 42px;
    }

    .result-title {
        font-size: 22px;
        margin: 10px 0 6px;
    }

    .result-amount {
        font-size: 32px;
        margin: 12px 0;
    }

    .result-message {
        font-size: 12px;
        margin: 6px 0;
    }

    .btn-lixi-primary,
    .btn-lixi-secondary {
        display: block;
        width: 100%;
        margin: 5px 0;
        padding: 10px 20px;
        font-size: 13px;
    }

    .lixi-result-section {
        padding: 20px 15px;
        margin: 10px 0;
    }

        .lixi-result-section::before,
        .lixi-result-section::after {
            font-size: 35px;
        }
}

/* Loading State */
#lixiLoading {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Animation Performance */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25) !important;
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: #dc3545;
    font-weight: 600;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }

    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

/* Smaller envelopes for 11 items */
.lixi-envelope {
    height: 140px;
}

.envelope-icon {
    font-size: 50px;
}

.envelope-amount {
    font-size: 32px;
}

.envelope-label {
    font-size: 12px;
}

@media (max-width: 768px) {
    .lixi-envelope {
        height: 120px;
    }

    .envelope-icon {
        font-size: 40px;
    }

    .envelope-amount {
        font-size: 28px;
    }

    .envelope-label {
        font-size: 11px;
    }
}

@media (max-width: 576px) {
    .lixi-envelope {
        height: 100px;
    }

    .envelope-icon {
        font-size: 35px;
    }

    .envelope-amount {
        font-size: 24px;
    }

    .envelope-label {
        font-size: 10px;
    }
}
