/* KQXS Dò Số Styles */

/* Wrapper */
.kqxs-doso-wrapper {
    max-width: 600px;
    margin: 20px auto;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

/* Header */
.kqxs-doso-header {
    text-align: center;
    margin-bottom: 25px;
    color: #fff;
}

.kqxs-doso-header h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.kqxs-doso-desc {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

/* Form */
.kqxs-doso-form {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.kqxs-doso-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.kqxs-doso-field {
    flex: 1;
}

.kqxs-doso-field label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.kqxs-doso-input,
.kqxs-doso-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.kqxs-doso-input {
    letter-spacing: 8px;
    text-align: center;
    font-family: 'Courier New', monospace;
}

.kqxs-doso-input:focus,
.kqxs-doso-select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.kqxs-doso-input::placeholder {
    letter-spacing: 1px;
    font-size: 14px;
    color: #aaa;
}

.kqxs-doso-hint {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.kqxs-doso-select {
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 35px;
}

/* Actions */
.kqxs-doso-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.kqxs-doso-btn {
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kqxs-doso-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.kqxs-doso-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.kqxs-doso-btn-primary:active {
    transform: translateY(0);
}

.kqxs-doso-btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #e0e0e0;
}

.kqxs-doso-btn-secondary:hover {
    background: #eee;
    border-color: #ccc;
}

/* Loading state */
.kqxs-doso-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.kqxs-doso-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

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

/* Error */
.kqxs-doso-error {
    padding: 15px;
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

/* Modal */
.kqxs-doso-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.kqxs-doso-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.kqxs-doso-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.kqxs-doso-modal-content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.kqxs-doso-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.3s ease;
    z-index: 10;
}

.kqxs-doso-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.kqxs-doso-modal-body {
    padding: 30px;
}

/* Win Result */
.kqxs-doso-win {
    text-align: center;
}

.kqxs-doso-win-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 0.6s ease infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

.kqxs-doso-win-title {
    font-size: 28px;
    font-weight: 700;
    color: #4caf50;
    margin-bottom: 10px;
}

.kqxs-doso-win-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 25px;
}

.kqxs-doso-win-number {
    display: inline-block;
    padding: 10px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 5px;
    border-radius: 10px;
    margin-bottom: 25px;
    font-family: 'Courier New', monospace;
}

/* Prize List */
.kqxs-doso-prize-list {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.kqxs-doso-prize-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #4caf50;
}

.kqxs-doso-prize-item:last-child {
    margin-bottom: 0;
}

.kqxs-doso-prize-name {
    font-weight: 600;
    color: #333;
}

.kqxs-doso-prize-amount {
    font-weight: 700;
    color: #e53935;
    font-size: 18px;
}

.kqxs-doso-prize-db {
    border-left-color: #ff9800;
    background: linear-gradient(135deg, #fff9e6 0%, #fff 100%);
}

.kqxs-doso-prize-db .kqxs-doso-prize-amount {
    color: #ff6f00;
    font-size: 22px;
}

/* Total */
.kqxs-doso-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    border-radius: 10px;
    color: #fff;
    margin-bottom: 20px;
}

.kqxs-doso-total-label {
    font-size: 16px;
}

.kqxs-doso-total-amount {
    font-size: 24px;
    font-weight: 700;
}

/* Deadline */
.kqxs-doso-deadline {
    background: #fff3e0;
    border: 1px solid #ffcc80;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.kqxs-doso-deadline-title {
    font-weight: 600;
    color: #e65100;
    margin-bottom: 5px;
}

.kqxs-doso-deadline-date {
    font-size: 18px;
    font-weight: 700;
    color: #bf360c;
}

.kqxs-doso-deadline-days {
    font-size: 13px;
    color: #ff6d00;
    margin-top: 5px;
}

/* Lose Result */
.kqxs-doso-lose {
    text-align: center;
    padding: 20px 0;
}

.kqxs-doso-lose-icon {
    font-size: 70px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.kqxs-doso-lose-title {
    font-size: 22px;
    font-weight: 600;
    color: #666;
    margin-bottom: 15px;
}

.kqxs-doso-lose-message {
    font-size: 16px;
    color: #888;
    line-height: 1.6;
}

.kqxs-doso-lose-number {
    display: inline-block;
    padding: 8px 20px;
    background: #f5f5f5;
    color: #666;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 4px;
    border-radius: 8px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
}

/* Responsive */
@media (max-width: 600px) {
    .kqxs-doso-wrapper {
        margin: 10px;
        padding: 15px;
    }
    
    .kqxs-doso-header h3 {
        font-size: 20px;
    }
    
    .kqxs-doso-form {
        padding: 20px 15px;
    }
    
    .kqxs-doso-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .kqxs-doso-actions {
        flex-direction: column;
    }
    
    .kqxs-doso-btn {
        width: 100%;
        justify-content: center;
    }
    
    .kqxs-doso-input {
        font-size: 20px;
        letter-spacing: 6px;
    }
    
    .kqxs-doso-modal-body {
        padding: 20px;
    }
    
    .kqxs-doso-win-icon,
    .kqxs-doso-lose-icon {
        font-size: 60px;
    }
    
    .kqxs-doso-win-title {
        font-size: 22px;
    }
    
    .kqxs-doso-win-number {
        font-size: 22px;
        letter-spacing: 4px;
    }
}

/* Confetti animation for winning */
.kqxs-doso-confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.kqxs-doso-confetti span {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #f00;
    animation: confetti-fall 3s ease-in-out infinite;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100%) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}
